A Docker container that provides an isolated environment for running Cursor AI agent commands. This sandbox allows you to execute Cursor AI tasks without installing Cursor locally, making it perfect for CI/CD pipelines, automated workflows, or isolated development environments.
- Isolated Environment: Run Cursor AI commands in a clean, isolated Docker container
- Pre-configured Tools: Includes Cursor CLI, GitHub CLI (gh), and essential utilities (jq, curl, wget, git, zip, dos2unix)
- Easy to Use: Simple Docker command or alias to execute Cursor AI tasks
- Flexible Configuration: Support for environment variables for API keys and tokens
- Cross-platform: Built for Linux/amd64 architecture
- Automated Setup: Pre-configured with all necessary dependencies
- Docker installed and running on your system
- Cursor API key (required for using Cursor AI features)
- Optional: GitHub token (if you need to interact with GitHub repositories)
docker build --platform="linux/amd64" -t frkr/cursor-sandbox .For easier usage, add this alias to your shell configuration file (.bashrc, .zshrc, etc.):
alias cr='docker run --rm -e CURSOR_API_KEY=$CURSOR_API_KEY -v "$PWD:/work" frkr/cursor-sandbox'After adding the alias, reload your shell configuration:
source ~/.bashrc # or source ~/.zshrcRun a Cursor AI command directly:
docker run -e CURSOR_API_KEY=$CURSOR_API_KEY -v "$PWD:/work" frkr/cursor-sandbox "your command here"If you've set up the alias, you can use it more simply:
cr "update readme.md with features and how to use it following github readme best practices"If you need GitHub CLI functionality:
docker run -e CURSOR_API_KEY=$CURSOR_API_KEY -e GH_TOKEN=$GH_TOKEN -v "$PWD:/work" frkr/cursor-sandbox "your command here"The container mounts your current directory to /work inside the container, so all your files are accessible:
# From your project directory
docker run -e CURSOR_API_KEY=$CURSOR_API_KEY -v "$PWD:/work" frkr/cursor-sandbox "describe the files in this project"CURSOR_API_KEY(required): Your Cursor API key for authenticationGH_TOKEN(optional): GitHub token for GitHub CLI operations
The container runs with these default parameters:
- Model:
auto(automatically selects the best model) - Output format:
text - Force mode: enabled
- Prompt mode: enabled
cr "update readme.md with features and how to use it following github readme best practices"cr "analyze the code structure and suggest improvements"cr "create a new Python function to calculate fibonacci numbers"cr "describe the files in /work"- The Docker container is built from Ubuntu 24.04
- Cursor CLI and GitHub CLI are installed during the build process
- When you run the container, it executes the
cursor-agentcommand with your provided instruction - Your local directory is mounted to
/workinside the container - The Cursor AI agent processes your command and returns the results
If you encounter permission issues, ensure Docker has the necessary permissions to access your files.
Make sure your CURSOR_API_KEY environment variable is set:
export CURSOR_API_KEY=your_api_key_hereCheck if Docker is running:
docker psThis project is licensed under the MIT License - see the LICENSE file for details.
Contributions are welcome! Please feel free to submit a Pull Request.
Davi Saranszky Mesquita