Dev

CLI Reference

Every cloudcart nitrogen command — init, dev, build, preview, link, env, generate, deploy.

All commands run from (or accept --path to) the storefront project root.

nitrogen init

Create a new Nitrogen storefront project.

cloudcart nitrogen init my-storefront

# Non-interactive: mock store, TypeScript, npm
cloudcart nitrogen init my-storefront --defaults

# Skip dependency install / git init
cloudcart nitrogen init my-storefront --no-install --no-git
FlagDescription
--defaultsUse defaults (mock store, TypeScript, npm)
--package-managernpm, pnpm, yarn, or bun
--languageTypeScript or JavaScript
--no-installSkip dependency installation
--no-gitSkip git initialization

nitrogen dev

Start the local dev server.

cloudcart nitrogen dev
cloudcart nitrogen dev --port 4000

nitrogen build

Production build.

cloudcart nitrogen build

nitrogen preview

Serve the production build locally — what Nova will serve, on your machine.

cloudcart nitrogen preview

Link the local project to a storefront created in the admin.

cloudcart nitrogen link --store mystore.cloudcart.com --storefront "My Headless Store"
FlagDescription
-s, --storeStore URL
--storefrontStorefront name to link to
--forceOverwrite an existing link
--pathProject root (default .)

nitrogen env

Sync environment variables with the linked store.

cloudcart nitrogen env pull    # download to .env
cloudcart nitrogen env push    # upload local .env
cloudcart nitrogen env list    # list environments

nitrogen generate

Scaffold routes from templates.

cloudcart nitrogen generate route product
cloudcart nitrogen generate routes    # all standard routes

nitrogen deploy

Build and deploy to Nova. See Deploying for token setup and CI examples.

cloudcart nitrogen deploy
cloudcart nitrogen deploy --preview
cloudcart nitrogen deploy --token cc_nova_xxx
FlagDescription
-t, --tokenNova deploy token (or CLOUDCART_NOVA_TOKEN env var)
--previewDeploy as preview instead of production
--no-buildSkip the build step
--env-filePath to .env (default .env)
--pathStorefront root (default .)

On this page