Spica CLI

Install @spica/cli to run Spica locally with Docker, manage resources as code, and automate deployments from CI.

@spica/cli is the command-line tool for working with Spica. It does three jobs:

JobCommands
Run Spica on your machinespica project start, ls, upgrade, remove
Keep buckets, functions, policies, env vars and secrets in filesspica fetch, plan, apply, dev, env, secret, guard
Connect to instances and generate codespica context, bucket orm, function orm, asset, project sync

Install

Terminal
npm install -g @spica/cli
spica --version

Requirements:

  • Node.js 20 or newer.
  • Docker, for spica project commands.

Use the CLI version that matches your Spica instances, for example npm install -g @spica/cli@0.22.1.

Getting help

Terminal
spica --help
spica help project start

Global options:

OptionEffect
-h, --helpShow help.
-V, --versionShow the version.
-v, --verboseAlso print debug messages.
--quietOnly print warnings and errors.
--silentPrint nothing. Use the exit code.
--no-colorDisable colors.

A typical workflow

Terminal
# 1. Run a local instance
spica project start dev

# 2. Point the CLI at it
spica context set --name local --url http://localhost:4500/api --apikey <key>
spica context switch local

# 3. Export its resources into your repository
spica fetch

# 4. Edit files with live sync
spica dev

# 5. Review and deploy to another instance
spica context switch production
spica plan
spica apply

Next steps