Skip to content

CLI Commands

The Quarry CLI provides commands for scaffolding, developing, building, and generating types for your Inertia application. All commands are registered automatically when InertiaModule is imported in your application module.

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

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/ssr.tsxServer-side rendering entry point
src/inertia/root.htmlRoot HTML template
src/inertia/pages/Home.tsxSample page component
FlagDescription
--skip-depsSkip installing npm dependencies. Use this if you want to manage dependencies yourself.

Starts the Vite development server with hot module replacement enabled. This is the recommended way to develop Inertia applications.

Terminal window
npx quarry inertia:dev
FlagDefaultDescription
--port5173Port for the Vite development server
--hostExpose the server to your local network
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
--ssrAlso 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 InertiaPageRegistry, 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