Skip to content

cpltbox

Run GitHub Copilot CLI against any repository through a controlled HTTP interface.

A Cloudflare Worker receives a repository URL and task, checks out the code inside an isolated Linux sandbox, runs Copilot CLI in headless mode, and returns the agent logs plus the resulting git diff. This gives you a repeatable, API-driven way to run coding tasks while keeping secrets out of the image, limiting network access, and making each result reviewable before anything is merged.

Built on Cloudflare’s Workers Sandbox SDK for running containerized workloads inside Workers.

Terminal window
npm install
cp .env.example .env # add GH_TOKEN and SANDBOX_ENABLE_INTERNET
npm run dev

Send a task:

Terminal window
curl -X POST http://localhost:8787/ \
-H 'Content-Type: application/json' \
-d '{
"repo": "https://github.com/owner/repo",
"task": "Fix the typo in README.md"
}'

Response:

{
"success": true,
"exitCode": 0,
"logs": "...",
"stderr": "",
"diff": "diff --git a/README.md b/README.md ..."
}

Extract and view the diff:

Terminal window
curl -s ... | jq -r '.diff' # view diff
curl -s ... | jq -r '.diff' > fix.patch # save to file, then: git apply fix.patch

Use /stream for live output on longer tasks.

FieldRequiredDescription
repoyesGitHub repository URL (https://github.com/owner/repo)
taskyesWhat to do (max 8000 chars)
modelnoCopilot model identifier
prdTextnoInline PRD context (max 50000 chars)
prdPathnoRepo-relative path to a PRD file
skillPathsnoRepo-relative skill files to read and follow
mcpConfignoMCP server configuration (see docs)

See the how-to guide for local development, streaming, model selection, PRD and skill usage, deployment, and troubleshooting. Example PRD files are in docs/.

Read why cpltbox for design rationale, tradeoffs, and project goals.

For shell helpers, see scripts/READM.md in the scripts/ folder (cpltbox.sh and ralph.sh).

For quick testing, see HTTP clients for options like REST Client, Bruno, Postman, or HTTPie. The requests.http file has ready-to-use examples.

  • GitHub token is never baked into the Docker image.
  • GH_TOKEN is passed only as per-command environment variables.
  • Copilot runs in non-interactive mode: copilot -p ... --allow-all.
  • Repository URLs, task length, and shell arguments are validated.
  • The sandbox disables broad internet and allowlists GitHub/Copilot hosts only.

MIT License. Copyright (c) 2026 Per Søderlind.

Assisted-by: GitHub Copilot:GPT-5.5