A Free Local Personal Coding Agent CLI - Powered by Ollama for autonomous code generation, research, and task execution
Note: XCoder is currently in active development (Alpha stage). Expect breaking changes.
XCoder is a local-first coding agent that runs entirely on your machine using Ollama. It provides capabilities similar to Cursor, Claude Code, and Codex CLI but keeps your code and data completely private and free.
- π 100% Local & Private - All processing happens on your machine
- π Agentic Code Generation - Multi-step autonomous task execution
- π§ Smart Code Understanding - RAG-powered codebase vectorization
- πΎ Persistent Memory - Remembers context across sessions
- π Multi-Agent Roles - Backend, Frontend, DevOps, Testing, and more
- π§ Easy Configuration - Project-specific
.xcoderulesfiles - π¦ Zero External Dependencies - No API keys, no cloud services
- Python 3.11 or higher
- Ollama installed and running
- Docker and Docker Compose (for full setup)
# Clone the repository
git clone https://github.com/yourusername/xcoder.git
cd xcoder
# Create virtual environment
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt
# Install in development mode
pip install -e .# Start all services (vector DB, memory DB, etc.)
docker-compose up -d
# Verify services are running
docker-compose ps# Initialize a project
xcoder init
# Vectorize your codebase
xcoder ragify
# Start coding with AI
xcoder agent
# Check memory
xcoder memory list# Initialize in current directory
xcoder init
# This creates:
# - .xcoderules (project configuration)
# - .xcoder/ (local storage for vectors and memory)# Index entire codebase
xcoder ragify
# Watch for changes and auto-update
xcoder ragify --watch
# Ragify specific directories
xcoder ragify --path src/# Interactive chat mode
xcoder agent
# One-shot task execution
xcoder agent "Create a FastAPI endpoint for user authentication"
# Use specific agent role
xcoder agent --role backend "Add database migration for users table"
# Multi-agent collaboration
xcoder agent --multi "Build a todo app with FastAPI backend and React frontend"# List conversation history
xcoder memory list
# Search memory
xcoder memory search "authentication"
# Export memory
xcoder memory export --format json
# Clear old memories
xcoder memory clear --older-than 30dxcoder/
βββ xcoder/ # Main package
β βββ cli.py # CLI entry point
β βββ agents/ # Agent implementations
β β βββ base.py # Base agent class
β β βββ backend.py # Backend specialist
β β βββ frontend.py # Frontend specialist
β β βββ ...
β βββ rag/ # RAG system
β β βββ vectorizer.py
β β βββ chunker.py
β β βββ retriever.py
β βββ memory/ # Memory system
β β βββ short_term.py
β β βββ long_term.py
β βββ services/ # External service integrations
β β βββ ollama.py # Ollama client
β β βββ vectordb.py # Vector database
β βββ utils/ # Utilities
βββ tests/ # Test suite
βββ docs/ # Documentation
βββ scripts/ # Utility scripts
βββ docker-compose.yml # Service orchestration
Create a .xcoderules file in your project root:
# Project metadata
project:
name: "my-awesome-app"
type: "python"
description: "A FastAPI-based web application"
# Coding standards
standards:
style_guide: "PEP 8"
max_line_length: 100
use_type_hints: true
docstring_style: "google"
# Agent behavior
agents:
default_role: "backend"
auto_test: true
auto_format: true
roles:
backend:
language: "python"
framework: "fastapi"
focus: ["api", "database", "business-logic"]
frontend:
language: "typescript"
framework: "react"
focus: ["ui", "components", "state-management"]
# RAG configuration
rag:
chunk_size: 1000
chunk_overlap: 200
embedding_model: "nomic-embed-text"
# LLM configuration
llm:
default_model: "deepseek-coder:6.7b"
temperature: 0.2
context_window: 8192
# File patterns
ignore:
- "node_modules/**"
- "venv/**"
- "*.pyc"
- ".git/**"
- "dist/**"XCoder comes with pre-built agent roles:
- BackendAgent - Python/FastAPI/Django specialist
- FrontendAgent - React/Vue/HTML/CSS expert
- DatabaseAgent - SQL/ORM/migrations expert
- DevOpsAgent - Docker/CI/CD specialist
- TestingAgent - pytest/unittest expert
- DocumentationAgent - README/API docs writer
- ReviewerAgent - Code review specialist
- DebuggerAgent - Error analysis expert
# Install development dependencies
pip install -e ".[dev]"
# Install pre-commit hooks
pre-commit install
# Run tests
pytest
# Run tests with coverage
pytest --cov=xcoder --cov-report=html
# Format code
black xcoder tests
ruff check --fix xcoder tests# All tests
pytest
# Specific test file
pytest tests/test_rag.py
# With coverage
pytest --cov=xcoder
# Verbose mode
pytest -vSee WBS.md for detailed work breakdown structure.
- Basic CLI framework
- Project initialization
- Code vectorization (ragify)
- Simple Q&A agent
- Ollama integration
- Docker setup
- Full agent system with roles
- Long-term memory
- Task execution engine
- Code generation capabilities
- Plugin system
- Multi-agent collaboration
- Advanced code understanding
- Comprehensive testing
- PyPI package
- CI/CD pipeline
- Documentation
- Community setup
Contributions are welcome! Please read CONTRIBUTING.md first.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Inspired by Cursor, Claude Code, and Codex CLI
- Built with Ollama for local LLM inference
- Uses ChromaDB for vector storage
- CLI powered by Typer
- π Documentation
- π Issue Tracker
- π¬ Discussions
Made with β€οΈ for the developer community
Keep your code local. Keep it free. Keep coding.