Configuration
Every key of the global CLI configuration ~/.polycrate/polycrate.yml with defaults, flags and environment variables, plus an overview of the workspace and block levels.
Polycrate reads configuration at three levels:
| Level | File | Contents |
|---|---|---|
| CLI (per user) | ~/.polycrate/polycrate.yml |
CLI behavior: logging, update checks, Ansible output, registry, API connection, personal SSH keys |
| Workspace | workspace.poly, secrets.poly, Dockerfile.poly |
Blocks, workflows, paths, container image, secrets |
| Block | block.poly |
A block's defaults, actions and metadata |
At runtime, block configuration is merged in this order (later levels win): block.poly → workspace.poly → secrets.poly. Dictionaries are deep-merged; lists are replaced as a whole.
Global CLI configuration
The CLI creates an empty ~/.polycrate/polycrate.yml on first start. Every key is optional; missing keys fall back to their default.
# ~/.polycrate/polycrate.yml
loglevel: 1
logformat: default
check_updates: true
check_block_updates: true
check_workspace_behind_remote: true
check_workspace_behind_remote_timeout: 5
check_maintenance_window: true
sync_loopback_kubeconfig: true
usage_stats: true
kubeconfig: ~/.kube/config
ansible:
stdout_callback: ansible.builtin.default
callback_result_format: json
display_ok_hosts: true
display_skipped_hosts: true
registry:
url: cargo.ayedo.cloud
base_image: cargo.ayedo.cloud/library/scratch:latest
block_push_exclude:
- .specs
- "*.log"
ssh:
user_key_path: ~/.ssh/id_ed25519
user_key_path_by_workspace:
acme-production-1: ~/.ssh/acme_prod_ed25519
git:
author:
name: Jane Doe
email: jane.doe@acme.example
api:
enabled: true
url: https://app.ayedo.cloud
context: ""
contexts: {}
submit_action_runs: true
submit_template_blocks: true
specs_sync: true
submit_telemetry: true
validate_workspace_on_load: false
General settings and checks
| Key | Default | CLI flag | Meaning |
|---|---|---|---|
loglevel |
1 |
--loglevel |
Verbosity of CLI output; higher values show more detail |
logformat |
default |
--logformat |
json emits logs as JSON |
check_updates |
true |
--check-updates |
Notice about newer CLI versions at the end of action and workflow runs |
check_block_updates |
true |
--check-block-updates |
Notice about newer block versions at the end of action runs |
check_workspace_behind_remote |
true |
--check-workspace-behind-remote |
Warns before a run if your local Git state is behind the remote |
check_workspace_behind_remote_timeout |
5 |
--check-workspace-behind-remote-timeout |
Timeout in seconds for that check's git fetch |
check_maintenance_window |
true |
--check-maintenance-window |
Checks before an action whether the workspace is inside a maintenance window (requires the API connection) |
sync_loopback_kubeconfig |
true |
--sync-loopback-kubeconfig |
Before an action, offers to download a newer kubeconfig for a cluster managed through the API |
usage_stats |
true |
– | Local command history in ~/.polycrate/telemetry.sqlite (polycrate history); false turns it off |
kubeconfig |
~/.kube/config |
--kubeconfig |
Fallback kubeconfig if the workspace has none; target of polycrate k8s set-context and k8s sync-kubeconfigs |
In CI environments (detected via CI, GITLAB_CI, GITHUB_ACTIONS and others) and without an interactive terminal, the CLI skips update notices and prompts automatically.
Ansible output (ansible.*)
| Key | Default | CLI flag (run) |
Meaning |
|---|---|---|---|
ansible.stdout_callback |
ansible.builtin.default |
--ansible-stdout-callback |
Output callback plugin, e.g. ansible.builtin.dense |
ansible.callback_result_format |
json |
--ansible-callback-result-format |
json (compact) or yaml (verbose) |
ansible.display_ok_hosts |
true |
– | Show hosts with status ok |
ansible.display_skipped_hosts |
true |
– | Show skipped hosts |
Registry (registry.*)
| Key | Default | CLI flag | Meaning |
|---|---|---|---|
registry.url |
cargo.ayedo.cloud |
--registry-url |
Default registry, e.g. for polycrate block init <short-name> |
registry.base_image |
cargo.ayedo.cloud/library/scratch:latest |
--registry-base-image |
Base image used to package blocks as OCI artifacts |
registry.block_push_exclude |
[".specs"] |
--exclude |
Exclude patterns for block push and block verify; --exclude replaces the list |
Registry credentials do not live in this file; they come from docker login. → Registry & Hub
Personal SSH keys (ssh.*)
Only relevant when a workspace sets config.sshkeysource: user to use your personal key instead of the workspace key.
| Key | Default | Meaning |
|---|---|---|
ssh.user_key_path |
~/.ssh/id_rsa |
Private key for all workspaces |
ssh.user_key_path_by_workspace |
– | Per-workspace key by workspace name; takes precedence |
→ SSH
Git (git.*)
| Key | CLI flag | Meaning |
|---|---|---|
git.author.name / git.author.email |
--git-author-name / --git-author-email |
Commit author for polycrate git commit and other CLI commits; overrides your Git config |
Polycrate API (api.*)
You need the API connection for API-backed features such as workspace create/clone, key management for workspace encryption, logs, metrics and k8s sync-kubeconfigs. Purely local work as well as hub, cli and update work without logging in.
polycrate login runs a browser sign-in, sets api.enabled: true and api.url, and stores the API key in the operating system's keyring. With --insecure-storage – and automatically in CI – the key goes into polycrate.yml instead. polycrate auth status shows where the key comes from; polycrate logout removes it.
| Key | Default | Meaning |
|---|---|---|
api.enabled |
false |
Enable the API integration (set by polycrate login) |
api.url |
https://app.ayedo.cloud |
API endpoint |
api.api_key |
– | Plaintext API key; only without a keyring or in CI |
api.context |
– | Active named context from api.contexts (set with polycrate api use <name>) |
api.contexts.<name>.url / .api_key |
– | Named API targets; select per call with --api-context <name> |
api.submit_action_runs |
true |
Report action runs to the API |
api.submit_template_blocks |
true |
Publish blocks to the API catalog after block push |
api.specs_sync |
true |
Sync local .specs/ to the API |
api.submit_telemetry |
true |
Send local usage counters to the API |
api.validate_workspace_on_load |
false |
Validate the workspace against the API when loading it |
A single workspace can opt out of the API connection with config.api.enabled: false in workspace.poly, even when it is enabled globally.
Environment variables
| Variable | Effect |
|---|---|
POLYCRATE_<KEY> |
Overrides a polycrate.yml key (dots become _), e.g. POLYCRATE_LOGLEVEL=2 or POLYCRATE_ANSIBLE_STDOUT_CALLBACK=ansible.builtin.dense. Applies to keys that are present in the file or have a default. |
POLYCRATE_API_API_KEY |
API key; takes precedence over the keyring and polycrate.yml |
WORKSPACE_ENCRYPTION_KEY |
age key for workspace encrypt/decrypt when there is no API connection |
CARGO_USER / CARGO_TOKEN |
Exposed in the action container as DOCKER_REGISTRY_USER / DOCKER_REGISTRY_PASSWORD unless those are set |
Precedence: CLI flag > environment variable > polycrate.yml > default.
Directories
| Path | Flag | Contents |
|---|---|---|
~/.polycrate/ |
--config-dir |
Configuration directory |
~/.polycrate/polycrate.yml |
--config-file |
This file |
~/.polycrate/workspaces/ |
--workspace-dir |
Recommended location for workspaces (<organization>/<workspace>/) |
~/.polycrate/run/ |
--runtime-dir |
Temporary runtime files; redirect in sandboxes or CI |
~/.polycrate/telemetry.sqlite |
– | Local history for polycrate history |
Workspace configuration (workspace.poly)
workspace.poly sits in the workspace root and describes blocks, workflows and workspace settings. The workspace layout and files are covered in Workspaces.
# workspace.poly
name: acme-production-1
organization: acme
config:
image:
reference: cargo.ayedo.cloud/library/polycrate
version: "<version>"
sshkeysource: workspace
release:
post_actions:
- block: my-app
action: deploy
blocks:
- name: my-app
from: registry.acme.corp/acme/k8s/my-app:1.0.0
config:
replicas: 3
workflows:
- name: deploy-all
steps:
- name: deploy-app
block: my-app
action: install
Top-level fields
| Field | Required | Meaning |
|---|---|---|
name |
Yes | Workspace name (slug: lowercase letters, digits, -) |
organization |
No | Organization (slug) |
version |
No | Workspace version; set by polycrate release finalize |
config |
No | Workspace settings (see below) |
blocks |
No | Block instances with name, from, config and optional actions |
workflows |
No | Workflows made of steps with block and action |
registry |
No | Registry proxy for air-gapped environments → Registry & Hub |
extraenv / extramounts |
No | Extra environment variables (KEY=value) and mounts (/host:/container) for the action container |
Keys under config:
config: accepts only the keys below. Your own values belong in blocks[].config.
| Key | Default | Meaning |
|---|---|---|
image.reference / image.version |
cargo.ayedo.cloud/library/polycrate / CLI version |
Image for action containers (per run: --image-ref, --image-version) |
dockerfile |
Dockerfile.poly |
Custom image based on the Polycrate image; built automatically on run |
blocksroot |
blocks |
Blocks directory |
blocksconfig |
block.poly |
Block configuration file name |
workspaceconfig |
workspace.poly |
Workspace configuration file name |
workflowsroot |
workflows |
Directory for workflow files |
artifactsroot |
artifacts |
Artifacts directory |
secretsroot |
artifacts/secrets |
Directory for encryptable secrets (e.g. kubeconfig.yml) |
containerroot |
/workspace |
Mount path of the workspace inside the container |
remoteroot |
/polycrate |
Conventional target path on remote hosts |
sshprivatekey / sshpublickey |
artifacts/secrets/id_rsa / …/id_rsa.pub |
Workspace SSH keys |
sshkeysource |
workspace |
workspace or user (personal key from ssh.* in polycrate.yml) |
sshusepassphrase |
false |
Use an SSH key with a passphrase |
sshagentmount |
false |
Mount the host SSH agent into the container (per run: --ssh-agent-mount) |
globals |
{} |
Free-form key-value map, readable in the snapshot as workspace.config.globals |
release.pre_actions / release.post_actions |
– | Actions (block, action) that polycrate release finalize runs before or after the version change |
api.enabled |
– | false turns off the API connection for this workspace |
Secrets (secrets.poly)
secrets.poly uses the same schema as workspace.poly and is merged with the highest priority. Before committing, encrypt it with polycrate workspace encrypt into secrets.poly.age:
# secrets.poly
blocks:
- name: cert-manager
config:
letsencrypt:
cloudflare:
api_token: "example-token-replace-me"
Check the syntax without loading the workspace using polycrate validate secrets-poly secrets.poly. → Workspace Encryption
Custom container image (Dockerfile.poly)
If you need extra packages or Ansible collections, add a Dockerfile.poly to the workspace. The base image is Debian-based, so use apt-get:
FROM cargo.ayedo.cloud/library/polycrate:<version>
RUN apt-get update && apt-get install -y --no-install-recommends redis-tools \
&& rm -rf /var/lib/apt/lists/*
polycrate run builds the image automatically (--build=false skips the build). → The Polycrate Container
Block configuration (block.poly)
block.poly defines a block's name, version, kind, default config and actions. Instances in workspace.poly override only the values that differ. Structure, examples.poly and inheritance are covered in Blocks.
polycrate run <block> <action> --snapshot or polycrate workspace snapshot shows the fully resolved result of all levels. → Snapshot