Skip to main content

Agentic coding assistant for Ollama - Claude Code alternative

Project description

OllamaCoder 🦙💻

OllamaCoder Screenshot

An agentic coding assistant for Ollama - like Claude Code, but running locally!

OllamaCoder transforms your local Ollama models into a powerful autonomous coding agent with tool use, multi-step task execution, and project-aware context.

✨ Features

  • 🤖 Agentic Architecture: Autonomous multi-step task execution with planning, execution, and verification
  • 🔧 Full Tool System: bash, file operations, git, code search, web search, and more
  • 💭 Think Tool: Structured reasoning for complex problems (like extended thinking)
  • 📝 Multi-Edit: Batch file edits in a single operation
  • 🔄 Autonomous Mode: Let the AI work through complex tasks independently
  • ⚙️ Hierarchical Config: User and project-level settings with OLLAMA.md context files
  • 🌐 Remote Ollama: Connect to remote Ollama servers via OLLAMA_HOST
  • 💾 Persistent History: Conversation history saved across sessions
  • 🎨 Rich Output: Beautiful terminal output with syntax highlighting (optional)

📦 Install

From PyPI:

```bash pip install ollama-coder ```

For enhanced terminal output (recommended):

```bash pip install ollama-coder rich ```

For local development:

```bash git clone https://github.com/lalomorales22/ollama-coder.git cd ollama-coder pip install -e . ```

🚀 Quick Start

```bash

Start interactive mode

ollama-coder

Start with autonomous mode enabled

ollama-coder --auto

Run a single command (headless mode)

ollama-coder -p "fix the bug in app.py"

Use a specific model

ollama-coder --model codellama:13b

Work in a specific directory

ollama-coder --dir /path/to/project ```

🛠️ Available Tools

Tool Description
`think` Structured reasoning for complex problems
`bash` Execute shell commands
`read_file` Read file contents with optional line ranges
`write_file` Create or overwrite files
`edit_file` Make surgical edits using find/replace
`multi_edit` Batch multiple edits in one operation
`list_directory` Explore project structure
`search_code` Search for patterns using grep/ripgrep
`git` Version control operations
`web_search` Search the web (when configured)

⌨️ Commands

Command Description
`/auto` Toggle autonomous mode
`/model` Show or set the active model
`/models` List installed Ollama models
`/host` Show or set the Ollama host
`/config` Show current configuration
`/clear` Clear conversation history
`/help` Show available commands
`/quit` Exit OllamaCoder

⚙️ Configuration

User config: `~/.ollamacode/settings.json`

```json { "model": "llama3.3:latest", "max_iterations": 25, "max_tool_rounds": 8, "temperature": 0.7, "ollama": { "host": "http://127.0.0.1:11434", "timeout_sec": 60 }, "web_search": { "enabled": false, "provider": "custom", "endpoint": "", "api_key": "" } } ```

Project Context

Create `OLLAMA.md` files to provide project-specific context:

  • `~/.ollamacode/OLLAMA.md` - User-level context (applies to all projects)
  • `.ollamacode/OLLAMA.md` - Project-level context (in your project root)

🔌 Remote Ollama

Connect to remote Ollama servers:

```bash

Via environment variable

export OLLAMA_HOST=http://your-server:11434 ollama-coder

Or use the /host command

ollama-coder

/host http://your-server:11434 ```

📋 Requirements

  • Python 3.9+
  • Ollama server running locally or accessible remotely
  • Optional: `rich` package for enhanced terminal output

🔄 Comparison with Claude Code

Feature OllamaCoder Claude Code
Local/Private
Free
Tool Use
Autonomous Mode
Thinking Tool
Multi-Edit
Web Search
Project Context
Image Analysis
MCP Support 🔜

📝 License

MIT

🔗 Links

📤 Publishing

Version bumping and publishing is automated via GitHub Actions. Just:

  1. Bump version in `pyproject.toml` and `ollama_coder/init.py`
  2. Commit and push
  3. Create and push a tag: ```bash git tag v0.1.3 git push origin v0.1.3 ```

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

ollama_coder-0.2.0.tar.gz (24.0 kB view details)

Uploaded Source

Built Distribution

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

ollama_coder-0.2.0-py3-none-any.whl (22.9 kB view details)

Uploaded Python 3

File details

Details for the file ollama_coder-0.2.0.tar.gz.

File metadata

  • Download URL: ollama_coder-0.2.0.tar.gz
  • Upload date:
  • Size: 24.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.10

File hashes

Hashes for ollama_coder-0.2.0.tar.gz
Algorithm Hash digest
SHA256 f58b9d93c7c1be4b68e87c6b2cfa4a24979e6efaaefbc5c925122ac1a0a12b58
MD5 e9a9e77a9c4bfb181b89b259a2bbdc33
BLAKE2b-256 80bd80819e341de91b23f56fe93267eb3b2e0d1d800e51fba416ad1505c9957c

See more details on using hashes here.

File details

Details for the file ollama_coder-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: ollama_coder-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 22.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.10

File hashes

Hashes for ollama_coder-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6fd163216773b5232e8280cd0cd07e76a34b8e14ffcc2196ac8c6a28be2351b1
MD5 85d09e82956e62966bb941f64dae9d8e
BLAKE2b-256 a20c74285e301a0411d515865eb2483d9232ba6d3dea2be4622f33e9ff2fa897

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