A tool for initializing projects with Cursor agent capabilities
Project description
Devin.cursorrules
Transform your $20 Cursor/Windsurf into a Devin-like experience in one minute! This repository contains configuration files and tools that enhance your Cursor or Windsurf IDE with advanced agentic AI capabilities similar to Devin, including:
- Process planning and self-evolution
- Extended tool usage (web browsing, search, LLM-powered analysis)
- Automated execution (for Windsurf in Docker containers)
Installation
You can install cursor-agent using pip:
# Install from PyPI
pip install cursor-agent
# Initialize in current directory
cursor-agent
# Or specify a target directory
cursor-agent /path/to/project
Using Docker
You can also run cursor-agent using Docker:
# Using docker directly
docker run -v $(pwd):/workspace -e OPENAI_API_KEY=your_key cursor-agent /workspace
# Or using docker-compose
export TARGET_DIR=$(pwd) # Directory to initialize
export OPENAI_API_KEY=your_key # Your API keys
docker-compose up
Available environment variables:
TARGET_DIR: Directory to initialize (default: current directory)OPENAI_API_KEY: OpenAI API keyANTHROPIC_API_KEY: Anthropic API keyDEEPSEEK_API_KEY: DeepSeek API keyGOOGLE_API_KEY: Google API key
Staying Updated
To get the latest version:
# Check and update to latest version
python -m cursor_agent.update
# Force update even if current version is up to date
python -m cursor_agent.update --force
Quick Start
The easiest way to add Cursor agent capabilities to your project is using the initialization script:
# Initialize in current directory
python init_cursor_agent.py
# Or specify a target directory
python init_cursor_agent.py /path/to/project
# Force overwrite existing files (creates backups)
python init_cursor_agent.py --force
# Skip virtual environment creation
python init_cursor_agent.py --skip-venv
The script will:
- Copy necessary configuration files
- Set up Python virtual environment
- Install required dependencies
- Configure environment variables
Manual Setup
If you prefer manual setup, follow these steps:
- Create Python virtual environment:
# Create a virtual environment in ./venv
python3 -m venv venv
# Activate the virtual environment
# On Unix/macOS:
source venv/bin/activate
# On Windows:
.\venv\Scripts\activate
- Configure environment variables:
# Copy the example environment file
cp .env.example .env
# Edit .env with your API keys and configurations
- Install dependencies:
# Install required packages
pip install -r requirements.txt
# Install Playwright's Chromium browser (required for web scraping)
python -m playwright install chromium
Tools Included
- Web scraping with JavaScript support (using Playwright)
- Search engine integration (DuckDuckGo)
- LLM-powered text analysis
- Process planning and self-reflection capabilities
Command-line Tools
After installation, the following command-line tools are available:
-
cursor-agent: Initialize a directory with Cursor agent capabilitiescursor-agent [directory]
-
cursor-llm: Interact with various LLM providerscursor-llm --prompt "Your prompt" --provider "anthropic" # Supported providers: OpenAI (default), DeepSeek, Anthropic, Gemini, Local LLM
-
cursor-scrape: Web scraping with JavaScript supportcursor-scrape --max-concurrent 3 URL1 URL2 URL3
-
cursor-search: Search engine integrationcursor-search "your search keywords"
-
cursor-update: Update cursor-agent to latest versioncursor-update cursor-update --force # Force update
-
cursor-verify: Verify setup and dependenciescursor-verify
Development
Running Tests
The project uses pytest for testing. To run tests:
# Install test dependencies
pip install pytest pytest-cov
# Run all tests with coverage
pytest
# Run specific test file
pytest tests/test_init_cursor_agent.py
# Run tests excluding slow ones
pytest -m "not slow"
# Run only unit tests
pytest -m unit
Continuous Integration
The project uses GitHub Actions for continuous integration, running tests on:
- Multiple Python versions (3.8, 3.9, 3.10, 3.11)
- Multiple operating systems (Ubuntu, Windows, macOS)
The CI pipeline:
- Runs all tests
- Generates coverage reports
- Uploads coverage to Codecov
- Fails if coverage drops below threshold
Changelog
The project uses automated changelog generation based on conventional commits.
-
Commit Message Format:
type(scope): description [optional body] [optional footer]Types:
feat: New featurefix: Bug fixdocs: Documentationstyle: Formattingrefactor: Code restructuringperf: Performance improvementtest: Testsbuild: Build systemci: CI/CDchore: Maintenance
-
Generate Changelog:
# Preview changelog python tools/generate_changelog.py # Update CHANGELOG.md python tools/generate_changelog.py --update # Specify version python tools/generate_changelog.py --version v1.0.0
-
Automated Generation:
- Changelog is automatically generated on new releases
- Generated from commits since last tag
- Categorized by commit type
- Included in GitHub release notes
Deployment
The project supports multiple deployment methods:
-
PyPI Package:
# Install latest release pip install cursor-agent # Install specific version pip install cursor-agent==1.0.0
-
Docker Container:
# Build locally docker build -t cursor-agent . # Run with volume mount docker run -v /path/to/project:/workspace cursor-agent
-
Manual Setup:
git clone https://github.com/grapeot/devin.cursorrules.git cd devin.cursorrules python init_cursor_agent.py /path/to/project
Contributing
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Run tests locally (
pytest) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
Background
For detailed information about the motivation and technical details behind this project, check out the blog post: Turning $20 into $500 - Transforming Cursor into Devin in One Hour
License
MIT License
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file cursor_agent-0.1.4.tar.gz.
File metadata
- Download URL: cursor_agent-0.1.4.tar.gz
- Upload date:
- Size: 24.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.11.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
934632206049a2abc42af002a761b62f3c11f905a819bfa09dc019893abfc59c
|
|
| MD5 |
38c951a989d814e4037cb58a51168367
|
|
| BLAKE2b-256 |
97652567dd3ce89e328032d3a39434620251949447e3753b41acfad96ed2fea0
|
File details
Details for the file cursor_agent-0.1.4-py3-none-any.whl.
File metadata
- Download URL: cursor_agent-0.1.4-py3-none-any.whl
- Upload date:
- Size: 21.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.11.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
148477720205e9db70bb06e80a83aa8feb39cfd85832cae83a110f34ccbf3c4f
|
|
| MD5 |
576fe650e7b65ac0b622029279457ed0
|
|
| BLAKE2b-256 |
6c6ca8932e6bcb194c1b24d5d0144934f96bb1c1e535ab5a7a3299b77f4ee190
|