Discover and explore top open-source AI tools and projects—updated daily.
mattpocockOrchestrate AI coding agents in isolated Docker environments
New!
Top 60.0% on SourcePulse
This TypeScript library, Sandcastle, enables the orchestration of AI coding agents within isolated Docker containers. It simplifies complex agent workflows by managing worktrees, sandboxing execution, and merging agent-generated commits back to the host repository. Sandcastle is ideal for developers seeking to parallelize AI tasks, build automated code review pipelines, or integrate custom AI agents into their development process, offering a robust and localized execution environment.
How It Works
Sandcastle employs a worktree-based architecture. It creates isolated Git worktrees on the host machine, which are then bind-mounted into Docker containers. This direct host filesystem access means agents write changes immediately to the host, eliminating the need for file synchronization. Commits made by the agent within the worktree are automatically fast-forward merged back to a specified target branch upon completion, and the worktree is cleaned up, providing a seamless integration with standard Git workflows.
Quick Start & Requirements
npm install @ai-hero/sandcastlenpx sandcastle init . to scaffold the .sandcastle/ directory and Docker image.ANTHROPIC_API_KEY) in .sandcastle/.env.npx tsx .sandcastle/main.ts or the programmatic API (import { run } from "@ai-hero/sandcastle").Highlighted Details
run() function for integration into scripts, CI/CD pipelines, and custom tooling, with extensive configuration options for agents, prompts, worktree modes, hooks, and logging.createSandbox() allows multiple agent runs within a single, persistent container and worktree, optimizing performance by avoiding repeated setup costs and maintaining state across runs.!commandexecution within the sandbox, and{{KEY}}placeholder substitution viapromptArgs. Includes built-in {{SOURCE_BRANCH}}and{{TARGET_BRANCH}}` arguments.sandcastle init scaffolds projects using templates like blank, simple-loop, sequential-reviewer, and parallel-planner to accelerate setup for common agent-based workflows.completionSignal (defaulting to <promise>COMPLETE</promise>), allowing for task-based workflows where the agent stops execution once its objective is met.Maintenance & Community
No specific details regarding maintainers, community channels (like Discord/Slack), or roadmap were provided in the README.
Licensing & Compatibility
The project is released under the MIT License, which permits commercial use and integration into closed-source projects without significant restrictions.
Limitations & Caveats
Requires Docker Desktop and Git to be installed and configured. Agent providers necessitate corresponding API keys (e.g., ANTHROPIC_API_KEY). Customizing the Dockerfile requires careful attention to maintain essential dependencies and the non-root user configuration. The sandcastle init command prevents overwriting existing .sandcastle/ configurations, requiring manual merging or deletion for updates.
20 hours ago
Inactive
vercel-labs
dagger
manaflow-ai