CLI Reference
Every Polycrate CLI 0.72 command grouped by task – with global flags and the most important options.
This page groups the Polycrate CLI commands by task (as of CLI 0.72). The CLI itself shows every subcommand, flag and default for your installed version:
polycrate --help
polycrate <command> --help
polycrate <command> <subcommand> --help
Global flags
These flags apply to every command. Most of them can also be set permanently in ~/.polycrate/polycrate.yml → Configuration.
| Flag | Default | Effect |
|---|---|---|
--loglevel <n> |
1 |
Verbosity of CLI output |
--logformat <fmt> |
default |
json for JSON logs |
--config-dir / --config-file |
~/.polycrate / ~/.polycrate/polycrate.yml |
Configuration directory and file |
--workspace-dir |
~/.polycrate/workspaces |
Base directory for workspaces |
--runtime-dir |
~/.polycrate/run |
Temporary runtime files |
--check-updates |
true |
Notice about newer CLI versions after runs |
--check-block-updates |
true |
Notice about newer block versions after runs |
--check-workspace-behind-remote |
true |
Warn if your Git state is behind the remote (--check-workspace-behind-remote-timeout, default 5 s) |
--check-maintenance-window |
true |
Check the maintenance window before an action (API) |
--sync-loopback-kubeconfig |
true |
Offer a newer kubeconfig for an API-managed cluster |
--api-context <name> |
– | Use a named API context for this call |
-N, --docker-native |
true |
Use the Docker SDK instead of the Docker CLI |
-v, --version |
– | Print the version |
Commands that operate on a workspace also accept -w, --workspace: an absolute path, a path relative to the current directory, or the org/name of a known workspace. Omit -w when you are inside the workspace directory.
Installation, updates and sign-in
| Command | Purpose |
|---|---|
polycrate version |
Show version and build |
polycrate update [version] |
Update the CLI or install a specific version (-y/--yes, --force, -d/--dry-run) |
polycrate cli latest · versions · inspect · changelog |
Query published CLI versions and changelogs |
polycrate completion bash\|zsh\|fish\|powershell |
Generate shell completion |
polycrate login |
Browser sign-in to the Polycrate API; key stored in the keyring (--token reads a key from stdin, --insecure-storage, --url) |
polycrate logout |
Remove the stored API key |
polycrate auth status |
Show where the API key comes from |
Workspaces
| Command | Purpose |
|---|---|
polycrate workspace init (short: polycrate init) |
Create a workspace (--with-name, --with-organization, --with-ssh-keys, --with-config) |
polycrate workspace inspect |
Show the loaded workspace configuration (-o yaml\|json) |
polycrate workspace snapshot · snapshot inspect |
Print the resolved snapshot or browse it in a pager |
polycrate workspace update |
Pull every block referenced via from: |
polycrate workspace list |
List workspaces from the API; --local (local index), --scan (walk ~/.polycrate/workspaces) |
polycrate workspace create ORG NAME · clone ORG/NAME |
Create or clone a workspace via the API (sign-in required) |
polycrate workspace changelog |
Show the workspace CHANGELOG.poly |
polycrate workspace fix-permissions |
Hand back files left owned by root after an aborted run, without sudo (--dry-run, --path) |
polycrate validate workspace-poly [file] · secrets-poly [file] |
Check syntax without loading the workspace |
Encryption
| Command | Purpose |
|---|---|
polycrate workspace encrypt |
Encrypt secrets.poly and artifacts/secrets/** with age; --file/-o for single files |
polycrate workspace decrypt |
Decrypt .age files; --file/-o for single files |
polycrate workspace status |
Check key source, encrypted files and .gitignore protection |
polycrate workspace hook install\|remove\|status |
Manage the Git pre-commit hook that blocks unencrypted secrets |
Hub and blocks
polycrate block and polycrate blocks are equivalent.
| Command | Purpose |
|---|---|
polycrate hub list |
Browse published blocks (-f/--filter, -k/--kind, -p/--project, -l/--limit, --no-pager) |
polycrate hub inspect <block>[:<version>] |
Show versions or block.poly; with a version also --readme, --changelog, --examples |
polycrate block pull <registry/path>:<version> (short: polycrate pull) |
Pull a block and set from: on all matching instances to that version |
polycrate block push <block> (short: polycrate push) |
Package a block and push it to its registry; version from block.poly (--exclude) |
polycrate block verify <block> |
Compare a local block with its registry image by checksum (--version, --diff, --format json) |
polycrate block init <name> |
Create a block (--kind k8sapp default, --kind generic) |
polycrate block list |
List blocks in the workspace (--filter, --no-pager) |
polycrate block inspect <block> |
Show the resolved block configuration |
polycrate block readme · changelog · examples <block> |
Show the README, CHANGELOG.poly or examples.poly |
polycrate block validate <block> |
Validate the block configuration |
polycrate block manual --no-pager |
Print the block development guide |
→ Blocks · Registry & Hub
Actions and workflows
| Command | Purpose |
|---|---|
polycrate run <block> <action> |
Run an action in the Polycrate container |
polycrate run <workflow> |
Run a workflow |
polycrate run |
Interactive selection |
polycrate action list · inspect · run |
List, inspect, run actions |
polycrate workflow list · inspect · run |
List, inspect, run workflows (--step for a single step) |
polycrate debug |
Interactive shell in the identically configured action container |
Key flags for run (most also apply to workflow run and debug):
| Flag | Effect |
|---|---|
--snapshot |
Print the snapshot only, run nothing |
--set key=value |
Override config values for this run (repeatable) |
--blocks-auto-pull |
Pull missing registry blocks automatically |
-e KEY=value / -m /host:/container |
Extra environment variables or mounts |
--image-ref / --image-version |
Override the container image for this run |
--pull=false / --build=false |
Skip the image pull or the Dockerfile.poly build |
-K, --ask-become-pass |
Prompt for the Ansible sudo password |
--ssh-agent-mount |
Mount the host SSH agent into the container |
-l, --local |
Run directly on the host without a container |
--force / --non-interactive |
Skip confirmations or disable all prompts |
--ansible-stdout-callback / --ansible-callback-result-format |
Control Ansible output (run only) |
--silent |
Suppress the CLI's own output, show Ansible output only (run only) |
→ Actions & Workflows · The Polycrate Container
SSH and Kubernetes
| Command | Purpose |
|---|---|
polycrate ssh [host] |
Interactive SSH session; without a host, pick from inventory.yml (--retry) |
polycrate ssh list |
List hosts from the inventory |
polycrate ssh exec <host> <command…> |
Run a command without an interactive session |
polycrate ssh copy [-r] <source> <dest> |
Copy files via scp (host:/path) |
polycrate ssh tunnel <host> <lport>:<rhost>:<rport> |
Open local port forwarding |
polycrate k8s debug |
Start a debug pod with the Polycrate image in the cluster (-n, --image, -m pvc:/path) |
polycrate k8s set-context [name] |
Set the active context in the local kubeconfig |
polycrate k8s sync-kubeconfigs |
Merge kubeconfigs of all clusters you can access via the API into ~/.kube/config |
→ SSH · Kubernetes
Git
Polycrate ships Git functionality that works without a local git. The workspace variants are aliases.
| Command | Purpose |
|---|---|
polycrate git status |
Show status |
polycrate git add <path> (workspace add) |
Stage files |
polycrate git commit -m "…" (workspace commit) |
Create a commit |
polycrate git pull · push · sync (workspace pull · push · sync) |
Synchronize with the remote |
→ Git
Platform data via the Polycrate API
These commands require polycrate login.
| Command | Purpose |
|---|---|
polycrate logs |
Query workspace logs (LogsQL; --block, --query, --start, --end, -f/--follow, --format json) |
polycrate metrics '<query>' |
Query metrics (PromQL/MetricsQL; --block, --start, --end, --step, --format json) |
polycrate api |
Show API status; polycrate api use <context> sets the default context; subcommands address individual API resources |
Spec-Driven Development and releases
| Command | Purpose |
|---|---|
polycrate spec manual --no-pager |
Print the complete SDD manual |
polycrate spec init |
Create .specs/ |
polycrate spec create · note · list · inspect · update · link · delete |
Create, maintain and link specs |
polycrate spec lint · format · review · verify · validate |
Check and repair specs |
polycrate spec arch list\|search\|show |
Read the reference architecture (.specs/ARCHITECTURE.md) section by section |
polycrate spec rules generate |
Generate agent rules (AGENTS.md, CLAUDE.md, Cursor rules) |
polycrate release diff · create · update · status · list · finalize · validate |
Plan and complete workspace releases |
polycrate release --block <name> update <version> |
Write a block's changelog entry |
polycrate release block-finalize <name> <version> |
Set, validate and push a block version |
Utilities
| Command | Purpose |
|---|---|
polycrate tools pwgen [length] |
Generate passwords, hashes or age keys (-a plain\|sha256\|bcrypt\|htpasswd\|age …, -n, -s) |
polycrate tools cert · dns · check · wait |
Inspect certificates, query DNS, check ports/HTTP, wait for services |
polycrate tools cidr · jwt · diff · hash · base64 · timestamp |
Network, token, diff, hash and conversion helpers |
polycrate history · actions · ssh · stats · prune |
Local command history from ~/.polycrate/telemetry.sqlite |
polycrate checksum <path> |
MD5 checksum of a directory |