用于管理编码代理的 CLI
This repository is the public mirror of Imbue's development repository: every change to the open-source code is exported here automatically, with the original author on each commit. Issues and pull requests are welcome here.
mngr is a Unix-style tool for managing coding agents.
Seamlessly scale from a single local Claude to 100s of agents across remote hosts, containers, and sandboxes. List all your agents, see which are blocked, and instantly connect to any of them to chat or debug. Compose your own powerful workflows on top of agents without being locked in to any specific provider or interface.
Built on SSH, git, and tmux. Extensible via plugins . No managed service required.
installation:
curl -fsSL https://raw.githubusercontent.com/imbue-ai/mngr/main/scripts/install.sh | bashmngr makes it easy to create and use any AI agent (ex: Claude Code, Codex), anywhere (locally, in Docker, on Modal, etc.).
Think of mngr as "git for agents": just like git allows you to commit/push/pull/fork/clone versions of code, mngr allows you to create/destroy/list/clone/message agents.
…Most agent tooling is a managed cloud: opaque infrastructure, per-seat pricing, hard to script.
mngr takes the opposite approach.
Agents run on compute you control, that you access via SSH, and that shuts down when idle.
It's built on primitives you already know (SSH, git, tmux, docker), and
mngr is designed to be:
mngr ask answers usage questions without leaving the terminalmngr is very simple to use:
…mngr is fast:
> time mngr create local-hello --message "Just say hello" --no-connect
Done.
real 0m1.472s
user 0m1.181s
sys 0m0.227s
> time mngr list
NAME STATE HOST PROVIDER HOST STATE PROJECT
local-hello RUNNING localhost local RUNNING mngr
real 0m1.773s
user 0m0.955s
sys 0m0.166smngr is free, and the cheapest way to run remote agents (they shut down when idle):
mngr create @.modal --no-connect --message "just say 'hello'" --idle-timeout 60 -- --model sonnet
# costs $0.0387443 for inference (using sonnet)
# costs $0.0013188 for compute because it shuts down 60 seconds after the agent completesmngr takes security and privacy seriously:
# by default, cannot be accessed by anyone except your modal account (uses a local unique SSH key)
mngr create [email protected]
# you (or your agent) can do whatever bad ideas you want in that container without fear
mngr exec example-task "rm -rf /"
# you can block all outgoing internet access
mngr create @.modal -b offline
# or restrict outgoing traffic to certain IPs
mngr create @.modal -b cidr-allowlist=203.0.113.0/24mngr is powerful and composable:
# start multiple agents on the same host to save money and share data
mngr create [email protected] --new-host
mngr create agent-2@shared-host
# run commands directly on an agent's host
mngr exec agent-1 "git log --oneline -5"
# never lose any work: snapshot and fork the entire agent states
mngr create [email protected]
SNAPSHOT=$(mngr snapshot create doomed-agent --format "{id}")
mngr message doomed-agent "try running 'rm -rf /' and see what happens"
mngr create new-agent --snapshot $SNAPSHOTmngr makes it easy to see what your agents are doing:
# programmatically send messages to your agents and see their chat histories
mngr message agent-1 "Tell me a joke"
mngr transcript agent-1mngr makes it easy to work with remote agents:
mngr connect my-agent # directly connect to remote agents via SSH for debugging
mngr rsync my-agent ./ # rsync changes from an agent to your local machine
mngr rsync ./ my-agent # rsync your changes to an agent
mngr git pull my-agent # pull git commits from an agent
mngr git push my-agent # push git commits to an agent
mngr pair my-agent # or sync changes continuously!mngr is easy to learn:
> mngr ask "How do I create a container on modal with custom packages installed by default?"
Simply run:
mngr create @.modal -b "--file path/to/Dockerfile"Quick install:
curl -fsSL https://raw.githubusercontent.com/imbue-ai/mngr/main/scripts/install.sh | bashThis installs uv and mngr (uv tool install imbue-mngr), then interactively prompts about system dependencies, optional extras, and a default agent type for mngr create. You can review the script before running it.
Manual install (requires uv and core system deps: git, tmux, jq; optional: ssh, rsync, unison, claude):
uv tool install imbue-mngr
# or run without installing
uvx --from imbue-mngr mngrUpgrade:
uv tool upgrade imbue-mngrFor development:
git clone [email protected]:imbue-ai/mngr.git && cd mngr && uv sync --all-packagesmngr supports tab completion for commands, options, agent names, and -S/--setting config overrides (both the KEY and, where the value is constrained, the VALUE) in bash and zsh.
Shell completion is configured automatically by the install script (scripts/install.sh), or interactively via mngr extras completion.
Your rc file gets only a small, stable shim that sources a managed completion file mngr keeps up to date, so completion improvements apply automatically when you upgrade mngr -- no need to re-edit your rc. If you have an older self-contained completion function in your rc, tab completion will nudge you to run mngr extras completion once to switch to the shim.
To set up manually, append the shim to your shell rc file (this also writes the managed completion file):
Zsh (run once):
uv tool run --from imbue-mngr python3 -m imbue.mngr.cli.complete --script zsh >> ~/.zshrcBash (run once):
uv tool run --from imbue-mngr python3 -m imbue.mngr.cli.complete --script bash >> ~/.bashrcNote: mngr must be installed on your PATH for completion to work (not invoked via uv run).
# without installing:
uvx --from imbue-mngr mngr [options]
# if installed:
mngr [options]create: Create and run an agent in a host
destroy: Stop an agent (and clean up any associated resources)
connect: Attach to an agent
list: List active agents
stop: Stop an agent
start: Start a stopped agent
snapshot [experimental]: Create a snapshot of a host's state
exec: Execute a shell command on an agent's host
rename: Rename an agent
clone: Create a copy of an existing agent
migrate: Move an agent to a different host
limit: Configure limits for agents and hosts
rsync: Rsync files between local and a remote host or agentgit: Push or pull git commits between local and a remote host or agentpair: Continually sync data with an agentmessage: Send a message to an agenttranscript: View the message transcript for an agentcleanup: Clean up stopped agents and unused resourcesevent: View agent and host event filesgc: Garbage collect unused resourcesask: Chat with mngr for helpplugin [experimental]: Manage mngr pluginsconfig: View and edit mngr configurationYou can interact with mngr via the terminal (run mngr --help to learn more).
mngr uses robust open source tools like SSH, git, and tmux to run and manage your agents:
work_dir (working folder) and configuration (ex: secrets, environment variables, etc)--provider modal) or Docker containers (--provider docker). Use the agent@host address syntax to target an existing host.mngr is extensible via plugins--you can add new agent types, provider backends, CLI commands, and lifecycle hooksmngr stores very little state (beyond configuration and local caches for performance), and instead relies on conventions:
mngr- prefixed tmux sessions is considered an agent$MNGR_HOST_DIR/agents//)…See architecture.md for an in-depth overview of the mngr architecture and design principles.
Best practices:
See our security model for more details.
This is a monorepo that contains the code for mngr here:
As well as the code for some plugins that we maintain, including:
暂无开放 Issues,或尚未同步最近议题。