New projects

radlang new myapp
radlang new mytool --template cli
radlang new myapi --template api
radlang new myserver --template mcp

--template selects bundled starter files. The default is app; there is no --type or -t alias. Invalid choices fail before creating a directory. Templates are embedded in the compiler and need no checkout or network download. A matching bundled/installed stdlib package is required.

Template Starter Workflow
app Minimal native application, hello-world namespace and test run / build / rtest
cli Help, greeting subcommand, argument checks and exit codes run src/main.rad – greet Ada
api Annotated controllers, typed JSON health/echo routes and HTTP test run / build / rtest
web HTML rendering with escaped input and a static landing page run / build / rtest
lib Exported namespace, tests and RLP packaging; no executable main lib / export / rtest
gui Native Syn window, button event and pure helper test build / run on supported host
mcp Local HTTP MCP server, typed greet tool and HTTP test run / build / rtest

Every project includes a README, a test/ starter, config, agent guidance and ignore rules. The only precompiled dependency copied is lib/stdlib.rlp, with an exact version and relative package reference. No loose .rlc is copied, including when the input is a legacy flat stdlib directory. Later namespace builds create ignored RLC outputs. Nested target RLCs, build output and .radenv are ignored; the project’s own ignore rules keep the vendored RLP.

Related commands:

  • radlang init-agent [-d DIR] installs the radlang-dev agent instructions (.claude/agents/, .agents/agents/) into an existing repository.
  • radlang add --path <PACKAGE.rlp> installs a local .rlp package into lib/ and adds it to config.yaml.
  • radlang fmt [FILE] prints the formatted source; without a file, or with --stdin, it reads the source from stdin.

A library project name such as my-library yields namespace my_library. Reserved language/builtin names and numeric names receive a project_ prefix. Read its README and generated namespace for the exported module name.

API/web/MCP projects default to port 8080 in config env. The API and MCP tests use separate testPort 18783; choose another available test port if needed. Servers are created on demand, not at import time. Tests close their background servers. The MCP starter binds to localhost at /mcp and uses the packaged MCP library, with no stdin transport or extra dependencies.

Project files are rendered in a sibling staging directory and selected only once all writes succeed. Existing nonempty directories and symlinks are refused. Names must be portable filenames; reserved device names, path separators, shell metacharacters and trailing dots/spaces are rejected. Empty existing directories can be used. A failed write preserves the destination and removes its stage. Windows uses empty-directory removal/restoration around rename where POSIX allows an atomic empty-directory replacement; native Windows behavior still needs its platform test gate.

Project kind and build target are separate. Use the existing build/export target options for cross-compilation and provide matching target RLPs; this flag does not introduce a new new --target option. Native Syn scaffolding is refused on a Windows host until that backend is available.

rtest currently requires the matching development runtime/test harness; the embedded-only installed test harness remains separate work. Native linking also requires supported platform SDK/linker dependencies. GUI validation in this pass compiles the window program and runs its pure helper test without opening a UI. Only macOS arm64 has been exercised here; Linux/Windows native installation gates remain future work.

Template sources live in templates/scaffold/. The compiler build rejects loose compiled libraries and private environment files in template assets. Updating the bundled templates requires rebuilding the compiler.