Command Reference
Comprehensive reference for all LoKO CLI commands.
Config Resolution
Section titled “Config Resolution”Most runtime commands resolve their target environment in this order:
- explicit
--config/-c - active environment from inventory
- local
./loko.yaml
This applies to commands such as status, validate, env start, env stop, env destroy, workloads ..., dns ..., tunnel ..., and gitops ....
Most commands that operate on an existing environment follow the same order, including most config ... commands. Commands that create or generate config files still act on the local file you specify.
Command Structure
Section titled “Command Structure”LoKO uses a hierarchical command structure organized into logical groups:
loko├── env # Environment lifecycle├── workloads # Workload management├── aws # AWS profile helper for local AWS-compatible workloads├── doctor # Aggregated diagnostics├── check # Health checks and diagnostics├── dns # DNS management├── config # Configuration management├── helm # Helm repository management├── secrets # Credential management├── registry # Container registry operations├── tunnel # TCP tunnel container + ngrok HTTP(S) sharing├── logs # Log viewing├── inventory # Inventory management├── state # Persisted state tooling├── catalog # Catalog operations├── gitops # GitOps bootstrap and lifecycle└── status # Environment health statusEnvironment Commands
Section titled “Environment Commands”env create
Section titled “env create”Create a new local Kubernetes environment.
loko env create [OPTIONS]Options:
--config, -c TEXT- Configuration file path- environment overrides such as
--name,--domain,--workers,--runtime,--local-ip, and workload-related toggles
Example:
loko env create --workers 3loko env create -c loko-prod.yamlSee Environment Lifecycle for details.
env destroy
Section titled “env destroy”Destroy an existing environment.
loko env destroy [OPTIONS]Options:
--config, -c TEXT- Configuration file path override--force- Skip confirmation
Example:
loko env destroy --forceenv start
Section titled “env start”Start a stopped environment.
loko env start [OPTIONS]Options:
--config, -c TEXT- Configuration file path override
env stop
Section titled “env stop”Stop a running environment.
loko env stop [OPTIONS]Options:
--config, -c TEXT- Configuration file path override
env activate
Section titled “env activate”Activate another environment.
loko env activate ENV_NAME [OPTIONS]This command:
- Stops the currently active environment
- Switches the current
kubectlcontext to the target environment - Starts the target environment
- Marks the target as the active environment in inventory
Arguments:
ENV_NAME- Target environment name from 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 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 an environment data directory in the default file manager.
loko env browse [ENV_NAME]If ENV_NAME is omitted, LoKO uses the active environment.
env recreate
Section titled “env recreate”Recreate environment (destroy + create).
loko env recreate [OPTIONS]Options:
- Same overrides as
env create, plus--force
Inventory Commands
Section titled “Inventory Commands”inventory list
Section titled “inventory list”List environments in the global inventory.
loko inventory list [OPTIONS]Options:
--verbose/-v- Show extended metadata--format TEXT- Output format (rich,json,text)
The output marks the active environment.
inventory check
Section titled “inventory check”Validate inventory health.
loko inventory check [OPTIONS]Detects:
- missing config files
- missing base directories
- missing clusters
- duplicate environment names
- stale or broken active-environment markers
inventory vacuum
Section titled “inventory vacuum”Remove stale inventory entries.
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.
Workload Commands
Section titled “Workload Commands”workloads add
Section titled “workloads add”Add a workload to configuration.
loko workloads add NAME [OPTIONS]Arguments:
NAME- Workload name from catalog
Options:
--enabled/--disabled- Enable or disable the workload (default: enabled)--now- Deploy immediately after adding
Example:
loko workloads add postgres --nowSee Workload Management for details.
workloads remove
Section titled “workloads remove”Remove a workload from configuration.
loko workloads remove NAME [OPTIONS]Arguments:
NAME- Workload name
Options:
--now- Undeploy before removing from config
Example:
loko workloads remove postgres --nowworkloads enable
Section titled “workloads enable”Enable a disabled workload.
loko workloads enable NAME [NAME ...] [OPTIONS]Arguments:
NAME- One or more workload names
Options:
--now- Deploy immediately
Example:
loko workloads enable mysql --nowloko workloads enable mysql postgres mongodbworkloads disable
Section titled “workloads disable”Disable an enabled workload.
loko workloads disable NAME [NAME ...] [OPTIONS]Arguments:
NAME- One or more workload names
Options:
--now- Undeploy immediately
Example:
loko workloads disable mysql --nowloko workloads disable mysql postgres mongodbworkloads deploy
Section titled “workloads deploy”Deploy workloads to cluster.
loko workloads deploy [NAMES]... [OPTIONS]Arguments:
NAMES- Workload names (optional)
Options:
--all- Include all workloads (user, system, and internal)--user- Include only user workloads--system- Include only system workloads--internal- Include only internal workloads
Examples:
# Deploy specific workloadsloko workloads deploy postgres mysql
# Deploy all including internalloko workloads deploy --all
# Deploy only user workloadsloko workloads deploy --userworkloads undeploy
Section titled “workloads undeploy”Undeploy workloads from cluster.
loko workloads undeploy [NAMES]... [OPTIONS]Arguments:
NAMES- Workload names (optional)
Options:
--all- Include all workloads (user, system, and internal)--user- Include only user workloads--system- Include only system workloads--internal- Include only internal workloads
Example:
loko workloads undeploy postgresworkloads sync
Section titled “workloads sync”Run a full helmfile sync for workloads and GitOps when enabled.
loko workloads sync [OPTIONS]AWS Commands
Section titled “AWS Commands”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 profile name is loko-<environment-name> (for example, loko-dev-me).
LoKO prints service-specific commands for enabled workloads:
garage(S3)elasticmq(SQS)goaws(SNS)dynamodb-local(DynamoDB)
Example:
loko aws 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-meDoctor Commands
Section titled “Doctor Commands”doctor
Section titled “doctor”Run aggregated diagnostics across runtime, state, cluster, and workloads.
loko doctor [OPTIONS]Options:
--config/-c- Configuration file path override
State Commands
Section titled “State Commands”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 (for example: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 a single operation.
loko state operation OPERATION_IDstate export
Section titled “state export”Export a state snapshot (inventory + secrets + metadata).
loko state export [OPTIONS]Options:
--output/-o TEXT- Output snapshot path, or-for stdout
state import
Section titled “state import”Import a 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)
workloads list
Section titled “workloads list”List workloads and their status.
loko workloads list [OPTIONS]Options:
--all/-a- Show all workloads including disabled and available from catalog--internal/-i- Show only enabled internal components--system/-s- Show only enabled system workloads--user/-u- Show only enabled user-defined workloads--enabled/-e- Show only enabled workloads--disabled/-d- Show only disabled workloads--format TEXT- Output format (rich,json,text)
Examples:
loko workloads list --allloko workloads list --systemloko workloads list --disabledloko workloads list --format jsonworkloads info
Section titled “workloads info”Show detailed workload information.
loko workloads info NAMEArguments:
NAME- Workload name
Example:
loko workloads info postgreslogs workload
Section titled “logs workload”View workload logs.
loko logs workload NAME [OPTIONS]Arguments:
NAME- Workload name
Options:
--follow/-f- Follow log output--tail INT- Number of lines to show
Example:
loko logs workload postgres --followworkloads check
Section titled “workloads check”Run health checks for a workload.
loko workloads check NAME [OPTIONS]Arguments:
NAME- Workload name
Options:
--tier TEXT/-t- Health check tier:infrastructure(default),client, orall--all/-a- Run all health checks regardless of tier--port-forward/-f- Use kubectl port-forward instead of external domain
Health check tiers:
- infrastructure - Port connectivity checks (no client tools required, runs by default)
- client - Service validation using client tools (requires tools like
mysql,psql,valkey-cli, etc.)
Examples:
# Default: infrastructure tier (port checks)loko workloads check postgres
# Client tier (requires psql)loko workloads check postgres --tier clientloko workloads check postgres -t infra # alias for infrastructure
# All tiersloko workloads check postgres --all
# Via port-forward instead of DNSloko workloads check postgres --port-forwardworkloads connect
Section titled “workloads connect”Show connection strings for a workload.
loko workloads connect NAME [OPTIONS]Arguments:
NAME- Workload name
Options:
--show-password/-p- Show actual password (masked by default)--format TEXT- Output format (rich,json,text)
Credentials are resolved automatically from persisted secrets, with fallback to Helm release values and Kubernetes secrets.
Examples:
# Show connection strings (password masked)loko workloads connect postgres
# Show with actual passwordloko workloads connect postgres --show-password
# JSON output for scriptingloko workloads connect postgres --format json -pworkloads endpoints
Section titled “workloads endpoints”Show endpoints for a workload.
loko workloads endpoints NAME [OPTIONS]Arguments:
NAME- Workload name
Options:
--format TEXT- Output format (rich,json,text)
Example:
loko workloads endpoints postgresSecrets Commands
Section titled “Secrets Commands”secrets fetch
Section titled “secrets fetch”Fetch workload credentials from cluster and store them.
loko secrets fetch [OPTIONS]Fetches secrets from Kubernetes and updates persisted environment secrets.
Example:
loko secrets fetchsecrets show
Section titled “secrets show”Display workload credentials.
loko secrets show [WORKLOAD] [OPTIONS]Arguments:
WORKLOAD- Workload name (optional, shows all if omitted)
Options:
--format TEXT- Output format (rich,json,text)
Examples:
# Show all secretsloko secrets show
# Show specific workloadloko secrets show postgres
# JSON output for scriptingloko secrets show --format jsonloko secrets show postgres --format jsonCatalog Commands
Section titled “Catalog Commands”catalog list
Section titled “catalog list”List available workloads in catalog.
loko catalog list [OPTIONS]Options:
--category TEXT- Filter by category--search TEXT- Search by name/description
Example:
loko catalog list --category databaseSee Catalog Management for details.
catalog info
Section titled “catalog info”Show catalog information.
loko catalog infoDisplays catalog version, location, and statistics.
catalog sync
Section titled “catalog sync”Sync catalog from remote source (GitHub by default).
loko catalog sync [OPTIONS]Options:
--url [URL]- Remote catalog URL (defaults to GitHub catalog)--force- Force sync even if versions match--dry-run- Preview changes without applying--no-cache- Skip cache and force fresh fetch--diff/--no-diff- Show/hide diff before applying (default: on)
Examples:
# Sync from official GitHub catalogloko catalog sync
# Sync from custom URLloko catalog sync --url https://example.com/catalog.yaml
# Preview changes firstloko catalog sync --dry-run
# Force fresh fetchloko catalog sync --no-cacheSee Remote Catalog Sync for details.
Official Catalog: github.com/getloko/catalog
catalog update
Section titled “catalog update”Update component versions.
loko catalog update [OPTIONS]Options:
--dry-run- Preview updates
Example:
loko catalog update --dry-runcatalog migrate
Section titled “catalog migrate”Reset to embedded catalog.
loko catalog migrate [OPTIONS]Options:
--force- Force migration even if same version
Config Commands
Section titled “Config Commands”config generate
Section titled “config generate”Generate loko.yaml configuration.
loko config generate [OPTIONS]Options:
--force- Overwrite existing config--local-ip TEXT- Override auto-detected local IP--output, -o TEXT- Output file path [default: loko.yaml]
Example:
loko config generate --local-ip 192.168.0.10loko config generate --forceSee Configuration for details.
config sync
Section titled “config sync”Sync configuration to cluster.
loko config sync [OPTIONS]Options:
--backup/-b- Create backup before applying changes--diff/--no-diff- Show or hide detailed diffs
Automatically handles workload namespace changes: if a workload’s namespace is moved in loko.yaml, config sync will uninstall the release from the old namespace before redeploying it in the new one.
Example:
loko config syncconfig validate
Section titled “config validate”Validate configuration file.
loko config validate [FILE]Arguments:
FILE- Config file path (default: loko.yaml)
Tunnel Commands
Section titled “Tunnel Commands”The tunnel group manages the HAProxy TCP tunnel container for workload port forwarding, and the ngrok-based HTTP(S) sharing feature.
tunnel status
Section titled “tunnel status”Show tunnel container status and forwarded ports.
loko tunnel status [OPTIONS]Options:
--format TEXT- Output format (rich,json,text)--force-color- Force colored output
tunnel start
Section titled “tunnel start”Start the tunnel container.
loko tunnel starttunnel stop
Section titled “tunnel stop”Stop the tunnel container.
loko tunnel stoptunnel recreate
Section titled “tunnel recreate”Recreate the tunnel container with updated port configuration.
loko tunnel recreateUse this after adding or removing workloads with TCP ports. The tunnel container can be recreated without affecting the Kind cluster.
tunnel share
Section titled “tunnel share”Share an HTTP(S) workload or Kubernetes Ingress publicly via an ngrok tunnel.
loko tunnel share [OPTIONS]Options:
--workload TEXT/-w- Workload name defined inloko.yaml--ingress TEXT/-i- Kubernetes Ingress resource name--namespace TEXT/-n- Namespace for--ingress(default: system namespace)--verbose/-v- Show technical details (hostname, traffic policy file path)--detach/-d- Run tunnel in background (detached mode)
Exactly one of --workload or --ingress must be provided.
The Host header is automatically rewritten so traffic routes correctly through Traefik to the workload. Only HTTP(S) workloads are supported.
Requires: ngrok installed and authenticated (ngrok config add-authtoken <token>).
Examples:
# Share a workload defined in loko.yamlloko tunnel share --workload mysql-ui
# Share an arbitrary Kubernetes Ingressloko tunnel share --ingress my-ingressloko tunnel share --ingress my-ingress --namespace my-namespace
# Run in backgroundloko tunnel share --workload myapp --detachDNS Commands
Section titled “DNS Commands”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]See Network & DNS for details.
Helm Commands
Section titled “Helm Commands”helm repo add
Section titled “helm repo add”Add Helm repository.
loko helm repo add NAME URLArguments:
NAME- Repository nameURL- Repository URL
Example:
loko helm repo add bitnami https://charts.bitnami.com/bitnamiGitOps Commands
Section titled “GitOps Commands”gitops init
Section titled “gitops init”Bootstrap GitOps integration for the current environment.
loko gitops init [OPTIONS]Options:
--provider [fluxcd|argocd]- GitOps provider (default:fluxcd)--org TEXT- Forgejo organization owner for created repos--force- Overwrite existing non-empty GitOps repository--verbose- Show underlying command output
See GitOps for full bootstrap flow.
gitops status
Section titled “gitops status”Show GitOps reconciliation status and health.
loko gitops status [OPTIONS]Options:
--json- Structured output for automation/CI
gitops destroy
Section titled “gitops destroy”Tear down GitOps integration and bootstrap resources.
loko gitops destroy [OPTIONS]Options:
--force- Skip confirmation prompt--dry-run- Print actions without performing them
gitops reconcile
Section titled “gitops reconcile”Trigger immediate reconciliation of the root GitOps construct for the configured provider.
- FluxCD: annotates
FluxInstance/flux,Kustomization/loko-root, andGitRepository/loko-gitopswithreconcile.fluxcd.io/requestedAt - ArgoCD: patches
Application/loko-rootto trigger an immediate sync
loko gitops reconcile [OPTIONS]Example:
loko gitops reconcilegitops reset
Section titled “gitops reset”Destroy and re-initialize GitOps while keeping gitops.enabled: true in loko.yaml.
loko gitops reset [OPTIONS]Options:
--provider [fluxcd|argocd]- Provider to use after reset (default: fromloko.yaml)--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. Use --now to bootstrap immediately.
loko gitops enable [OPTIONS]Options:
--now- Also apply the change immediately--provider, -p [fluxcd|argocd]- Provider to apply when using--now--org, -o TEXT- Forgejo organization to use for the repository when using--now--force, -f- Overwrite existing repository if it’s not empty when using--now--verbose, -v- Show detailed output from underlying commands when using--now
gitops disable
Section titled “gitops disable”Disable GitOps in loko.yaml. Use --now to destroy immediately.
loko gitops disable [OPTIONS]Options:
--now- Also apply the change immediately
gitops provider
Section titled “gitops provider”Show or set gitops.provider in loko.yaml.
loko gitops provider [fluxcd|argocd]Arguments:
fluxcd|argocd- Optional provider name; omit to print the current provider
Registry Commands
Section titled “Registry Commands”registry status
Section titled “registry status”Show registry statistics and configuration.
loko registry status [OPTIONS]Options:
--format TEXT- Output format (rich,json,text)
registry repos
Section titled “registry repos”List all repositories in the registry. Alias: ls.
loko registry repos [OPTIONS]registry show-repo
Section titled “registry show-repo”Show details and tags for a specific repository.
loko registry show-repo REPOSITORY [OPTIONS]Arguments:
REPOSITORY- Repository name (e.g.,myappordocker.io/library/nginx)
registry list-tags
Section titled “registry list-tags”List all tags for a repository.
loko registry list-tags REPOSITORY [OPTIONS]Arguments:
REPOSITORY- Repository name
Example:
loko registry list-tags myappregistry purge-repo
Section titled “registry purge-repo”Delete all tags from a specific repository.
loko registry purge-repo REPOSITORY [OPTIONS]Arguments:
REPOSITORY- Repository name
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 via kind load docker-image. Useful during development to avoid a push/pull cycle.
loko registry load-image IMAGE... [OPTIONS]Arguments:
IMAGE- One or more image names (e.g.,myapp:latest)
Options:
--nodes TEXT/-n- Comma-separated list of cluster nodes (default: all nodes)
Examples:
loko registry load-image myapp:latestloko registry load-image myapp:latest myapp:v1.0.0loko registry load-image myapp:latest --nodes kind-workerCheck Commands
Section titled “Check Commands”check prerequisites
Section titled “check prerequisites”Check required tools.
loko check prerequisitesVerifies installation of required tools (Docker, Git, Kind, Helm, Helmfile, kubectl, cfssl, stern, aws, mise) and optional tools (ngrok). Shows install URLs for any missing tools.
See Prerequisites for details.
check terminal
Section titled “check terminal”Check terminal capabilities for rich output.
loko check terminalChecks terminal capabilities for rich output (colors, Unicode, etc.).
Status & Info Commands
Section titled “Status & Info 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 container 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:
# Default: detailed panel viewloko status
# Compact table viewloko status --short
# JSON output for scriptingloko status --format json
# Detailed workload breakdownloko status --workloadsExample Output (panel view):
╭─────────────────── Cluster ────────────────────╮│ ✓ Cluster running ││ Provider: kind ││ Nodes: 2 ready (1 control-plane, 1 worker) │╰────────────────────────────────────────────────╯
╭────────────────── DNS ─────────────────────────╮│ ✓ DNS healthy ││ Service: running (dnsmasq) ││ Resolver: configured (/etc/resolver/dev.me) │╰────────────────────────────────────────────────╯validate
Section titled “validate”Run comprehensive environment validation (including self-test deployment).
loko validate [OPTIONS]Options:
--cleanup- Cleanup self-test app and test namespace after validation (default keeps resources for inspection)--format TEXT- Output format (rich,json,text)--force-color- Force colored output even when piping
Examples:
# Run validation and keep self-test resourcesloko validate
# Run validation and cleanup test resourcesloko validate --cleanup
# Same behavior via env aliasloko env validate --cleanupversion
Section titled “version”Show LoKO version.
loko versionGlobal Options
Section titled “Global Options”Available for all commands:
--help/-h- Show help message--debug- Enable debug output--config FILE- Use custom config file--env NAME- Use specific environment
Example:
loko --debug env createloko --config custom.yaml workload deploy postgresShell Completion
Section titled “Shell Completion”Enable shell completion for easier command usage:
# Basheval "$(loko completion bash)"
# Zsheval "$(loko completion zsh)"
# Fishloko completion fish | sourceSee Shell Completions for details.
See Also
Section titled “See Also”- User Guide - Comprehensive usage guide
- Workload Management - Workload operations
- Catalog Management - Catalog operations
- Environment Lifecycle - Environment operations