The megha CLI
Drive MeghaOS from your terminal — ask, do, refactor, set up repos, and more.
MeghaOS ships a terminal companion: megha, a command-line tool that talks to the
running agent at http://localhost:8000. It brings the agent's brain to your shell — ask
questions, run AI-driven tasks, refactor code, scaffold repos, and open PRs without leaving
the terminal.
Setup
The launcher adds the CLI to your PATH automatically. To use
it in any shell, add it yourself:
export PATH="/path/to/dynamic_desktop/agent/bin:$PATH"The CLI requires the agent to be running (it POSTs to http://localhost:8000).
Commands
| Command | What it does |
|---|---|
megha ask "<question>" | Ask the AI anything |
megha do "<task>" | Execute a system task via the agent |
megha setup <git-url> [dir] | Clone & AI-set-up a git repo |
megha refactor <file> | AI-refactor a code file |
megha summarize <file> | AI-summarize a file |
megha generate-tests <file> | Generate unit tests for a file |
megha search "<query>" | Web search via the agent |
megha pr create "<title>" | Open a GitHub PR from the current branch |
megha status | Show MeghaOS system status |
megha ask "what's the difference between a process and a thread?"
megha do "free up disk space in ~/Downloads"
megha refactor src/utils.py
megha setup https://github.com/acme/widget
megha pr create "Add dark mode"How it works
megha is a thin Bash client: each subcommand POSTs to the appropriate agent endpoint
(e.g. /chat, /api/llm, /project/setup, /cli/dispatch) and prints the result. Because
it hits the same backend as the desktop, anything the shell can do is reachable from the
terminal — including the full tool catalog and
workflows.
Repo setup
megha setup <git-url> (backed by bin/megha-setup and the project_setup plugin /
/project/setup) clones a repository and runs an AI-driven setup — detecting the stack,
installing dependencies, and getting it ready to run. Optionally pass a target directory:
megha setup https://github.com/acme/api./apiThe /cli/dispatch endpoint
Commands route through the agent's HTTP API, including
POST /cli/dispatch for general command dispatch — so the CLI
stays in lockstep with the desktop's capabilities.
megha pairs naturally with Computer Control: use the CLI for
quick, scriptable asks, and computer control when you want the agent to drive a GUI app or
IDE.