API Reference
@taserjs/router-cli
Complete CLI command options, route scanning flags, ambient type generation, and project scaffolding reference for @taserjs/router-cli.
The @taserjs/router-cli package provides command-line tooling to generate ambient TypeScript definitions and scaffold empty route files outside the development server.
Commands
taser generate
Scans the routes directory, resolves project configuration, fills blank route files, and writes .taser/types/routes.d.ts.
taser generate [--dir <path>] [--routesDir <path>]CLI Flags Reference
Prop
Type
Configuration Resolution
taser generate automatically inspects your project build configuration in the following order:
vite.config.ts: Extractstaser()plugin options (routesDir,serverDir,entry,ignore).nitro.config.ts: Extractstaser()module options.- Defaults: Falls back to
src/routesandsrc/taser.ts.
TypeScript Integration
To ensure TypeScript checks your route files accurately in CI or pre-commit hooks, prepend taser generate to your typecheck script:
{
"scripts": {
"typecheck": "taser generate && tsc --noEmit -p tsconfig.json"
}
}