CLI Commands
@stratal/inertia registers a set of Quarry commands that scaffold, run, build, and generate types for your Inertia application. They run through the core quarry binary, so you invoke them with npx quarry <command> from any project that has @stratal/inertia installed.
Commands overview
Section titled “Commands overview”| Command | Description |
|---|---|
inertia:install | Scaffold the Inertia directory structure and starter files |
inertia:dev | Start the Vite development server with HMR |
inertia:build | Build client and SSR bundles for production |
inertia:types | Generate TypeScript types for page components |
Run npx quarry help to see every registered command in your terminal.
inertia:install
Section titled “inertia:install”Scaffolds the Inertia directory structure and creates starter files so you can begin building immediately.
npx quarry inertia:installThis creates the following files:
| File | Purpose |
|---|---|
src/inertia/app.tsx | Client-side entry point |
src/inertia/root.html | Root HTML template |
src/inertia/ssr.tsx | SSR entry point |
src/inertia/pages/Home.tsx | Sample page component |
src/inertia/public/.gitkeep | Public assets directory |
If src/app.module.ts exists, the command also adds an InertiaModule.forRoot({ rootView, ssr }) import to your module, skipping the change if it is already configured.
| Flag | Description |
|---|---|
--skip-deps | Skip printing the dependency install hint at the end. |
inertia:dev
Section titled “inertia:dev”Starts the Vite development server with hot module replacement.
npx quarry inertia:dev| Flag | Default | Description |
|---|---|---|
--port | 5173 | Port for the Vite development server. |
--host | - | Expose the dev server to your local network. |
--inspector-port | - | Worker debugger inspector port. Set a distinct value per worker to avoid port collisions when running multiple Inertia workers, or false to disable. |
--persist-to | - | Shared persist directory for the Cloudflare Vite plugin (relative to cwd). Use it to share R2/KV/cache emulator state across workers in dev. |
Example
Section titled “Example”npx quarry inertia:dev --port=3000 --hostinertia:build
Section titled “inertia:build”Builds the client bundle and, optionally, the SSR bundle for production deployment.
npx quarry inertia:build| Flag | Default | Description |
|---|---|---|
--outDir | dist | Output directory for the build. |
--ssr | - | Also build the SSR bundle. |
Examples
Section titled “Examples”Build both client and SSR bundles:
npx quarry inertia:build --ssrBuild to a custom output directory:
npx quarry inertia:build --outDir=buildinertia:types
Section titled “inertia:types”Generates TypeScript type definitions for your page components. It scans src/inertia/pages/ for React components and produces types for the page registry, enabling type-safe rendering from your controllers.
npx quarry inertia:types| Flag | Description |
|---|---|
--watch | Regenerate types automatically when page files change. |
Example
Section titled “Example”Run in watch mode during development:
npx quarry inertia:types --watch