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.

OptionDefault
--image-versionlatest
-p, --port4500
--database-typemongodb (mongodb, postgresql)
--database-replicas1
--mongo-version8.0
--postgres-version18
--api-options <file>
--local-resource-folder <dir>
--image-pull-policyif-not-present (if-not-present, default)
-o, --open
-f, --force
--retain-volumestrue
--restarttrue

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-apikeyRequired
--target-url, --target-apikeyRequired
--modulesRequired: bucket, function, bucket-data, apikey, policy, env-var
--bucket-ids, --function-ids, --apikey-ids, --policy-ids, --env-var-ids
--dry-run
--concurrency-limitDefault 100
--ignore-errors

Contexts

CommandDescription
spica context set --name <name> --url <url> --apikey <key>Create or update a context.
spica context switch <name>Select a context.
spica context lsList 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]

OptionDefault
-y, --auto-approvefalse
--cleanfalse
--module <name>All
--detailedfalse
--concurrency <n>10
--abort-on-errorfalse

spica plan [dir]

OptionDefault
--detailedfalse
--detailed-exitcodefalse
--jsonfalse
--module <name>All
--concurrency <n>10

spica apply [dir]

OptionDefault
-y, --auto-approvefalse
--detailedfalse
--module <name>All
--concurrency <n>5
--abort-on-errorfalse

spica dev [dir]

OptionDefault
--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

OptionDefault
--path <dir>Current directory

spica function orm

OptionDefault
--path <dir>Current directory
--trigger-types <types>http
--http-service <name>axios

Assets

CommandOptions
spica asset apply--path <dir>, --dry-run
spica asset delete--path <dir>, --type soft|hard (required)

Global options

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