Skip to content
Agent

Embedded CLI agents

Run coding-agent CLIs inside Mel with a tool belt and full key fidelity.


You don't have to choose between Mel's agent and the coding-agent CLI you already use. Type claude, codex, or opencode and Mel runs it as a first-class interactive session — full TUI rendering, faithful keyboard handling, and a tool belt of Mel helpers around it.

How detection works

Mel recognizes coding-agent CLIs by their command name — claude, codex, opencode, copilot, amp, droid, gemini — along with ssh and common TUIs like vim. When one starts, the pane switches into an interactive grid session: a real terminal emulator (alternate screen, cursor addressing, 256-color) renders the agent's interface live, and your keyboard routes straight into it. Slow-starting agents show a "Starting…" overlay until their first output, so a cold start never looks like a dead pane.

This works no matter how you launched Mel: the shell environment is hydrated from your login shell at startup, so CLIs installed via your shell rc resolve even when Mel starts from a desktop launcher.

Embedded in a conversation

Typing a CLI agent's command (or ssh, or vim) inside a Mel agent conversation runs it embedded: the live TUI takes over the conversation's content area while the conversation chrome and transcript stay. On exit, the session collapses into a shell record in the transcript — final screen preserved — and the agent input returns. In a plain terminal pane, the same session collapses into a finished block.

The tool belt

While a CLI agent runs, a belt of helpers appears:

  • Compose (ctrl+G) — a pop-out multi-line box for drafting a long prompt with a free cursor. Enter pastes it into the agent's input (via bracketed paste, so newlines survive); shift+enter adds a line; esc keeps your draft for later.
  • Voice — dictate instead of typing; see Voice input.
  • File explorer — opens the project tree; dragging a file onto the session pastes its absolute path into the agent's input.
  • View changes (ctrl+shift+=) — opens Mel's code review panel over the diff the CLI agent has produced so far.

Key fidelity

The details that make TUIs feel native are handled:

  • ctrl+C and ctrl+X are forwarded as real control bytes — so double-ctrl+C quits codex the way it should.
  • shift+tab, arrow-key modes, and bracketed paste all behave correctly; pastes arrive as one paste, not replayed keystrokes.
  • The session answers standard terminal queries, so cursor-position-sensitive TUIs render correctly.
  • Mel's own single-modifier shortcuts (ctrl+P, ctrl+D, ctrl+T…) are suspended while a TUI is active, so they reach the agent instead of Mel; ctrl+shift combinations like the review panel stay available.

They can be your workers, too

In an orchestration run, the lead agent can spawn these same CLIs as non-interactive workers in their own panes — see Orchestration.