Skip to main content
In addition to the Terminal UI, 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):
Unlike 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:
Supported conditions:
  • condition=complete — Job completed successfully
  • condition=failed — Job failed
  • condition=ready — Pod is ready
  • delete — 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:
This adds a source line to your shell’s config file (~/.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:
Autocompletion is dynamic: when you tab-complete a resource name, namespace, or kind, mocli queries your active context live — so you get the real names from your cluster, not just static command names.

Version