Command reference
Every Spica CLI command with its arguments and options.
Run spica help <command> for the same information in your terminal.
Projects
spica project start <name>
Start a local project with Docker. See Local projects.
| Option | Default |
|---|---|
--image-version | latest |
-p, --port | 4500 |
--database-type | mongodb (mongodb, postgresql) |
--database-replicas | 1 |
--mongo-version | 8.0 |
--postgres-version | 18 |
--api-options <file> | |
--local-resource-folder <dir> | |
--image-pull-policy | if-not-present (if-not-present, default) |
-o, --open | |
-f, --force | |
--retain-volumes | true |
--restart | true |
spica project ls
List local projects.
spica project upgrade <name> <to>
Upgrade a local project to version <to>. Option: --restart (default true).
spica project remove <name>
Remove a local project. Option: --retain-volumes (default true).
spica project sync
Copy resources between two instances. See Project sync.
| Option | |
|---|---|
--source-url, --source-apikey | Required |
--target-url, --target-apikey | Required |
--modules | Required: bucket, function, bucket-data, apikey, policy, env-var |
--bucket-ids, --function-ids, --apikey-ids, --policy-ids, --env-var-ids | |
--dry-run | |
--concurrency-limit | Default 100 |
--ignore-errors |
Contexts
| Command | Description |
|---|---|
spica context set --name <name> --url <url> --apikey <key> | Create or update a context. |
spica context switch <name> | Select a context. |
spica context ls | List contexts. |
spica context remove <name> | Remove a context. |
Resources as code
All commands take an optional [dir], the project directory (default: the current directory). See Resources as code.
spica fetch [dir]
| Option | Default |
|---|---|
-y, --auto-approve | false |
--clean | false |
--module <name> | All |
--detailed | false |
--concurrency <n> | 10 |
--abort-on-error | false |
spica plan [dir]
| Option | Default |
|---|---|
--detailed | false |
--detailed-exitcode | false |
--json | false |
--module <name> | All |
--concurrency <n> | 10 |
spica apply [dir]
| Option | Default |
|---|---|
-y, --auto-approve | false |
--detailed | false |
--module <name> | All |
--concurrency <n> | 5 |
--abort-on-error | false |
spica dev [dir]
| Option | Default |
|---|---|
--module <name> | All |
--concurrency <n> | 10 |
--module accepts policy, bucket, env-var, secret or function.
spica env <key> <value>
Set an environment variable's value for the current context. See Values per environment.
spica secret <key>
Set a secret's value for the current context. Prompts for the value.
spica guard set --path <dir> [--folders <list>]
Restrict plan and apply to a directory, and optionally require folders such as bucket,function,policy.
spica guard show, spica guard remove
Show or remove the guard.
Code generation
spica bucket orm
| Option | Default |
|---|---|
--path <dir> | Current directory |
spica function orm
| Option | Default |
|---|---|
--path <dir> | Current directory |
--trigger-types <types> | http |
--http-service <name> | axios |
Assets
| Command | Options |
|---|---|
spica asset apply | --path <dir>, --dry-run |
spica asset delete | --path <dir>, --type soft|hard (required) |
Global options
| Option | Effect |
|---|---|
-h, --help | Show help. |
-V, --version | Show the version. |
-v, --verbose | Print debug messages. |
--quiet | Only print warnings and errors. |
--silent | Print nothing. |
--no-color | Disable colors. |