Create a Project
create-routa-ts generates a complete TypeScript Routa application: a working route with
schemas and a test, Biome and TypeScript configuration, an OpenAPI starter document, and
the committed .routa/ metadata that Routa checks against.
Before You Start
Section titled “Before You Start”- Node.js 24 or later.
- A directory where the new project folder can be created.
-
Run the scaffolder. It detects the package manager that invoked it and uses that one for installation and for the commands it prints at the end.
Terminal window npm create routa-ts@latestTerminal window pnpm create routa-ts@latestTerminal window yarn create routa-tsTerminal window bun create routa-ts@latestA successful run ends with the target directory it created:
Your Routa app is ready in 'routa-app'. -
Answer the prompts. Every prompt has a matching flag if you would rather not be asked.
Prompt Flags Default Project name positional argument routa-appInclude a starter OpenAPI file? --openapi/--no-openapiinclude Initialize a new git repository? --git/--no-gityes when interactive Install dependencies? --install/--no-installyes when interactive Continue with these settings? --yes/-yskips it— -
Enter the project directory.
Terminal window cd routa-apppwd…/routa-app -
Install dependencies if you declined the install prompt.
Terminal window npm installTerminal window pnpm installTerminal window yarn installTerminal window bun installConfirm the install produced the dependency tree:
Terminal window test -d node_modules && echo "Dependencies installed."Dependencies installed. -
Start the development server.
Terminal window npm run devTerminal window pnpm run devTerminal window yarn run devTerminal window bun run devA successful start emits the
api.startedlifecycle event with the bound host and port:INFO api.started Routa API started. {"host":"127.0.0.1","port":3000,"routes":1}
Verify
Section titled “Verify”The generated /status route responds immediately:
curl http://127.0.0.1:3000/status{ "ok": true }What It Creates
Section titled “What It Creates”- .nvmrc
- .gitignore
- biome.json
- package.json
- tsconfig.json
- openapi.yaml starter document, omitted with
--no-openapi Directorysrc/
- routa.ts
Directoryroutes/
Directorystatus/
- route.ts
- schemas.ts
- route.test.ts
Directory.routa/
- manifest.json
- openapi-baseline.json
- routes.gen.ts
The .routa/ files are only generated when the starter OpenAPI document is included.
Without it, run routa generate once to produce route metadata.
Non-Interactive Use
Section titled “Non-Interactive Use”In CI or a script, pass every flag so the scaffolder never prompts:
npm create routa-ts@latest my-api -- --yes --no-git --no-installpnpm create routa-ts@latest my-api --yes --no-git --no-installyarn create routa-ts my-api --yes --no-git --no-installbun create routa-ts@latest my-api --yes --no-git --no-installYour Routa app is ready in 'my-api'.Troubleshooting
Section titled “Troubleshooting”| Problem | Fix |
|---|---|
Command "<manager> install" did not run successfully. |
The project files were still written. Enter the directory and install manually. |
git init failed. |
Git is missing or the directory is inside an existing repository. The project itself is fine; re-run git init yourself if you want one. |
| The wrong package manager appears in the output. | Detection reads npm_config_user_agent. Invoke the scaffolder through the create command of the manager you want. |
| The target directory already exists and is not empty. | Choose a different project name, or clear the directory first. |