CLI Reference
Complete reference for all LoKO commands.
Command Targeting
Section titled “Command Targeting”Most runtime commands resolve their target environment in this order:
--config/-cif you pass it explicitly- the active environment from inventory
./loko.yaml
This means commands like loko status, loko env start, loko env stop, loko env destroy, loko workloads ..., loko dns ..., loko tunnel ..., and loko gitops ... can work from outside the project directory after you activate an environment.
Most commands that operate on an existing environment, including most config ... commands, follow this same order. Commands that create or generate config files still act on the local file you point them at.
Command Groups
Section titled “Command Groups”env- Environment lifecycleworkloads- Workload managementaws- AWS profile helper for local AWS-compatible workloadsdoctor- Aggregated diagnosticscheck- Health checks and diagnosticscerts- Certificate and CA managementdns- DNS managementconfig- Configuration managementhelm- Helm repository managementsecrets- Credentials managementregistry- Container registry operationstunnel- Tunnel managementlogs- Log viewinginventory- Inventory managementstate- Persisted state toolingcatalog- Catalog managementgitops- GitOps bootstrap and lifecycle
Environment Lifecycle (env)
Section titled “Environment Lifecycle (env)”env create
Section titled “env create”Create complete environment.
loko env create [OPTIONS]Options:
--config, -c TEXT- Config file path (default:loko.yaml)
Example:
loko env createloko env create -c loko-prod.yamlenv start
Section titled “env start”Start stopped environment.
loko env start [OPTIONS]env stop
Section titled “env stop”Stop running environment.
loko env stop [OPTIONS]env activate
Section titled “env activate”Activate another environment.
loko env activate ENV_NAME [OPTIONS]Stops the current environment, switches the current kubectl context, starts the target environment, and marks it as the active environment in inventory.
Notes:
- The target environment must already exist in inventory
- The target cluster must already be created
- Top-level alias:
loko activate ENV_NAME
env list
Section titled “env list”List environments known to LoKO inventory.
loko env list [OPTIONS]This is an alias for loko inventory list.
env show
Section titled “env show”Show the data directory for an environment.
loko env show [ENV_NAME]If ENV_NAME is omitted, LoKO uses the active environment.
env browse
Section titled “env browse”Open the environment data directory in the default file manager.
loko env browse [ENV_NAME]If ENV_NAME is omitted, LoKO uses the active environment.
env destroy
Section titled “env destroy”Destroy cluster but keep configs.
loko env destroy [OPTIONS]If no explicit --config is given, this targets the active environment first.
env recreate
Section titled “env recreate”Destroy and recreate environment.
loko env recreate [OPTIONS]env clean
Section titled “env clean”Remove all environment artifacts.
loko env clean [OPTIONS]Options:
--keep-config- Keep loko.yaml file
Workload Management (workload)
Section titled “Workload Management (workload)”workloads list
Section titled “workloads list”List workloads.
loko workloads list [OPTIONS]Options:
--all- Show all workloads including disabled--user- Show user workloads only--system- Show system workloads only--internal- Show internal components only--disabled- Show disabled workloads only--format TEXT- Output format:rich,json,text
Examples:
loko workloads listloko workloads list --system --disabledloko workloads list --format json | jqworkloads add
Section titled “workloads add”Add workload from catalog.
loko workloads add WORKLOAD_NAME [OPTIONS]Options:
--enabled / --disabled- Enable or disable the workload in config--now- Deploy immediately after adding
Examples:
loko workloads add postgresloko workloads add postgres --nowloko workloads add rabbitmq --disabledworkloads remove
Section titled “workloads remove”Remove workload from config.
loko workloads remove WORKLOAD_NAME [OPTIONS]Options:
--now- Undeploy immediately before removing
workloads enable
Section titled “workloads enable”Enable workload.
loko workloads enable WORKLOAD_NAMES... [OPTIONS]Options:
--now- Deploy immediately
Examples:
loko workloads enable postgresloko workloads enable mysql postgres mongodb --nowworkloads disable
Section titled “workloads disable”Disable workload.
loko workloads disable WORKLOAD_NAMES... [OPTIONS]Options:
--now- Undeploy immediately
Examples:
loko workloads disable postgresloko workloads disable mysql postgres mongodb --nowworkloads deploy
Section titled “workloads deploy”Deploy workloads.
loko workloads deploy [WORKLOAD_NAMES...] [OPTIONS]Options:
--all- Include internal components--user- User workloads only--system- System workloads only--internal- Internal components only
Examples:
loko workloads deploy # All enabledloko workloads deploy postgres # Specific workloadloko workloads deploy mysql postgres # Multiple workloadsloko workloads deploy --system # All system workloadsworkloads undeploy
Section titled “workloads undeploy”Undeploy workloads.
loko workloads undeploy [WORKLOAD_NAMES...] [OPTIONS]Options: Same as deploy
workloads sync
Section titled “workloads sync”Run a full helmfile sync for workloads and GitOps when enabled.
loko workloads sync [OPTIONS]Re-generates the workloads helmfile and runs a full sync. If GitOps is enabled, it also syncs the GitOps provider.
workloads info
Section titled “workloads info”Show workload catalog information.
loko workloads info WORKLOAD_NAMEExample:
loko workloads info postgresworkloads endpoints
Section titled “workloads endpoints”Show workload endpoints.
loko workloads endpoints WORKLOAD_NAME [OPTIONS]Options:
--format TEXT- Output format
workloads connect
Section titled “workloads connect”Show connection strings.
loko workloads connect WORKLOAD_NAME [OPTIONS]Options:
--show-password, -p- Display actual passwords
workloads check
Section titled “workloads check”Run health checks.
loko workloads check WORKLOAD_NAME [OPTIONS]Options:
--tier, -t TEXT- Health check tier: infrastructure (default), client, or all--all, -a- Run all health checks regardless of tier--port-forward, -f- Use kubectl port-forward
logs workload
Section titled “logs workload”View workload logs.
loko logs workload WORKLOAD_NAME [OPTIONS]Options:
--follow, -f- Follow log output--tail INTEGER- Lines to show from end--since TEXT- Show logs since (e.g.,5m,1h)--container TEXT- Container name (for multi-container pods)--previous- Show previous container logs
Examples:
loko logs workload postgresloko logs workload postgres --follow --tail 100loko logs workload traefik --container traefikAWS Helpers (aws)
Section titled “AWS Helpers (aws)”aws profile
Section titled “aws profile”Show the unified LoKO AWS CLI profile and per-service endpoints for enabled AWS-compatible workloads.
loko aws profile [OPTIONS]The generated profile name is loko-<environment-name> (for example, loko-dev-me).
Includes endpoints for enabled workloads:
garage→ S3 (https://garage.${LOKO_DOMAIN})elasticmq→ SQS (https://elasticmq-api.${LOKO_DOMAIN})goaws→ SNS (https://sns.${LOKO_DOMAIN})dynamodb-local→ DynamoDB (https://dynamodb-local.${LOKO_DOMAIN})
Examples:
loko aws profileloko aws profile -c loko.yaml
# Then use AWS CLI with the printed profileaws s3 ls --profile loko-dev-meaws sqs list-queues --profile loko-dev-meaws sns list-topics --profile loko-dev-meaws dynamodb list-tables --profile loko-dev-meDNS Management (dns)
Section titled “DNS Management (dns)”dns status
Section titled “dns status”Show DNS container status and configuration.
loko dns status [OPTIONS]dns start
Section titled “dns start”Start DNS container.
loko dns start [OPTIONS]dns stop
Section titled “dns stop”Stop DNS container.
loko dns stop [OPTIONS]dns recreate
Section titled “dns recreate”Recreate DNS container with updated configuration.
loko dns recreate [OPTIONS]Certificate Management (certs)
Section titled “Certificate Management (certs)”certs ca status
Section titled “certs ca status”Show global CA certificate info: path, subject, expiry dates, and SHA-256 fingerprint.
loko certs ca status [OPTIONS]Example:
loko certs ca statuscerts ca install
Section titled “certs ca install”Install (or re-install) the global LoKO CA into all system trust stores and Docker certs.d.
Installs into: macOS Keychain or Linux trust store, NSS databases (Firefox), Java cacerts (if JAVA_HOME is set), and ~/.docker/certs.d/<registry>/ca.crt.
loko certs ca install [OPTIONS]Use this when:
- Setting up on a new machine with an existing
~/.loko/ca/ - Trust was accidentally removed from the keychain
- Adding a new environment whose registry needs Docker trust
Example:
loko certs ca installcerts ca remove
Section titled “certs ca remove”Remove the global LoKO CA from all trust stores, Docker certs.d for all known environments, and (by default) delete the CA files from ~/.loko/ca/.
loko certs ca remove [OPTIONS]Options:
--keep-files- Remove trust only; do not delete~/.loko/ca/
Examples:
loko certs ca remove # Remove trust and delete CA filesloko certs ca remove --keep-files # Remove trust onlycerts ca regenerate
Section titled “certs ca regenerate”Destroy the current global CA, generate a new one (10-year validity, 4096-bit RSA), and reinstall trust. All existing per-environment wildcard certificates are invalidated and must be renewed.
loko certs ca regenerate [OPTIONS]After regenerating, renew each environment’s wildcard cert:
loko certs renewcerts show
Section titled “certs show”Show wildcard certificate info for the current environment: SANs, expiry dates, issuer, and SHA-256 fingerprint.
loko certs show [OPTIONS]certs renew
Section titled “certs renew”Renew the wildcard certificate for the current environment using the existing global CA. Automatically updates the Kubernetes wildcard-tls secret and restarts Traefik.
loko certs renew [OPTIONS]Use this when:
- The wildcard cert has expired or is approaching expiry
- The global CA was regenerated (
certs ca regenerate) - New SANs are needed (e.g. after enabling a workload with a wildcard subdomain)
Inventory (inventory)
Section titled “Inventory (inventory)”inventory list
Section titled “inventory list”List environments known to inventory.
loko inventory list [OPTIONS]Options:
--verbose, -v- Show base directory, Kubernetes version, and node count--format TEXT- Output format:rich,json,text
The output marks which environment is currently active.
inventory check
Section titled “inventory check”Validate inventory health.
loko inventory check [OPTIONS]Detects missing configs, missing base directories, missing clusters, duplicate environment names, and stale active-environment markers.
inventory vacuum
Section titled “inventory vacuum”Remove stale entries from inventory.
loko inventory vacuum [OPTIONS]Options:
--dry-run- Preview stale entries without removing them
When safe, this also removes stale resolver files for domains no longer used by any remaining inventory entry.
GitOps (gitops)
Section titled “GitOps (gitops)”gitops init
Section titled “gitops init”Bootstrap GitOps for the current environment.
loko gitops init [OPTIONS]Options:
--provider [fluxcd|argocd]- GitOps provider (default:fluxcd)--org TEXT- Forgejo organization owner for repos--force- Overwrite existing non-empty GitOps repo--verbose- Show underlying command output
gitops status
Section titled “gitops status”Show GitOps health and reconciliation state.
loko gitops status [OPTIONS]Options:
--json- Machine-readable output
gitops destroy
Section titled “gitops destroy”Remove GitOps bootstrap resources and integration state.
loko gitops destroy [OPTIONS]Options:
--force- Skip confirmation prompt--dry-run- Show actions without making changes
gitops reconcile
Section titled “gitops reconcile”Trigger immediate reconciliation of the root GitOps construct.
loko gitops reconcile [OPTIONS]For FluxCD: annotates FluxInstance, Kustomization/loko-root, and GitRepository/loko-gitops. For ArgoCD: patches Application/loko-root to trigger a sync.
gitops reset
Section titled “gitops reset”Destroy and re-initialize GitOps (keeps gitops.enabled: true).
loko gitops reset [OPTIONS]Options:
--provider [fluxcd|argocd]- Provider to use after reset--org TEXT- Forgejo organization for the repository--force- Skip confirmation prompt--verbose- Show underlying command output
gitops enable
Section titled “gitops enable”Enable GitOps in loko.yaml.
loko gitops enable [OPTIONS]Options:
--now- Bootstrap immediately--provider, -p [fluxcd|argocd]- Provider to apply with--now--org, -o TEXT- Forgejo organization to use with--now--force, -f- Overwrite existing repository if not empty when using--now--verbose, -v- Show detailed underlying command output when using--now
gitops disable
Section titled “gitops disable”Disable GitOps in loko.yaml.
loko gitops disable [OPTIONS]Options:
--now- Destroy GitOps resources immediately
gitops provider
Section titled “gitops provider”Show or set the configured GitOps provider.
loko gitops provider [fluxcd|argocd]If no argument is passed, prints the current provider.
Health Checks (check)
Section titled “Health Checks (check)”check prerequisites
Section titled “check prerequisites”Check if all required tools are installed.
loko check prerequisites [OPTIONS]check dns
Section titled “check dns”Check DNS configuration and resolution status.
loko check dns [OPTIONS]check ports
Section titled “check ports”Check availability of all configured ports.
loko check ports [OPTIONS]check terminal
Section titled “check terminal”Check terminal capabilities for rich output.
loko check terminalDiagnostics (doctor)
Section titled “Diagnostics (doctor)”doctor
Section titled “doctor”Run aggregated diagnostics across runtime, state, cluster, and workloads.
loko doctor [OPTIONS]Options:
--config, -c TEXT- Configuration file path [default:loko.yaml]
State (state)
Section titled “State (state)”state status
Section titled “state status”Show persisted state status and coverage.
loko state statusstate doctor
Section titled “state doctor”Run consistency checks for current persisted state.
loko state doctorstate operations
Section titled “state operations”Show latest lifecycle operations from the persisted journal.
loko state operations [OPTIONS]Options:
--env TEXT- Filter by environment name--command TEXT- Filter by command (e.g.,create,recreate)--status TEXT- Filter by status (running,completed,failed)--limit INTEGER- Maximum operations to show (1-100, default10)--steps- Include detailed step rows
state operation
Section titled “state operation”Show detailed step-by-step view for one operation.
loko state operation OPERATION_IDstate export
Section titled “state export”Export state snapshot (inventory + secrets + metadata).
loko state export [OPTIONS]Options:
--output, -o TEXT- Output snapshot path, or-for stdout [default:-]
state import
Section titled “state import”Import state snapshot.
loko state import --input SNAPSHOT_PATH [OPTIONS]Options:
--input, -i TEXT- Snapshot file path (required)--replace / --merge- Replace existing state or merge into it (default: replace)
Configuration (config)
Section titled “Configuration (config)”config generate
Section titled “config generate”Generate configuration file.
loko config generate [OPTIONS]Options:
--force- Overwrite existing file--local-ip TEXT- Override auto-detected local IP--output, -o TEXT- Output file path [default: loko.yaml]
Example:
loko config generateloko config generate --local-ip 192.168.0.10loko config generate --force --output custom.yamlconfig validate
Section titled “config validate”Validate configuration file.
loko config validate [OPTIONS]config sync
Section titled “config sync”Sync configuration changes.
loko config sync [OPTIONS]Options:
--backup/-b- Create backup before applying changes--diff/--no-diff- Show or hide detailed diffs
config upgrade
Section titled “config upgrade”Upgrade component versions.
loko config upgrade [OPTIONS]config ip
Section titled “config ip”Detect local IP address.
loko config ipHelm Repositories (helm)
Section titled “Helm Repositories (helm)”helm repo add
Section titled “helm repo add”Add Helm repository.
loko helm repo add [OPTIONS]Options:
--helm-repo-name TEXT- Repository name (required)--helm-repo-url TEXT- Repository URL (required)
Example:
loko helm repo add \ --helm-repo-name bitnami \ --helm-repo-url https://charts.bitnami.com/bitnamihelm repo remove
Section titled “helm repo remove”Remove Helm repository.
loko helm repo remove [OPTIONS]Options:
--helm-repo-name TEXT- Repository name (required)
helm repo list
Section titled “helm repo list”List Helm repositories.
loko helm repo list [OPTIONS]Web UIs
Section titled “Web UIs”Web UI workloads are managed as regular workloads through the workloads commands. Many workloads have linked UI tools that can be added separately.
Viewing Available UIs
Section titled “Viewing Available UIs”Use loko workloads info to see linked UI workloads:
loko workloads info postgres# Shows: postgres-ui (pgAdmin) as a linked workloadManaging UI Workloads
Section titled “Managing UI Workloads”UI workloads use the same commands as other workloads:
# Add a UI workloadloko workloads add postgres-ui
# Deploy a UI workloadloko workloads deploy postgres-ui
# Remove a UI workloadloko workloads remove postgres-uiSee the Workloads section for all available commands.
Secrets Management (secrets)
Section titled “Secrets Management (secrets)”secrets fetch
Section titled “secrets fetch”Fetch secrets from cluster.
loko secrets fetch [OPTIONS]secrets show
Section titled “secrets show”Display saved secrets.
loko secrets show [OPTIONS]Options:
--format TEXT- Output format:rich,json,text
Examples:
loko secrets showloko secrets show --format json | jq '.postgres.password'Registry Operations (registry)
Section titled “Registry Operations (registry)”registry status
Section titled “registry status”Show registry status.
loko registry status [OPTIONS]registry list-repos
Section titled “registry list-repos”List repositories.
loko registry list-repos [OPTIONS]registry show-repo
Section titled “registry show-repo”Show repository details.
loko registry show-repo REPOSITORY_NAME [OPTIONS]registry list-tags
Section titled “registry list-tags”List repository tags.
loko registry list-tags REPOSITORY_NAME [OPTIONS]registry purge-repo
Section titled “registry purge-repo”Delete all tags from a specific repository.
loko registry purge-repo REPOSITORY_NAME [OPTIONS]Options:
--force, -f- Skip confirmation prompt
Example:
loko registry purge-repo myapp --forceregistry purge
Section titled “registry purge”Delete all tags from every repository in the registry.
loko registry purge [OPTIONS]Options:
--force, -f- Skip confirmation prompt
registry load-image
Section titled “registry load-image”Load locally built image(s) into the Kind cluster.
loko registry load-image IMAGE... [OPTIONS]Options:
--nodes, -n TEXT- Comma-separated node list (default: all nodes)
Examples:
loko registry load-image myapp:latestloko registry load-image myapp:latest myapp:v1.0.0Other Commands
Section titled “Other Commands”status
Section titled “status”Show environment health status (Phase 4).
loko status [OPTIONS]Options:
--short- Show compact table view instead of detailed panels--workloads- Show detailed per-service breakdown for workloads--format TEXT- Output format:rich,json,text--force-color- Force colored output even when piping
Health Components:
- Cluster: Kubernetes cluster running state
- DNS: dnsmasq health and OS resolver configuration
- Tunnel: HAProxy TCP load balancer for database access
- Registry: Local OCI registry (if enabled)
- Workloads: Deployed services health status
Health States:
- ✓ Healthy (green) - Component running normally
- ⚠ Degraded (yellow) - Running but issues detected
- ⏸ Stopped (gray) - Component stopped
- ○ Not Configured (dim) - Component not enabled
Examples:
loko status # Default: detailed panel viewloko status --short # Compact table viewloko status --format json # JSON output for scriptingloko status --workloads # Detailed workload breakdownvalidate
Section titled “validate”Validate environment.
loko validate [OPTIONS]Runs a full environment validation (including self-test app deployment).
Options:
--cleanup- Cleanup the self-test app and test namespace after validation (default keeps them for inspection)--format TEXT- Output format:rich,json,text--force-color- Force colored output even when piping
Examples:
loko validate # Runs validation and keeps self-test resourcesloko validate --cleanup # Runs validation and then cleans up test resourcesloko env validate --cleanup # Same behavior through env aliascompletion
Section titled “completion”Generate shell completion.
loko completion {bash|zsh|fish}Examples:
loko completion bash > ~/.loko-completion.bashloko completion zsh > ~/.loko-completion.zshGlobal Options
Section titled “Global Options”Available for all commands:
--help- Show help message--version- Show version--config, -c TEXT- Configuration file path override (default:loko.yaml)
If --config is omitted, many runtime commands use the active environment from inventory before falling back to ./loko.yaml.
Exit Codes
Section titled “Exit Codes”| Code | Meaning |
|---|---|
| 0 | Success |
| 1 | General error |
| 2 | Config error |
| 3 | Cluster error |
| 4 | Workload error |
| 5 | DNS error |
| 6 | Certificate error |
Environment Variables
Section titled “Environment Variables”LOKO_CONFIG_FILE- Default config file pathLOKO_DEBUG- Enable debug outputLOKO_NO_COLOR- Disable colored output
Example:
export LOKO_CONFIG_FILE=custom-config.yamlexport LOKO_DEBUG=1loko statusNext Steps
Section titled “Next Steps”- Quick Start - Get started with LoKO
- User Guide - Detailed usage guides
- Troubleshooting - Common issues