Rocket ships a small CLI for local development and production builds. Use the project-local binary
through npm scripts or npx.
rocket init#Creates the smallest durable Rocket project shape in the current npm project:
npx rocket init
The initializer creates rocket-config.js, docs/pages/index.rocket.md, and
.agents/skills/rocket/SKILL.md when those files do not exist. It also updates package.json when
possible:
"type": "module" when type is missingstart and build scripts when those names are availablerocket:start and rocket:build when existing project scripts already use start or
buildrocket init does not overwrite existing files, install dependencies, add @rocket/js to
package.json, or run a build. Existing CommonJS projects are rejected before any files are
written.
rocket start#Starts the development server:
npx rocket start
The dev server opens the browser, listens on port 8888 by default, and can be restarted with
Ctrl+R in the terminal.
rocket build#Runs a production build:
npx rocket build
Static Pages are rendered into dist/. If an adapter is configured, Rocket also gives the adapter
the discovered static and server-rendered Pages so it can write deployment-specific output.
-c, --config-file <path>#Load a config file other than rocket-config.js:
npx rocket -c ./config/rocket-config.js start
npx rocket -c ./config/rocket-config.js build
build -o, --output-dir <path>#Write static build output to a directory other than dist/:
npx rocket build --output-dir ./site-dist
Do not use public/ as the build output directory. Rocket reserves project-root public/ for
Public Assets.
For repeatable project commands, add scripts:
{
"scripts": {
"start": "rocket start",
"build": "rocket build"
}
}
Then run:
npm start
npm run build
See Configuration for the rocket-config.js file these commands load.
rocket init adds these scripts automatically when the names are not already used.
Rocket requires Node.js 22 or newer.
For the current command list, run:
npx rocket --help