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:

  1. vite.config.ts: Extracts taser() plugin options (routesDir, serverDir, entry, ignore).
  2. nitro.config.ts: Extracts taser() module options.
  3. Defaults: Falls back to src/routes and src/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:

package.json
{
  "scripts": {
    "typecheck": "taser generate && tsc --noEmit -p tsconfig.json"
  }
}