Skip to main content

Library for managing AI coding agents across different hosts

Project description

mngr: build your team of AI engineering agents

GitHub Stars PyPI Python 3.11+ License: MIT Open Issues

Spin up isolated AI coding agents

Built on SSH, git, and tmux. Extensible via plugins. No managed service required.

Why mngr? Most agent tooling is a managed cloud: opaque infrastructure, per-seat pricing, hard to script. mngr takes the opposite approach. Agents run in isolated containers you own, over SSH you can inspect, on compute that shuts down when idle. It's built on primitives you already know (SSH, git, tmux, docker) and extensible via plugins for anything you need on top.


installation:

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

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.

%%{init: {'theme': 'base', 'themeVariables': {'primaryColor': '#EFF6FF', 'primaryTextColor': '#1E3A5F', 'primaryBorderColor': '#3B82F6', 'lineColor': '#64748B', 'edgeLabelBackground': '#FFFFFF', 'fontSize': '15px'}}}%%
flowchart LR
    classDef user fill:#DBEAFE,stroke:#2563EB,stroke-width:2px,color:#1E3A5F,font-weight:bold
    classDef cli fill:#1E3A5F,stroke:#1E3A5F,stroke-width:2px,color:#FFFFFF,font-weight:bold
    classDef agent fill:#D1FAE5,stroke:#059669,stroke-width:2px,color:#064E3B
    classDef host fill:#FEF3C7,stroke:#D97706,stroke-width:2px,color:#78350F
    classDef repo fill:#EDE9FE,stroke:#7C3AED,stroke-width:2px,color:#4C1D95

    user([You]):::user
    cli[mngr CLI]:::cli
    agent["Agent (Claude · Codex · OpenCode)"]:::agent
    host["Isolated Host (local · Modal · Docker)"]:::host
    codebase[(Your Codebase)]:::repo

    user -->|"create / message / exec"| cli
    cli -->|spawns| agent
    agent -->|runs in| host
    host <-->|"git · SSH · rsync"| codebase
    cli <-->|"connect · transcript · pull"| host

What mngr can do

  • Simple — one command launches an agent locally or on Modal; sensible defaults throughout
  • Fast — agents start in under 2 seconds
  • Cost-transparent — free CLI; agents auto-shutdown when idle; pay only for inference and compute
  • Secure — SSH key isolation, network allowlists, full container control
  • Composable — shared hosts, snapshot and fork agent state, direct exec, push/pull/pair
  • Observable — transcripts, direct SSH, programmatic messaging
  • Easy to learnmngr ask answers usage questions without leaving the terminal

mngr is very simple to use:

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

# send an initial message so you don't have to wait around:
mngr create --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 my-task@.modal --type claude

# 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 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.166s

mngr 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 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@.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 @.modal -b offline

# or restrict outgoing traffic to certain IPs
mngr create @.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@shared-host.modal --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 doomed-agent@.modal
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 $SNAPSHOT

mngr 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-1

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 @.modal -b "--file path/to/Dockerfile"

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 imbue-mngr

# or run without installing
uvx --from imbue-mngr mngr

Upgrade:

uv tool upgrade imbue-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, 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 imbue-mngr python3 -m imbue.mngr.cli.complete --script zsh >> ~/.zshrc

Bash (run once):

uv tool run --from imbue-mngr python3 -m imbue.mngr.cli.complete --script bash >> ~/.bashrc

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

Commands

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

# if installed:
mngr <command> [options]

For managing agents:

  • 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

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
  • transcript: View the message transcript for 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
  • events: View agent and host event files
  • 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 (--provider modal) or Docker containers (--provider docker). Use the agent@host address syntax 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
%%{init: {'theme': 'base', 'themeVariables': {'primaryColor': '#EFF6FF', 'primaryTextColor': '#1E3A5F', 'primaryBorderColor': '#3B82F6', 'lineColor': '#64748B', 'edgeLabelBackground': '#FFFFFF', 'fontSize': '15px'}}}%%
flowchart TB
    classDef transport fill:#DBEAFE,stroke:#2563EB,stroke-width:2px,color:#1E3A5F,font-weight:bold
    classDef session fill:#FEF3C7,stroke:#D97706,stroke-width:2px,color:#78350F
    classDef agent fill:#D1FAE5,stroke:#059669,stroke-width:2px,color:#064E3B
    classDef storage fill:#EDE9FE,stroke:#7C3AED,stroke-width:2px,color:#4C1D95

    ssh["SSH (any SSH-accessible machine)"]:::transport

    subgraph HOST["Host"]
        subgraph TMUX["tmux session: mngr-name"]
            w0["window 0 → agent process"]:::agent
            w1["window 1+ (optional)"]:::session
        end
        dir["$MNGR_HOST_DIR/agents/id/ · status · logs · config"]:::storage
    end

    ssh --> HOST
    w0 -->|writes| dir

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 our security model for more details.

Sub-projects

This is a monorepo that contains the code for mngr 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/minds: an experimental project around scheduling runs of autonomous agents

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

imbue_mngr-0.2.1.tar.gz (871.5 kB view details)

Uploaded Source

Built Distribution

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

imbue_mngr-0.2.1-py3-none-any.whl (507.0 kB view details)

Uploaded Python 3

File details

Details for the file imbue_mngr-0.2.1.tar.gz.

File metadata

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

File hashes

Hashes for imbue_mngr-0.2.1.tar.gz
Algorithm Hash digest
SHA256 856615c8ea6f8761058a20c01cc31f8216821d1ffc3c9d6fa67e8be6e4363898
MD5 c62baf74429fb34c2eeaae9be0e117b2
BLAKE2b-256 51b34d6630d2c6e50f4e292d18e87ebecd070fb4cfd2c14774ebc614e1b25908

See more details on using hashes here.

Provenance

The following attestation bundles were made for imbue_mngr-0.2.1.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 imbue_mngr-0.2.1-py3-none-any.whl.

File metadata

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

File hashes

Hashes for imbue_mngr-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 265be6d49f03bc5faf50078cf339935ae7bdb3cad83820104c8adac43c007bfa
MD5 43feb7aa251710f053022ab2e39ff3ec
BLAKE2b-256 07fe9d19e3ef513fa94c5c7e90eb4910639f950fd546c4eb823e2a555a67672a

See more details on using hashes here.

Provenance

The following attestation bundles were made for imbue_mngr-0.2.1-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