mocli provides kubectl-style CLI commands for scripting and automation. They run against your active context and accept the same connection flags (--org/--cluster/-n, --context, --kubeconfig, --direct, --platform).
Listing and getting resources
mocli list is an alias for mocli get when listing all resources of a kind:
Describing resources
Show a detailed, human-readable view of a resource — its spec, status, and recent events:Creating resources
Create resources from manifest files or directly via CLI:Applying resources
Apply a manifest with create-or-update semantics — resources that don’t exist yet are created, and resources that already exist are updated in place. Applying the same manifest twice is safe (idempotent):mocli create, which fails when a resource already exists, mocli apply reconciles the cluster to match your manifest — making it the safer choice for repeatable deployments and CI/CD pipelines.
Editing resources
Open a resource in your editor and apply the changes on save (uses$KUBE_EDITOR or $EDITOR):
Scaling and restarting workloads
Resource usage
Show CPU and memory usage for pods and nodes:On a direct kubeconfig connection,
top and pod CPU/RAM columns require a metrics-server on the cluster.Deleting resources
Shell access
Open an interactive shell in a running container:mocli exec is an alias for mocli shell.
Viewing logs
Stream or fetch logs from pods and jobs:Waiting for conditions
Wait for a resource to reach a specific condition — useful in CI/CD pipelines:condition=complete— Job completed successfullycondition=failed— Job failedcondition=ready— Pod is readydelete— Resource has been deleted
Shell autocompletion
mocli can complete commands, flags, and even live resource names, namespaces, and kinds directly in your shell.
The quickest way is to let mocli detect your shell and set everything up automatically:
~/.zshrc, ~/.bashrc) or writes a completion file for fish (~/.config/fish/completions/). The command is idempotent — running it twice does nothing. Restart your shell or re-source the config file to activate it.
To set it up manually, generate the completion script for your shell: