CLI Reference¶
All commands are invoked as sc <command> (or uv run sc <command> inside a uv-managed project).
Global behaviour¶
- Commands look for
config.py(preferred) orsc.pyin the current directory. --envdefaults toCONFIG.default_envwhen usingconfig.py, orproductionfor legacysc.py.- State is stored in
sc.state.<env>.json(per-env file). - A lock is held for the duration of any write command (
build,deploy,destroy).
sc init¶
Scaffold a new project in the current directory.
Creates / updates:
config.py— minimalProjectConfigstub (if not already present).gitignore— addssc.state.json,sc.state.*.json,.sc/,.dist/
Run this once when starting a new project.
sc build¶
Deploy all components, then run tests.
| Argument / Option | Description |
|---|---|
COMPONENT |
(optional) Run only this named component |
--env, -e |
Environment name (default: CONFIG.default_env) |
--dry-run |
Render templates and print commands; do not apply or test |
--verbose, -v |
Print rendered paths, full command output, and state summaries |
--json |
Print a JSON result object on success |
--secrets-in-plaintext |
Allow secrets to appear in verbose output (use with care) |
Steps:
- Renders component files to
.dist/<name>/ - Runs
terraform init+terraform apply -auto-approve(or the component'ssteps) - Saves state and outputs to
sc.state.<env>.json - Runs all
HttpTestassertions; prints a result table
sc build is the primary day-to-day command. It combines sc deploy + sc test in one call.
sc deploy¶
Deploy without running tests.
Same options as sc build, minus the test step. Useful when you want to apply infra and test separately.
sc destroy¶
Destroy all components (or a single one).
| Argument / Option | Description |
|---|---|
COMPONENT |
(optional) Destroy only this component |
--env, -e |
Environment name |
--dry-run |
Print the destroy commands without running them |
--verbose, -v |
Print full command output |
Runs terraform destroy -auto-approve for each TerraformComponent. Clears saved state after a successful destroy.
sc plan¶
Render and plan without applying.
| Argument / Option | Description |
|---|---|
COMPONENT |
(optional) Plan only this component |
--env, -e |
Environment name |
--dry-run |
Skip running commands; only render templates |
--verbose, -v |
Print full command output |
Runs terraform init + terraform plan for each TerraformComponent. No state is modified.
sc test¶
Run smoke tests against already-deployed infrastructure.
| Argument / Option | Description |
|---|---|
COMPONENT |
(optional) Run tests whose URL comes from this component's outputs |
--env, -e |
Environment name |
--verbose, -v |
Print each test name before running |
Reads outputs from sc.state.<env>.json (no Terraform calls). Useful for re-running tests without redeploying.
sc output¶
Print saved output values.
| Argument | Description |
|---|---|
COMPONENT |
Component name (e.g. infra) |
KEY |
(optional) Specific output key (e.g. ip) |
Without KEY, prints the full state record as JSON.
sc unlock¶
Release a stuck lock.
| Option | Description |
|---|---|
--force |
Delete the lock file and remote git tag without checking ownership |
Use --force after a crash left a lock behind.
Environment variable: SC_OPERATOR¶
If set, this value is recorded as the operator in state and audit log entries, overriding the git user.email lookup.