Skip to content

Expose a CLI/MCP automation surface for sessions, worktrees, and agent handoff #3

Description

@felipeorlando

Problem

MonoCode is currently driven through the desktop UI and internal Tauri commands. External agents and scripts cannot reliably list sessions, create/select a worktree, start a provider in it, send a task, or observe completion.

This blocks higher-level orchestration and makes automation fall back to fragile UI control.

Proposed first slice

Expose one supported local automation API, with a thin CLI as the primary interface and JSON output:

monocode session list --json
monocode session create --provider codex --cwd /repo --prompt "Fix the bug" --json
monocode worktree list --repo /repo --json
monocode worktree create --repo /repo --name fix-bug --provider claude --prompt "Fix the bug" --json
monocode session send --session <id> --text "Run the tests" --json
monocode session wait --session <id> --for idle --timeout-ms 300000 --json

A skill can document the commands for coding agents. An MCP server can be a thin adapter over the same API if needed; it should not become a second orchestration implementation.

Use the running desktop app as the source of truth and keep control local/authenticated by default.

Reference

Orca demonstrates the useful workflow boundary: worktree create --agent --prompt, plus terminal/session list, send, read, and wait commands. The goal is the same ergonomic handoff, adapted to MonoCode's native session model—not parity with all Orca features.

Existing work checked

The repository has provider MCP configuration and in-app skills/commands, but no public MonoCode CLI, MCP control server, or current upstream issue/PR for external session/worktree orchestration.

Acceptance criteria

  • A script can create a session in the main checkout or a worktree and send the initial prompt in one command.
  • Every mutation returns a stable session/worktree identifier.
  • List/show/wait commands expose enough state to supervise work without screen scraping.
  • CLI and any MCP wrapper share the same underlying API and lifecycle semantics.
  • Commands fail clearly when MonoCode is not running or the target no longer exists.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions