CLI

Command-line interface for Shovel.


Commands

CommandDescription
shovel createCreate a new project
shovel developStart development server
shovel buildBuild for production

shovel create

shovel create [name]
npm create shovel

Templates

TemplateDescription
hello-worldMinimal fetch handler
apiREST endpoints
static-siteStatic file serving
full-stackHTML + API + assets

shovel develop

shovel develop <entrypoint> [options]

Options

OptionDescriptionDefault
-p, --port <port>Server port7777
-h, --host <host>Server hostlocalhost
-w, --workers <count>Worker count1
--platform <name>Target platformAuto-detected

Examples

shovel develop src/server.ts
shovel develop src/server.ts --port 8080
shovel develop src/server.ts --host 0.0.0.0

shovel build

shovel build <entrypoint> [options]

Options

OptionDescriptionDefault
--platform <name>Target platformAuto-detected
--lifecycle [stage]Run lifecycle events-

Examples

shovel build src/server.ts
shovel build src/server.ts --platform cloudflare
shovel build src/server.ts --lifecycle

Output

Node.js / Bun:

dist/
├── server/
│   ├── worker.js
│   ├── server.js
│   └── config.js
└── public/

Cloudflare:

dist/
├── server/
│   └── server.js
└── public/

--lifecycle

Runs ServiceWorker lifecycle events without starting server.

StageEvents
installinstall only
activateinstall + activate (default)

Platform Detection

  1. CLI --platform option
  2. platform in shovel.json
  3. Cloudflare Workers environment
  4. Runtime detection (bun or node)

Environment Variables

VariableCLI Option
PORT--port
HOST--host
WORKERS--workers
PLATFORM--platform

See Also