Skip to main content

Runs agentic coding assistants in docker containers

Project description

aicage

Run your favorite AI coding agents comfortably in Docker.

Why use aicage?

Agents need deep access (read code, run shells, install deps). Their built-in safety checks are naturally limited.

Running agents in containers gives a hard boundary - while the experience stays the same. See Why cage agents? for the full rationale.

First-time quick start

  • Prerequisites:

    • Docker
    • Python 3.10+ and pipx
  • Install:

    pipx install aicage
    
  • Navigate to your project directory and run:

    aicage --yes <agent>
    

--yes accepts suggested defaults and skips setup prompts. This is the fastest first run.

  • Built-in agent examples:

    aicage --yes claude
    aicage --yes codex
    aicage --yes copilot
    aicage --yes crush
    aicage --yes droid
    aicage --yes gemini
    aicage --yes goose
    aicage --yes opencode
    aicage --yes qwen
    

Example output of first run with agent codex:

Example output of first run with agent codex

Full setup (optional)

If you want full interactive setup instead of defaults:

  1. Show project config path and contents:

    aicage --config info
    
  2. Remove config if needed:

    aicage --config remove
    aicage --config remove <agent>
    
  3. Run again without --yes:

    aicage <agent>
    

Example output of full setup prompt flow:

Example output of full setup prompt flow

Full documentation

The complete user documentation lives in the wiki: aicage.wiki

Common scenarios

  • Pass arguments to the agent:
    • aicage <agent> resume <session-id>
  • Share additional host folders:
    • aicage --share ~/.m2 <agent>
    • aicage --share /path/to/data:ro <agent>
    • Extensions can also define extra shares (host mounts).
  • Let the agent use Docker:
    • aicage --docker <agent>
  • Set environment variables:
    • aicage -e FOO=bar -- <agent>
  • Use proxies:
    • aicage forwards HTTP_PROXY, HTTPS_PROXY, ALL_PROXY, and NO_PROXY.
    • See CLI options.
  • Use host networking or custom networks:
  • On Windows with a Linux container/WSL workspace:
    • set git config --global core.autocrlf true on the Windows host to avoid line-ending diffs.
  • Run into first-use setup issues:
  • Add custom tools/agents/base images:

Built-in agents

CLI Agent Homepage
claude Claude Code https://claude.com/product/claude-code
codex Codex CLI https://developers.openai.com/codex/cli
copilot GitHub Copilot CLI https://github.com/features/copilot/cli
crush Crush https://github.com/charmbracelet/crush
droid Factory CLI https://factory.ai/product/cli
gemini Gemini CLI https://geminicli.com
goose Goose CLI https://block.github.io/goose
opencode OpenCode https://opencode.ai
qwen Qwen Code https://qwenlm.github.io/qwen-code-docs

Your existing CLI config for each agent is mounted inside the container so you can keep using your preferences and credentials.

Customization

aicage lets you customize images at three levels: extensions, agents, and base images. The sample repo is a fast way to see working examples and copy a template.

Quick start:

git clone https://github.com/aicage/aicage-custom-samples.git $HOME/.aicage-custom

Then run any agent:

aicage <agent>

These are only samples. Use them to learn the structure, then replace or edit them with your own definitions. aicage detects whatever you place under ~/.aicage-custom and offers it during selection. Extensions can install tools and request additional host mounts.

After adding or changing custom definitions, restart aicage.

If your project is already configured for an agent, aicage will keep using the saved config. To reconfigure (and see new bases/agents/extensions), run aicage --config remove and start aicage again. To reset only one agent entry, use aicage --config remove <agent>. Use aicage --config to inspect the current config.

Image updates are handled automatically; see Updates.

aicage options

  • --dry-run prints the composed docker run command without executing it.
  • -y, --yes applies default answers for all prompts and suppresses prompt output.
  • --docker mounts /run/docker.sock into the container to enable Docker-in-Docker workflows.
  • --share <path> mounts a host path into the container at the same path. Repeatable; add :ro for read-only.
  • Extensions can also request grouped host mounts during setup.
  • --config prints the project config path and its contents.
  • --config remove [<agent>] removes the full project config or only one agent entry.

Configuration file formats are documented in CONFIG.md. Extension authoring is documented in doc/extensions.md.

Why cage agents?

AI coding agents read your code, run shells, install packages, and edit files. That power is useful, but granting it directly on the host expands your risk surface.

Where built-in safety is limited:

  • Allow/deny lists only cover known patterns; unexpected commands or attack paths can slip through.
  • Some agents work fully only after relaxing their own safety modes, broadening what they can touch.
  • “Read-only project” features are software rules. Other projects and files still sit alongside them on the same host.

How aicage mitigates this:

  • Containers create a hard boundary: the agent can access only what you explicitly mount. Day-to-day use stays familiar—just with the host kept out of reach.

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

aicage-1.1.0.tar.gz (55.3 kB view details)

Uploaded Source

Built Distribution

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

aicage-1.1.0-py3-none-any.whl (120.8 kB view details)

Uploaded Python 3

File details

Details for the file aicage-1.1.0.tar.gz.

File metadata

  • Download URL: aicage-1.1.0.tar.gz
  • Upload date:
  • Size: 55.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for aicage-1.1.0.tar.gz
Algorithm Hash digest
SHA256 1f7e59c0c0761d74e7755961e3bd27c15022f59bc0847f4fefb96b72c526d909
MD5 ace91097f44a4ecf779b956f8bf1ea94
BLAKE2b-256 968ecc69ec968b8478f6c14d3fedfacad683efee246270594d565c444ee52e0e

See more details on using hashes here.

Provenance

The following attestation bundles were made for aicage-1.1.0.tar.gz:

Publisher: release.yml on aicage/aicage

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

File details

Details for the file aicage-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: aicage-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 120.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for aicage-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a3122c3910cc1b8eb09ba6670e3c0d713c7858f4bda19d6a3d7998465c75c137
MD5 91ccd76615ca19b642b3b6943c8cae26
BLAKE2b-256 2a5f3f7bca89323eae1071e06eba005548fcd9cc18b91db3434de6e887190d1d

See more details on using hashes here.

Provenance

The following attestation bundles were made for aicage-1.1.0-py3-none-any.whl:

Publisher: release.yml on aicage/aicage

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