Skip to content

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.

CommandDescription
inertia:installScaffold the Inertia directory structure and starter files
inertia:devStart the Vite development server with HMR
inertia:buildBuild client and SSR bundles for production
inertia:typesGenerate TypeScript types for page components

Run npx quarry help to see every registered command in your terminal.

Scaffolds the Inertia directory structure and creates starter files so you can begin building immediately.

Terminal window
npx quarry inertia:install

This creates the following files:

FilePurpose
src/inertia/app.tsxClient-side entry point
src/inertia/root.htmlRoot HTML template
src/inertia/ssr.tsxSSR entry point
src/inertia/pages/Home.tsxSample page component
src/inertia/public/.gitkeepPublic 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.

FlagDescription
--skip-depsSkip printing the dependency install hint at the end.

Starts the Vite development server with hot module replacement.

Terminal window
npx quarry inertia:dev
FlagDefaultDescription
--port5173Port 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.
Terminal window
npx quarry inertia:dev --port=3000 --host

Builds the client bundle and, optionally, the SSR bundle for production deployment.

Terminal window
npx quarry inertia:build
FlagDefaultDescription
--outDirdistOutput directory for the build.
--ssr-Also build the SSR bundle.

Build both client and SSR bundles:

Terminal window
npx quarry inertia:build --ssr

Build to a custom output directory:

Terminal window
npx quarry inertia:build --outDir=build

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.

Terminal window
npx quarry inertia:types
FlagDescription
--watchRegenerate types automatically when page files change.

Run in watch mode during development:

Terminal window
npx quarry inertia:types --watch