CLI Command Reference
The sloth CLI manages component contracts only.
For onboarding and workflow guidance, start with CLI Getting Started.
Commands
sloth initsloth contracts ls --version <version|latest> [--source local|oci] [--format table|json]sloth contracts inspect --profile <name> [--format table|json]sloth contracts pull --name <component> --version <version|latest> [--out <path>]sloth contracts add component --name <component> --version <version|latest>sloth contracts add set --name <set-name> --version <version|latest>sloth contracts add --all --version <version|latest>sloth contracts verify --file <contract.json> --version <version|latest>sloth contracts push --version <version|latest> [--dry-run] [--retries <n>]
Local Workspace
.sloth/
config.yaml
contracts/
sets/
manifests/
lock.json
Configuration
config.yaml supports profile-based host and token setup:
currentProfile: default
profiles:
default:
host: http://localhost:1337
authorizationToken: ""
The CLI resolves config using explicit precedence:
- YAML values from
.sloth/config.yaml - Environment variables (
SLOTH_HOST,SLOTH_AUTHORIZATION_TOKEN, etc.) - Built-in defaults
- Runtime flags (explicit override)
For detailed config examples and environment variable setup, see CLI Getting Started — Configure Host Profiles.
Verification Rules
sloth contracts verify checks:
- schema compatibility between host schema and contract schema
- plugin version compatibility range
- name collisions with official catalog
- name collisions with host inventory
When schema compatibility fails, the command emits ERR_SCHEMA_VERSION_INCOMPATIBLE and exits with a non-zero status.
Push Pipeline
sloth contracts push follows this sequence:
- Read local contracts from
.sloth/contracts. - Inspect host state from
/sloth/inspection/plugin-status. - Compute drift summary (local missing on host).
- Call
/sloth/contracts/ingest. - Update
.sloth/manifests/lock.jsonwith sync metadata.
Distribution and Release
Use Taskfile commands for build and packaging:
task cli-build-crosstask cli-generate-publish-packagestask cli-smoke-installtask cli-release-prep
Use OCI registry lifecycle commands for local real-registry testing:
task oci-registry-uptask oci-registry-down
Generated artifacts:
packages/cli/dist/bin/<os>-<arch>/sloth[.exe]packages/cli/dist/checksums.txtpackages/cli/dist/publish-packages/*