Skip to content

CLI Reference (st8ctl)

st8ctl is the command-line interface for st8. It communicates with st8d over HTTP.

These flags are available on every command.

FlagDefaultDescription
--config~/.config/st8ctl/config.yamlPath to config file
--serverfrom configst8d server URL
--tokenfrom configBearer token for authentication
--localfalseStart an embedded st8d instance (for development)
--state-dir~/.st8State directory for --local mode
--namespacedefaultNamespace to operate on
--branchmainBranch to operate on
--timeout0 (none)Request timeout (e.g. 5s, 30s)

Apply one or more files or inline values to the current namespace/branch.

st8ctl apply [-f file...] [-v key=value...] [flags]
FlagDefaultDescription
-f, --fileFile to apply (repeatable)
-v, --valueInline key=value pair to apply (repeatable)
--messageCommit message describing the change
--namespaceTarget namespace (overrides global)
--branchTarget branch (overrides global)

Examples

Terminal window
# Apply a single file
st8ctl apply -f feature_flags.json --message "enable dark mode"
# Apply multiple files
st8ctl apply -f feature_flags.json -f rate_limits.json --message "update config"
# Apply an inline value
st8ctl apply -v feature_flags='{"dark_mode":true}' --message "enable dark mode"
# Apply to a specific namespace and branch
st8ctl apply -f rate_limits.json \
--namespace payments/prod \
--branch canary \
--message "canary: new rate limits"

Fetch the current state of a namespace/branch, or a specific document by key.

st8ctl get [key] [flags]
FlagDescription
--revisionFetch a specific revision ID
--checkpointFetch the revision named by a checkpoint

Examples

Terminal window
# Get current state (all documents)
st8ctl get
# Get a specific document by key
st8ctl get feature_flags.json
# Get a specific revision
st8ctl get --revision 42
# Get a checkpoint
st8ctl get --checkpoint stable

Show the revision history.

st8ctl log [flags]
FlagDescription
--limitMaximum number of entries to show (default 20)

Example

Terminal window
st8ctl log --limit 50

Show what would change if the given files or values were applied, without actually applying them.

st8ctl diff [-f file...] [-v key=value...] [flags]
FlagDescription
-f, --fileFile to diff (repeatable)
-v, --valueInline key=value pair to diff (repeatable)
--revisionCompare against a specific revision
--checkpointCompare against a checkpoint

Example

Terminal window
st8ctl diff -f feature_flags.json

Create a named checkpoint pointing to the current revision.

st8ctl checkpoint <name> [flags]
FlagDescription
--descriptionHuman-readable description

Example

Terminal window
st8ctl checkpoint stable --description "Pre-launch state, verified by QA"

Delete a named checkpoint.

st8ctl checkpoint delete <name>

Example

Terminal window
st8ctl checkpoint delete stable

Roll back to a previous revision or checkpoint.

st8ctl rollback [flags]
FlagDescription
--revisionRevision ID to roll back to
--checkpointCheckpoint name to roll back to
--messageMessage describing why the rollback happened

Example

Terminal window
st8ctl rollback --checkpoint stable --message "Reverting: latency regression in new checkout"

Manage branches.

Terminal window
st8ctl branch create <name> [flags]
FlagDescription
--revisionBase the new branch on a specific revision
--checkpointBase the new branch on a checkpoint

Example

Terminal window
st8ctl branch create experiment/new-pricing --checkpoint stable

To list branches, run st8ctl branch with no arguments.

Restore the current namespace/branch from another branch (useful for promoting a tested branch to production).

st8ctl restore [flags]
FlagDescription
--from-branchBranch to restore from
--revisionRevision to restore from
--checkpointCheckpoint to restore from
--messageMessage describing the restore

Example

Terminal window
st8ctl restore --from-branch canary --message "Promote canary to main"

Run garbage collection to prune old revisions.

st8ctl gc [flags]
FlagDescription
--keepNumber of recent revisions to keep per namespace/branch

Example

Terminal window
st8ctl gc --keep 100

~/.config/st8ctl/config.yaml:

server:
url: https://st8.internal
token: your-secret-token
defaults:
namespace: myapp/prod
branch: main

For local development:

server:
url: local
dir: ~/.st8 # optional, this is the default
defaults:
namespace: default
branch: main