Library for managing AI coding agents across different hosts
This project has been archived.
The maintainers of this project have marked this project as archived. No new releases are expected.
Project description
mng: build your team of AI engineering agents
installation:
curl -fsSL https://raw.githubusercontent.com/imbue-ai/mng/main/scripts/install.sh | bash
mng is very simple to use:
mng # launch claude locally (defaults: command=create, agent=claude, provider=local, project=current dir)
mng --in modal # launch claude on Modal
mng my-task # launch claude with a name
mng my-task codex # launch codex instead of claude
mng -- --model opus # pass any arguments through to the underlying agent
# send an initial message so you don't have to wait around:
mng --no-connect --message "Speed up one of my tests and make a PR on github"
# or, be super explicit about all of the arguments:
mng create --name my-task --agent-type claude --in modal
# tons more arguments for anything you could want! Learn more via --help
mng create --help
# or see the other commands--list, destroy, message, connect, push, pull, clone, and more!
mng --help
mng is fast:
> time mng local-hello --message "Just say hello" --no-connect
Agent creation started in background (PID: 709262)
Agent name: local-hello
real 0m1.472s
user 0m1.181s
sys 0m0.227s
> time mng list
NAME STATE HOST PROVIDER HOST STATE LABELS
local-hello RUNNING @local local RUNNING project=mng
real 0m1.773s
user 0m0.955s
sys 0m0.166s
mng itself is free, and the cheapest way to run remote agents (they shut down when idle):
mng create --in 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 completes
mng takes security and privacy seriously:
# by default, cannot be accessed by anyone except your modal account (uses a local unique SSH key)
mng create example-task --in modal
# you (or your agent) can do whatever bad ideas you want in that container without fear
mng exec example-task "rm -rf /"
# you can block all outgoing internet access
mng create --in modal -b offline
# or restrict outgoing traffic to certain IPs
mng create --in modal -b cidr-allowlist=203.0.113.0/24
mng is powerful and composable:
# start multiple agents on the same host to save money and share data
mng create agent-1 --in modal --host-name shared-host
mng create agent-2 --host shared-host
# run commands directly on an agent's host
mng exec agent-1 "git log --oneline -5"
# never lose any work: snapshot and fork the entire agent states
mng create doomed-agent --in modal
SNAPSHOT=$(mng snapshot doomed-agent --format "{id}")
mng message doomed-agent "try running 'rm -rf /' and see what happens"
mng create new-agent --snapshot $SNAPSHOT
mng makes it easy to work with remote agents
mng connect my-agent # directly connect to remote agents via SSH for debugging
mng pull my-agent # pull changes from an agent to your local machine
mng push my-agent # push your changes to an agent
mng pair my-agent # or sync changes continuously!
mng is easy to learn:
> mng ask "How do I create a container on modal with custom packages installed by default?"
Simply run:
mng create --in modal --build-arg "--file path/to/Dockerfile"
Overview
mng makes it easy to create and use any AI agent (ex: Claude Code, Codex), whether you want to run locally or remotely.
mng is built on open-source tools and standards (SSH, git, tmux, docker, etc.), and is extensible via plugins to enable the latest AI coding workflows.
Installation
Quick install (installs system dependencies + mng automatically):
curl -fsSL https://raw.githubusercontent.com/imbue-ai/mng/main/scripts/install.sh | bash
Manual install (requires uv and system deps: git, tmux, jq, rsync, unison):
uv tool install mng
# or run without installing
uvx mng
Upgrade:
uv tool upgrade mng
For development:
git clone git@github.com:imbue-ai/mng.git && cd mng && uv sync --all-packages && uv tool install -e libs/mng
Shell Completion
mng supports tab completion for commands, options, and agent names in bash and zsh.
Shell completion is configured automatically by the install script (scripts/install.sh).
To set up manually, generate the completion script and append it to your shell rc file:
Zsh (run once):
uv tool run --from mng python3 -m imbue.mng.cli.complete --script zsh >> ~/.zshrc
Bash (run once):
uv tool run --from mng python3 -m imbue.mng.cli.complete --script bash >> ~/.bashrc
Note: mng must be installed on your PATH for completion to work (not invoked via uv run).
Commands
# without installing:
uvx mng <command> [options]
# if installed:
mng <command> [options]
For managing agents:
create: (default) Create and run an agent in a hostdestroy: Stop an agent (and clean up any associated resources)connect: Attach to an agent
list: List active agentsstop: Stop an agentstart: Start a stopped agentsnapshot[experimental]: Create a snapshot of a host's stateexec: Execute a shell command on an agent's hostrename: Rename an agentclone: Create a copy of an existing agentmigrate: Move an agent to a different hostlimit: Configure limits for agents and hosts
For moving data in and out:
pull: Pull data from agentpush: Push data to agentpair: Continually sync data with an agentmessage: Send a message to an agentprovision: Re-run provisioning on an agent (useful for syncing config and auth)
For maintenance:
cleanup: Clean up stopped agents and unused resourcesevents: View agent and host event filesgc: Garbage collect unused resources
For managing mng itself:
ask: Chat with mng for helpplugin[experimental]: Manage mng pluginsconfig: View and edit mng configuration
How it works
You can interact with mng via the terminal (run mng --help to learn more).
mng uses robust open source tools like SSH, git, and tmux to run and manage your agents:
- agents are simply processes that run in tmux sessions, each with their own
work_dir(working folder) and configuration (ex: secrets, environment variables, etc) - agents run on hosts--either locally (by default), or special environments like Modal Sandboxes (
--in modal) or Docker containers (--in docker). Use--host <name>to target an existing host. - multiple agents can share a single host.
- hosts come from providers (ex: Modal, AWS, docker, etc)
- hosts help save money by automatically "pausing" when all of their agents are "idle". See idle detection for more details.
- hosts automatically "stop" when all of their agents are "stopped"
mngis extensible via plugins--you can add new agent types, provider backends, CLI commands, and lifecycle hooks
Architecture
mng stores very little state (beyond configuration and local caches for performance), and instead relies on conventions:
- any process running in window 0 of a
mng-prefixed tmux sessions is considered an agent - agents store their status and logs in a standard location (default:
$MNG_HOST_DIR/agents/<agent_id>/) - all hosts are accessed via SSH--if you can SSH into it, it can be a host
- ...and more
See architecture.md for an in-depth overview of the mng architecture and design principles.
Security
Best practices:
- Use providers with good isolation (like Docker or Modal) when working with agents, especially those that are untrusted.
- Follow the "principle of least privilege": only expose the minimal set of API tokens and secrets for each agent, and restrict their access (eg to the network) as much as possible.
- Avoid storing sensitive data in agents' filesystems (or encrypt it if necessary).
See our security model for more details.
Sub-projects
This is a monorepo that contains the code for mng here:
As well as the code for some plugins that we maintain, including:
The repo also contains code for some dependencies and related projects, including:
- libs/concurrency_group: a simple Python library for managing synchronous concurrent primitives (threads and processes) in a way that makes it easy to ensure that they are cleaned up.
- libs/imbue_common: core libraries that are shared across all of our projects
- apps/changelings: an experimental project around scheduling runs of autonomous agents
Contributing
Contributions are welcome!
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mng-0.1.6.tar.gz.
File metadata
- Download URL: mng-0.1.6.tar.gz
- Upload date:
- Size: 841.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4554189b419b59c4563bd45ee7250a8cec9541c51179a0f195e2b22b8f06b5fe
|
|
| MD5 |
6af8d159650eb128150c6f35263bffe3
|
|
| BLAKE2b-256 |
f0fabbab81a78a042c56c6b1152e92b2836ba98f5de2381f22fd325ebaeb68e2
|
Provenance
The following attestation bundles were made for mng-0.1.6.tar.gz:
Publisher:
publish.yml on imbue-ai/mng
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mng-0.1.6.tar.gz -
Subject digest:
4554189b419b59c4563bd45ee7250a8cec9541c51179a0f195e2b22b8f06b5fe - Sigstore transparency entry: 1044516974
- Sigstore integration time:
-
Permalink:
imbue-ai/mng@b095b22062666e6be1d7b8b7ea7e103244783aea -
Branch / Tag:
refs/tags/v0.1.6 - Owner: https://github.com/imbue-ai
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@b095b22062666e6be1d7b8b7ea7e103244783aea -
Trigger Event:
push
-
Statement type:
File details
Details for the file mng-0.1.6-py3-none-any.whl.
File metadata
- Download URL: mng-0.1.6-py3-none-any.whl
- Upload date:
- Size: 496.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2fdcdb5ae731bf98ee864434610e9657a6d5eb77a77ab837d97d8e5e0bb6298f
|
|
| MD5 |
c3e2adb7118896616805dc0226298eee
|
|
| BLAKE2b-256 |
762406ff83911df24de3d66343db6bb4491ac0a870c97457d8885defb00679e1
|
Provenance
The following attestation bundles were made for mng-0.1.6-py3-none-any.whl:
Publisher:
publish.yml on imbue-ai/mng
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mng-0.1.6-py3-none-any.whl -
Subject digest:
2fdcdb5ae731bf98ee864434610e9657a6d5eb77a77ab837d97d8e5e0bb6298f - Sigstore transparency entry: 1044488641
- Sigstore integration time:
-
Permalink:
imbue-ai/mng@b095b22062666e6be1d7b8b7ea7e103244783aea -
Branch / Tag:
refs/tags/v0.1.6 - Owner: https://github.com/imbue-ai
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@b095b22062666e6be1d7b8b7ea7e103244783aea -
Trigger Event:
push
-
Statement type: