Skip to main content

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

mngr: build your team of AI engineering agents

installation:

curl -fsSL https://raw.githubusercontent.com/imbue-ai/mngr/main/scripts/install.sh | bash

mngr is very simple to use:

mngr                  # launch claude locally (defaults: command=create, agent=claude, provider=local, project=current dir)
mngr --in modal       # launch claude on Modal
mngr my-task          # launch claude with a name
mngr my-task codex    # launch codex instead of claude
mngr -- --model opus  # pass any arguments through to the underlying agent

# send an initial message so you don't have to wait around:
mngr --no-connect --message "Speed up one of my tests and make a PR on github"

# or, be super explicit about all of the arguments:
mngr create --name my-task --agent-type claude --in modal

# tons more arguments for anything you could want! Learn more via --help
mngr create --help

# or see the other commands--list, destroy, message, connect, push, pull, clone, and more!
mngr --help

mngr is fast:

> time mngr local-hello  --message "Just say hello" --no-connect --in local
# (time results)

> time mngr remote-hello --message "Just say hello" --no-connect --in modal
# (time results)

> time mngr list
# (time results)

mngr itself is free, and the cheapest way to run remote agents (they shut down when idle):

mngr create --in modal --no-connect --message "just say 'hello'" --idle-timeout 60 -- --model sonnet
# costs $0.001 for inference
# costs $0.0001 for compute because it shuts down 60 seconds after the agent completes

mngr takes security and privacy seriously:

# by default, cannot be accessed by anyone except your modal account (uses a local unique SSH key)
mngr create example-task --in modal

# 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 --in modal -b offline

# or restrict outgoing traffic to certain IPs
mngr create --in modal -b cidr-allowlist=203.0.113.0/24

mngr is powerful and composable:

# start multiple agents on the same host to save money and share data
mngr create agent-1 --in modal --host-name shared-host
mngr create agent-2 --host 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 doomed-agent --in modal
SNAPSHOT=$(mngr snapshot doomed-agent --format "{id}")
mngr message doomed-agent "try running 'rm -rf /' and see what happens"
mngr create new-agent --snapshot $SNAPSHOT

mngr makes it easy to work with remote agents

mngr connect my-agent       # directly connect to remote agents via SSH for debugging
mngr pull my-agent          # pull changes from an agent to your local machine
mngr push my-agent          # push your changes 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 --in modal --build-arg "--dockerfile path/to/Dockerfile"

Overview

mngr makes it easy to create and use any AI agent (ex: Claude Code, Codex), whether you want to run locally or remotely.

mngr 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 + mngr automatically):

curl -fsSL https://raw.githubusercontent.com/imbue-ai/mngr/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 mngr

For development:

git clone git@github.com:imbue-ai/mngr.git && cd mngr && uv sync --all-packages && uv tool install -e libs/mngr

Shell Completion

mngr supports tab completion for commands and agent names in bash, zsh, and fish.

Zsh (add to ~/.zshrc):

eval "$(_MNGR_COMPLETE=zsh_source mngr)"

Bash (add to ~/.bashrc):

eval "$(_MNGR_COMPLETE=bash_source mngr)"

Fish (run once):

_MNGR_COMPLETE=fish_source mngr > ~/.config/fish/completions/mngr.fish

Note: mngr must be installed on your PATH for completion to work (not invoked via uv run).

Commands

# without installing:
uvx mngr <command> [options]

# if installed:
mngr <command> [options]

For managing agents:

  • create: (default) Create and run an agent in a host
  • list: List active agents
  • connect: Attach to an agent
  • stop: Stop an agent
  • start: Start a stopped agent
  • snapshot [experimental]: Create a snapshot of a host's state
  • destroy: Stop an agent (and clean up any associated resources)
  • 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

For moving data in and out:

  • pull: Pull data from agent
  • push: Push data to agent
  • pair: Continually sync data with an agent
  • message: Send a message to an agent
  • provision: Re-run provisioning on an agent (useful for syncing config and auth)

For maintenance:

  • cleanup: Clean up stopped agents and unused resources
  • logs: View agent and host logs
  • gc: Garbage collect unused resources

For managing mngr itself:

  • ask: Chat with mngr for help
  • plugin [experimental]: Manage mngr plugins
  • config: View and edit mngr configuration

How it works

You 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:

  • 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"
  • mngr is extensible via plugins--you can add new agent types, provider backends, CLI commands, and lifecycle hooks

Architecture

mngr stores very little state (beyond configuration and local caches for performance), and instead relies on conventions:

  • any process running in window 0 of a mngr- prefixed tmux sessions is considered an agent
  • agents store their status and logs in a standard location (default: $MNGR_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 mngr architecture and design principles.

Security

Best practices:

  1. Use providers with good isolation (like Docker or Modal) when working with agents, especially those that are untrusted.
  2. 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.
  3. Avoid storing sensitive data in agents' filesystems (or encrypt it if necessary).

See ./docs/security_model.md for more details on our security model.

Contributing

Contributions are welcome!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mng-0.1.0.tar.gz (704.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mng-0.1.0-py3-none-any.whl (432.1 kB view details)

Uploaded Python 3

File details

Details for the file mng-0.1.0.tar.gz.

File metadata

  • Download URL: mng-0.1.0.tar.gz
  • Upload date:
  • Size: 704.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for mng-0.1.0.tar.gz
Algorithm Hash digest
SHA256 18461792a6812e508614942bbbf485504282ac7fa4f32c7342d7b7b81a5cf68c
MD5 832c90c1df2421be1171081ebf972231
BLAKE2b-256 2525daf3505488fd856b99767a7bd76af0b4dfa94ff50a02b6fd12de80b089d5

See more details on using hashes here.

Provenance

The following attestation bundles were made for mng-0.1.0.tar.gz:

Publisher: publish.yml on imbue-ai/mngr

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mng-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: mng-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 432.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for mng-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 577503cb6a36fee82e04dc332b22dc42a54408ac0fe332e323936618e920788f
MD5 abffb6564ef5acb766929f67fa7a9a0e
BLAKE2b-256 57992747ff68edc175bee17772ef06aeaa25b2a648a20fb011bfc500c47b8f53

See more details on using hashes here.

Provenance

The following attestation bundles were made for mng-0.1.0-py3-none-any.whl:

Publisher: publish.yml on imbue-ai/mngr

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page