JSPM

  • Created
  • Published
  • Downloads 219
  • Score
    100M100P100Q90483F

A local control plane for agent CLIs — orchestration and visibility for Claude Code, Codex, Gemini CLI, and more across Git worktrees

Package Exports

    This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (commandmate) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

    Readme

    CommandMate

    GitHub Stars npm version npm downloads license CI Status: Beta

    English | 日本語

    CommandMate Desktop Demo

    Orchestrate your agent CLIs, not your terminal tabs.

    CommandMate is a local control plane for agent CLIs.

    npx commandmate

    From install to your first session in 60 seconds. macOS / Linux / Windows (WSL2) · Node.js v20+ · npm · git · tmux


    CommandMate adds orchestration and visibility on top of your existing agent CLIs. It does not replace tmux, Git worktrees, or your terminal. It makes them easier to manage at scale.

    CommandMate Mobile Demo

    Works on desktop and mobile — monitor and steer sessions from any browser, including your phone.

    If this is the kind of AI development workflow you want, give the repo a star.


    Key Features

    Feature What it does Why it matters
    Git Worktree Sessions One session per worktree, parallel execution Multiple issues progress simultaneously without interference
    Multi-Agent Support Choose Claude Code, Codex, Gemini, or local models per issue Pick the right agent for each task
    Auto Yes Mode Agent runs without stopping for confirmations Optional unattended mode for trusted workflows — review the Security section before enabling
    Web UI (Desktop & Mobile) Full session control from any browser Monitor and steer from your desk or your phone
    File Viewer & Markdown Editor Browse and edit worktree files in the browser Review changes and update AI instructions without opening an IDE
    Screenshot Instructions Attach images to your prompts Snap a bug → "Fix this" — the agent sees the screenshot
    Scheduled Execution Cron-based auto-run via CMATE.md Daily reviews, nightly tests — agents work on a schedule
    Token Authentication SHA-256 hashed token + HTTPS + rate limiting Secure remote access — no credentials leaked, brute-force protected

    Use Cases

    Scenario How CommandMate helps
    Parallel issue development Run multiple issues in separate worktrees, each with its own agent session
    Issue refinement Define an issue, let AI fill gaps, review before any code is written
    Overnight execution Queue issues with scheduled execution — check progress in the morning
    Mobile review Review AI-generated changes and steer direction from your phone
    Visual bug fix Snap a UI bug on your phone, send it with "Fix this"

    Security

    Runs 100% locally. No external server, no cloud relay, no account required. The only network traffic is Claude CLI's own API calls.

    See the Security Guide and Trust & Safety for details.


    How it works

    flowchart LR
        A["Browser / Phone"] -->|HTTP| B["CommandMate Server"]
        B --> C["Session Manager"]
        C -->|"spawn / attach"| D["tmux sessions\n(per worktree)"]
        D --> E["Claude Code CLI"]
        C <-->|"read / write"| F[("Local DB\n& State")]

    Each Git worktree gets its own tmux session, so multiple tasks run in parallel without interference.


    Quick Start (detailed)
    # Install & start in one command
    npx commandmate
    
    # Or install globally
    npm install -g commandmate
    commandmate init
    commandmate start --daemon

    Open http://localhost:3000 in your browser.

    See the CLI Setup Guide for details. For Windows users, see the WSL2 Setup Guide.

    CLI Commands

    Basic

    Command Description
    commandmate init Initial setup (interactive)
    commandmate init --defaults Initial setup (default values)
    commandmate init --force Overwrite existing configuration
    commandmate start Start the server (foreground)
    commandmate start --daemon Start in background
    commandmate start --dev Start in development mode
    commandmate start -p 3001 Start on a specific port
    commandmate stop Stop the server
    commandmate stop --force Force stop (SIGKILL)
    commandmate status Check status

    Worktree Parallel Development

    Run separate servers per Issue/worktree with automatic port allocation.

    Command Description
    commandmate start --issue 123 Start server for Issue #123 worktree
    commandmate start --issue 123 --auto-port Start with automatic port allocation
    commandmate start --issue 123 -p 3123 Start on a specific port
    commandmate stop --issue 123 Stop server for Issue #123
    commandmate status --issue 123 Check status for Issue #123
    commandmate status --all Check status for all servers

    Agent Operations

    Operate agent sessions from the CLI. See the CLI Operations Guide for details.

    Command Description
    commandmate ls List worktrees with status (idle/ready/running/waiting)
    commandmate ls --json JSON output (for agent consumption)
    commandmate ls --quiet IDs only, one per line (for piping)
    commandmate ls --branch feature/ Filter by branch name prefix
    commandmate send <id> "message" Send a message to an agent
    commandmate send <id> "msg" --auto-yes Send with auto-yes enabled
    commandmate send <id> "msg" --agent codex Send to a specific agent
    commandmate wait <id> --timeout 300 Wait for agent completion (exit 0) or prompt (exit 10)
    commandmate wait <id> --on-prompt human Wait, let human respond to prompts via browser UI
    commandmate respond <id> "yes" Respond to an agent's prompt
    commandmate capture <id> Get current terminal output
    commandmate capture <id> --json Get output with status info as JSON
    commandmate auto-yes <id> --enable Enable auto-yes (default 1h)
    commandmate auto-yes <id> --disable Disable auto-yes

    Typical workflow:

    WT=$(commandmate ls --branch feature/101 --quiet)
    commandmate send "$WT" "Implement Issue #101" --auto-yes
    commandmate wait "$WT" --timeout 600
    commandmate capture "$WT"

    For coding agents (Claude Code, Codex, etc.): Have your agent run these commands to get the full guide and workflow samples:

    commandmate docs --section agent-operations          # Full guide
    commandmate docs --section agent-operations-samples  # Workflow samples

    GitHub Issue Management

    Requires gh CLI to be installed.

    Command Description
    commandmate issue create Create a new issue
    commandmate issue create --bug Create with bug report template
    commandmate issue create --feature Create with feature request template
    commandmate issue create --question Create with question template
    commandmate issue create --title <title> Specify issue title
    commandmate issue create --body <body> Specify issue body
    commandmate issue create --labels <labels> Add labels (comma-separated)
    commandmate issue search <query> Search issues
    commandmate issue list List issues

    Documentation

    Command Description
    commandmate docs Show documentation
    commandmate docs -s <section> Show a specific section
    commandmate docs -q <query> Search documentation
    commandmate docs --all List all available sections

    See commandmate --help for all options.

    Troubleshooting & FAQ

    Claude CLI not found / path changed?

    If you switch between npm and standalone versions of Claude CLI, the path may change. CommandMate auto-detects the new path on the next session start. To set a custom path, add CLAUDE_PATH=/path/to/claude to .env.

    Port conflict?

    commandmate start -p 3001

    Session stuck or not responding?

    Check tmux sessions directly. CommandMate manages sessions with the naming format mcbd-{tool}-{worktree}:

    # List all CommandMate sessions
    tmux list-sessions | grep mcbd
    
    # View session output (without attaching)
    tmux capture-pane -t "mcbd-claude-feature-123" -p
    
    # Attach to inspect (detach with Ctrl+b then d)
    tmux attach -t "mcbd-claude-feature-123"
    
    # Kill a broken session
    tmux kill-session -t "mcbd-claude-feature-123"

    Note: When attached, avoid typing directly into the session — this can interfere with CommandMate's session management. Use Ctrl+b then d to detach and operate through the CommandMate UI instead.

    Sessions fail when launching from within Claude Code?

    Claude Code sets CLAUDECODE=1 to prevent nesting. CommandMate removes this automatically, but if it persists, run: tmux set-environment -g -u CLAUDECODE

    FAQ

    Q: How do I use CommandMate from my phone? A: CommandMate runs a web server on your PC. To access it from your phone, your phone and PC must be on the same network (Wi-Fi). Run commandmate init and enable external access — this sets CM_BIND=0.0.0.0. Then open http://<your-PC-IP>:3000 in your phone's browser.

    Q: Can I access it from outside my home network? A: Yes. Use a tunneling service to securely expose your local server without opening router ports:

    • Cloudflare Tunnel — free, requires Cloudflare account
    • ngrok — free tier available, easy setup
    • Pinggy — no sign-up required, simple SSH-based tunnel

    Alternatively, a VPN or an authenticated reverse proxy (Basic Auth, OIDC, etc.) also works. Do not expose the server directly to the internet without authentication.

    Q: Does it work on iPhone / Android? A: Yes. CommandMate's Web UI is responsive and works on any modern mobile browser (Safari, Chrome, etc.). No app install required.

    Q: Is tmux required? A: CommandMate uses tmux internally to manage CLI sessions. You don't need to operate tmux directly — CommandMate handles it for you.

    Q: What about Claude Code's permissions? A: Claude Code's own permission settings apply as-is. CommandMate does not expand permissions. See Trust & Safety for details.

    Q: Can multiple people use it? A: Currently designed for individual use. Simultaneous multi-user access is not supported.

    Developer Setup

    For contributors or those building a development environment:

    git clone https://github.com/Kewton/CommandMate.git
    cd CommandMate
    ./scripts/setup.sh  # Auto-runs dependency check, env setup, build, and launch

    Manual Setup (for customization)

    git clone https://github.com/Kewton/CommandMate.git
    cd CommandMate
    ./scripts/preflight-check.sh          # Dependency check
    npm install
    ./scripts/setup-env.sh                # Interactive .env generation
    npm run db:init
    npm run build
    npm start

    Note: ./scripts/* scripts are only available in the development environment. For global installs (npm install -g), use the commandmate CLI.


    Comparison
    Feature CommandMate Remote Control (Official) Happy Coder claude-squad Omnara
    Auto Yes Mode Yes No No Yes (TUI only) No
    Git Worktree Management Yes No No Yes (TUI only) No
    Parallel Sessions Yes No (1 only) Yes Yes No
    Mobile Web UI Yes Yes (claude.ai) Yes No Yes
    File Viewer Yes No No No No
    Markdown Editor Yes No No No No
    Screenshot Instructions Yes No No Not possible No
    Scheduled Execution Yes No No No No
    Survives Laptop Close Yes (daemon) No (terminal must stay open) Yes Yes Yes
    Token Authentication Yes N/A (Anthropic account) N/A (app) No N/A (cloud)
    Free / OSS Yes Requires Pro/Max Free + Paid Yes $20/mo
    Runs 100% Locally Yes Via Anthropic API Server-routed Yes Cloud fallback

    Optional Workflow Layer

    If your team wants more structure, CommandMate can also help you standardize issue refinement, design review, planning, implementation, and acceptance checks. These workflows build on top of the same CLI sessions and worktrees. They are optional, not required.

    CommandMate is built for developers who spend less time editing files and more time defining issues, reviewing direction, and accepting outcomes from coding agents. The commands below turn that workflow into a repeatable process.

    Define Issue → Refine with AI → Review Direction → Generate Plan → Agent Executes
    Step Command What happens
    Refine the issue /issue-enhance AI asks clarifying questions and fills in missing details
    Review the issue /multi-stage-issue-review Multi-stage review (consistency, impact scope) with automated fixes
    Review the design /multi-stage-design-review 4-stage review (general → consistency → impact → security)
    Plan the work /work-plan Generates a task breakdown with dependencies
    Implement via TDD /tdd-impl Red-Green-Refactor cycle, automated
    Verify acceptance /acceptance-test Validates all acceptance criteria from the issue
    Create the PR /create-pr Auto-generates title, description, and labels
    Dev (full) /pm-auto-dev TDD implementation → acceptance test → refactoring → progress report
    Issue → Dev (full) /pm-auto-issue2dev Issue review → design review → work plan → TDD → acceptance test → refactoring → progress report
    Design → Dev (full) /pm-auto-design2dev Design review → work plan → TDD → acceptance test → refactoring → progress report

    For details, see the issues, dev reports, and workflow examples in the CommandMate repository.


    Documentation

    Document Description
    CLI Setup Guide Installation and initial setup
    Web App Guide Basic web app operations
    Quick Start Using Claude Code commands
    Concept Vision and problems solved
    Architecture System design
    Deployment Guide Production environment setup
    UI/UX Guide UI implementation details
    Trust & Safety Security and permissions

    Contributing

    Bug reports, feature suggestions, and documentation improvements are welcome. See CONTRIBUTING.md for details.

    License

    MIT License - Copyright (c) 2026 Kewton