npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@cjradek/copilot-sandbox

v0.2.0

Published

A CLI tool for running coding agents inside isolated dev containers on git worktrees

Downloads

56

Readme

copilot-sandbox

A standalone CLI tool for running coding agents inside isolated dev containers on git worktrees. This keeps agents from modifying your main working tree — all changes happen in a disposable worktree+container sandbox.

Prerequisites

  • Git
  • Node.js 18+
  • Docker installed and running
  • GitHub CLI (gh) installed and authenticated (for automatic token forwarding)
  • A .devcontainer/devcontainer.json in the target project (optional — a default config will be used if missing)

Installation

# Run directly with npx
npx @cjradek/copilot-sandbox --help

# Or install globally
npm install -g @cjradek/copilot-sandbox

From source

git clone https://github.com/chrisradek/copilot-sandbox.git
cd copilot-sandbox
npm install
npm run build

Usage

# Spin up a sandbox with an interactive copilot session
copilot-sandbox up --dir /path/to/your/project

# Or run a non-interactive task
copilot-sandbox up --dir /path/to/your/project --task "Fix the login bug"

# Reconnect to an existing sandbox
copilot-sandbox exec --branch sandbox/2026-02-07T04-30-00

# List active sandboxes
copilot-sandbox list

# Tear down a sandbox when done
copilot-sandbox down --branch sandbox/2026-02-07T04-30-00

Commands

copilot-sandbox init

Sets up the MCP server config and orchestrator agent for a project or user scope.

| Flag | Default | Description | |---|---|---| | --scope <repo\|user> | repo | Where to install (repo-level or user-level) | | --dir <path> | Current directory | Target directory (used with --scope repo) | | --force | — | Overwrite existing files (useful for upgrading) |

copilot-sandbox up

Creates a git worktree, starts a dev container, and runs copilot inside it.

| Flag | Default | Description | |---|---|---| | --branch <name> | Auto-generated (sandbox/<timestamp>) | Branch name for the worktree | | --base <ref> | HEAD | Base ref to branch from | | --dir <path> | Current directory | Path to the git repo | | --task <description> | — | Run copilot non-interactively with this task | | --interactive | Default when no --task | Start an interactive copilot session | | --worktree-dir <path> | ../<repo>-worktrees/ | Where to create worktrees | | --verbose | — | Stream devcontainer setup logs in real time |

copilot-sandbox exec

Reconnects to an existing sandbox (ensures container is running, then launches copilot).

| Flag | Default | Description | |---|---|---| | --branch <name> | required | Branch/worktree to reconnect to | | --dir <path> | Current directory | Path to the git repo | | --task <description> | — | Run copilot non-interactively with this task | | --session-id <id> | — | Resume a specific copilot session by ID | | --interactive | Default when no --task | Start an interactive copilot session | | --verbose | — | Stream devcontainer setup logs in real time |

copilot-sandbox down

Stops the container and removes the worktree and branch.

| Flag | Default | Description | |---|---|---| | --branch <name> | required | Branch/worktree to tear down | | --dir <path> | Current directory | Path to the git repo |

copilot-sandbox list

Lists all active sandbox worktrees.

| Flag | Default | Description | |---|---|---| | --dir <path> | Current directory | Path to the git repo |

MCP Server

The package provides two MCP servers as separate binaries:

  • copilot-sandbox-mcp — Sandbox management, orchestration, and task tracking tools
  • issue-tracker-mcp — Issue tracking tools (create, list, get, update, import)

Configuration

Running copilot-sandbox init configures the MCP server automatically. To manually configure, add to your mcp-config.json:

{
  "mcpServers": {
    "copilot-sandbox": {
      "type": "stdio",
      "command": "npx",
      "args": ["-y", "-p", "@cjradek/copilot-sandbox@latest", "copilot-sandbox-mcp"]
    }
  }
}

How It Works

  1. Worktree creation — Creates a new git worktree and branch from the specified base ref, isolating changes from your main working tree.
  2. Default config — If no .devcontainer/devcontainer.json exists, a default config is created automatically.
  3. Auth forwarding — Automatically runs gh auth token on the host and passes the token as GH_TOKEN into the container, so copilot is pre-authenticated.
  4. Container startup — Uses the @devcontainers/cli to spin up a dev container using the project's .devcontainer/devcontainer.json. The main .git directory is bind-mounted so git operations work inside the container.
  5. Agent execution — Runs copilot inside the container, either interactively or with a specified task.
  6. Cleanupcopilot-sandbox down stops the container, removes the worktree, and deletes the branch.

Development

npm install
npm run build          # tsc → dist/
npm run dev            # tsc --watch

Project Structure

src/
├── cli.ts          # CLI entry point & arg parsing
├── container.ts    # Dev container lifecycle (up, exec, down)
├── init.ts         # Project/user initialization (MCP config + agent setup)
├── issue-mcp.ts    # Issue tracker MCP server entry point
├── issue-store.ts  # Issue data store
├── mcp.ts          # Main MCP server entry point (sandbox + orchestration tools)
├── sandbox.ts      # High-level sandbox operations (up, down, exec, list, merge, diff)
├── store.ts        # Orchestration & task data store
└── worktree.ts     # Git worktree management

License

ISC