Skip to main content

An AI-powered code agent for workspace operations

Project description

OpenCursor

An AI-powered code agent for workspace operations.

Features

  • Chat with an AI coding agent in autonomous or interactive mode
  • Direct LLM chat without tools
  • File context management (add, drop, clear)
  • Repository mapping
  • Focus on specific files
  • Workspace directory selection

Installation

Using Poetry (recommended)

# Clone the repository
git clone https://github.com/yourusername/opencursor.git
cd opencursor

# Install with Poetry
poetry install

Using pip

pip install git+https://github.com/yourusername/opencursor.git

Usage

Once installed, you can use OpenCursor from the command line:

# Basic usage
opencursor -q "Create a simple Flask app"

# Specify a workspace directory
opencursor -w /path/to/workspace -q "Fix the bug in app.py"

# Use a different model
opencursor -m "gpt-4" -q "Refactor the authentication module"

# Run in interactive mode
opencursor -i -q "Create a React component"

Command-line Options

  • -w, --workspace: Path to the workspace directory (default: current directory)
  • -q, --query: Query to process (required)
  • -m, --model: LLM model to use (default: qwen3_14b_q6k:latest)
  • -H, --host: Ollama API host URL (default: http://192.168.170.76:11434)
  • -i, --interactive: Run in interactive mode (one tool call at a time)

Development

Setup

# Clone the repository
git clone https://github.com/yourusername/opencursor.git
cd opencursor

# Install dependencies
poetry install

# Run tests
poetry run pytest

Project Structure

opencursor/
├── code_agent/
│   ├── src/
│   │   ├── agent.py      # Main agent implementation
│   │   ├── llm.py        # LLM client
│   │   ├── prompts.py    # System prompts
│   │   ├── tools.py      # Tool implementations
│   │   └── ...
│   ├── cli.py            # Command-line interface
│   └── __init__.py
├── tests/
├── pyproject.toml
└── README.md

License

MIT

UI Components

  • Chat History: Shows the conversation between you and the AI
  • Message Input: Type your messages here
  • Tool Selection: Choose which tool to use for processing your message
  • Workspace Path: Set the directory to work with
  • Context Information: Shows which files are currently in context
  • Update Context: Refreshes the context information
  • Clear Chat: Clears the chat history

Available Tools

  • agent (autonomous): Agent works step-by-step without user interaction
  • agent (interactive): Agent performs one tool call at a time, waiting for user input
  • chat (LLM only): Chat with the LLM directly without using tools
  • add file: Add a file to the context (provide file path in message)
  • drop file: Remove a file from the context (provide file path in message)
  • clear context: Remove all files from the context
  • repo map: Show the files in the current workspace
  • focus on file: Add a file to context and show its contents

Customization

You can modify the model and host settings in the main() function of gradio_ui.py.

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

opencursor-0.0.9.tar.gz (24.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

opencursor-0.0.9-py3-none-any.whl (26.6 kB view details)

Uploaded Python 3

File details

Details for the file opencursor-0.0.9.tar.gz.

File metadata

  • Download URL: opencursor-0.0.9.tar.gz
  • Upload date:
  • Size: 24.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.12 CPython/3.10.12 Linux/6.8.0-59-generic

File hashes

Hashes for opencursor-0.0.9.tar.gz
Algorithm Hash digest
SHA256 0c2f222061cae96785ac57be9599f76a97dfa5746b5fca1e80e578f21d786e3a
MD5 c206247d6b7d0225370ab3ea48ac900c
BLAKE2b-256 e0f94b5e60d7e7bc234b47636a947e0ef3162f448621b605f51328e75c9a9e8d

See more details on using hashes here.

File details

Details for the file opencursor-0.0.9-py3-none-any.whl.

File metadata

  • Download URL: opencursor-0.0.9-py3-none-any.whl
  • Upload date:
  • Size: 26.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.12 CPython/3.10.12 Linux/6.8.0-59-generic

File hashes

Hashes for opencursor-0.0.9-py3-none-any.whl
Algorithm Hash digest
SHA256 bfc0a34e9cfb63b875a4860d1f880ccb2819a029bfba72b5f815c770349eb254
MD5 b42e5a244f99b39c2018c3387dfd9dff
BLAKE2b-256 fe3c608b085c11f130c1e440c1bfb8f73b423a4289cb1d40934c71afb384f5b6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page