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 🙏

© 2025 – Pkg Stats / Ryan Hefner

docker-cursor-agent

v0.0.1

Published

Docker wrapper for Cursor CLI

Readme

Docker Cursor Agent

A Docker wrapper for Cursor CLI that allows you to run cursor-agent commands inside a container.

Overview

This project provides a Docker container that wraps the Cursor CLI, allowing you to execute cursor-agent commands as if it were a native binary. The container acts as a transparent wrapper, passing all arguments through to the cursor-agent binary.

Prerequisites

  • Docker installed and running
  • Bun runtime (for development)
  • gh CLI installed and authenticated (required for local deployment)
  • CURSOR_API_KEY environment variable set (required for testing)

Installation

Build the Docker Image

# Using npm script
bun run build

# Or directly with Docker
docker build -t docker-cursor-agent .

The image is based on debian:stable-slim and optimized for size (~291MB).

Pull from GHCR

docker pull ghcr.io/circlesac/docker-cursor-agent:latest

Usage

MCP Config Generator CLI

This package includes a CLI tool to generate cursor-agent MCP configuration files from an mcp.json file.

Installation

# Install globally
npm install -g docker-cursor-agent

# Or use with npx (no installation needed)
npx docker-cursor-agent --file <mcp.json> --out <output-dir>

Usage

# Generate MCP config from mcp.json
npx docker-cursor-agent --file ./mcp.json --out ./build

# This creates:
# ./build/.cursor/mcp.json
# ./build/.cursor/projects/workspace/mcp-approvals.json

Options

  • --file, -f - Path to input mcp.json file (required)
  • --out, -o - Output directory where .cursor folder will be created (required, defaults to current directory)

Example with Docker

After generating the config files, use them with the Docker container:

docker run --rm \
  -e CURSOR_API_KEY=your_key \
  -v $(pwd)/build/.cursor:/root/.cursor \
  ghcr.io/circlesac/docker-cursor-agent:latest \
  --print --output-format stream-json "your prompt"

Docker Container Usage

Basic Usage

Run cursor-agent commands through Docker:

# Using the published image from GHCR
docker run --rm -e CURSOR_API_KEY=your_key ghcr.io/circlesac/docker-cursor-agent:latest --version
docker run --rm -e CURSOR_API_KEY=your_key ghcr.io/circlesac/docker-cursor-agent:latest --help

# Or using locally built image
docker run --rm -e CURSOR_API_KEY=your_key docker-cursor-agent --version

Passing Arguments

All arguments are passed through to cursor-agent:

# Using published image
docker run --rm -e CURSOR_API_KEY=your_key ghcr.io/circlesac/docker-cursor-agent:latest <your-args>

# Or using locally built image
docker run --rm -e CURSOR_API_KEY=your_key docker-cursor-agent <your-args>

Environment Variables

  • CURSOR_API_KEY - Required for cursor-agent to function (pass via -e flag)

Development

Setup

bun install

Build

# Build TypeScript source code
bun run build

# Build Docker image
bun run build:docker

The build script compiles TypeScript source to JavaScript in the dist/ directory. The build:docker script builds the Docker image locally.

Run Tests

bun run test

Note: Tests require CURSOR_API_KEY to be set in your environment. Tests will fail if it's not present.

Lint

bun run lint

Deploy to GHCR

Deploy the Docker image to GitHub Container Registry:

# Deploy using TypeScript script (recommended for production)
bun run deploy

# Or test deployment locally using act (requires act installed)
bun run deploy:act

The deploy script will:

  1. Get authentication token (from GITHUB_TOKEN, GHCR_TOKEN, or gh CLI)
  2. Extract repository info from git remote
  3. Build Docker image
  4. Push to ghcr.io/circlesac/docker-cursor-agent:latest

Published Image: The image is available at ghcr.io/circlesac/docker-cursor-agent:latest

Note: deploy:act uses act to test the GitHub Actions workflow locally. It passes GITHUB_TOKEN directly to act using gh auth token.

Environment Variables for Deploy

  • GITHUB_TOKEN - Auto-provided in GitHub Actions (has GHCR permissions)
  • GHCR_TOKEN - Optional override for local deployment
  • GHCR_TAG - Optional image tag (defaults to latest)
  • GITHUB_ACTOR - Optional username for login (defaults to repo owner)

Local Deployment

For local deployment, ensure you have gh CLI authenticated:

gh auth login --scopes write:packages

Or set GHCR_TOKEN environment variable:

export GHCR_TOKEN=your_token
bun run deploy

Project Structure

docker-cursor-agent/
├── .dockerignore         # Docker ignore patterns
├── .github/
│   └── workflows/
│       └── deploy.yml    # GitHub Actions workflow for automated deployment
├── .gitignore           # Git ignore patterns
├── Dockerfile            # Debian-based container definition
├── package.json          # Bun project configuration
├── README.md             # This file
├── src/
│   ├── cli.ts            # CLI entry point
│   └── utils.ts          # MCP config processing utilities
├── scripts/
│   └── deploy.ts          # Deployment script to GHCR
├── tests/
│   ├── cli.test.ts       # CLI tests
│   └── docker.test.ts    # Docker tests
├── tsconfig.json         # TypeScript configuration (base)
├── tsconfig.build.json   # TypeScript build configuration
└── vitest.config.ts      # Vitest configuration