mocli, you can manage your mogenius clusters, browse Kubernetes resources, stream logs, and set up port-forwarding — all from your terminal.
The CLI includes an interactive Terminal UI (TUI) that provides k9s-style navigation without requiring a local kubeconfig. Authentication is handled through the mogenius platform, giving you secure access to any connected cluster from anywhere.
Installation
Mac, Linux
Use homebrew to installmocli:
On Linux with a headless machine,
mocli requires a browser for the initial login. After the first login, your session persists locally.Windows
Getting Started
You need a mogenius account to usemocli. If you don’t have one yet, sign up here.
Login
Run the following command to authenticate. Your browser will open automatically to complete the login:Terminal UI
Launch the interactive TUI to browse and manage your resources:Navigation
The TUI follows a hierarchical navigation pattern: Organization → Cluster → Namespace → ResourcesBrowsing Resources
Once you select a namespace, you’ll see a list of Pods by default. Use command mode (:) to switch between resource types:
:podsor:po— Pods:deploymentsor:deploy— Deployments:servicesor:svc— Services:statefulsetsor:sts— StatefulSets:daemonsetsor:ds— DaemonSets:jobs— Jobs:cronjobsor:cj— CronJobs:configmapsor:cm— ConfigMaps:secrets— Secrets:ingressesor:ing— Ingresses
Viewing Logs
Select a Pod and pressEnter to view its logs in real-time. If the Pod has multiple containers, you’ll be prompted to select one.
Port Forwarding
From the logs view or resource list, presst to create a port-forward tunnel to the selected Pod. Enter the port mapping (e.g., 8080:80) and the tunnel will be established.
Active tunnels persist while the TUI is running. Press Esc from the port-forward view to return to browsing while keeping tunnels open.
Shell Access
Select a Pod and pressx to open an interactive shell session in the container. If the Pod has multiple containers, you’ll be prompted to select one.
The shell session is tunnelled through the mogenius platform — no local kubeconfig or direct cluster access required.
CLI Commands
In addition to the TUI,mocli provides kubectl-style CLI commands for scripting and automation.
Context Management
Before using resource commands, set up your context to specify which organization, cluster, and namespace to target:--org, --cluster, or -n flags.
Listing and Getting Resources
mocli list is an alias for mocli get when listing all resources of a kind:
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.
Deleting Resources
Shell Access
Open an interactive shell in a running container:mocli exec is an alias for mocli shell.
Viewing Logs (CLI)
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
Authentication
Cluster Management
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:
Connecting a Cluster
You can use the CLI to install the mogenius operator on your Kubernetes cluster:- Run the connect command:
- Select an organization
- Create a new cluster entry or select an existing one
- Confirm to deploy the operator
mocli config list to see your available clusters.
Port Forwarding (CLI)
Use the CLI to create secure TCP tunnels to Kubernetes workloads without direct cluster access:Pod, Service, Deployment, StatefulSet, DaemonSet
Examples:
The tunnel remains active while the CLI process runs. Press
Ctrl+C to terminate.
For detailed usage and options, see Tunnels.