Introducing OllamaCode: An AI Coding Companion That Actually Executes

An intelligent CLI tool that doesn't just generate code blocks - it creates files, runs commands, and manages your development workflow automatically

Jason Too
ai
developer-tools
cli
ollama
python
Introducing OllamaCode: An AI Coding Companion That Actually Executes

🦙 OllamaCode: Your AI Coding Companion

An AI coding assistant that executes your requests instead of just generating code blocks.

🎯 Why OllamaCode?

❌ The Problem with Other AI Assistants

You: "create a Python script that fetches weather data and run it"
Other AI: Here's the code: [shows code block]
You: 😤 Now I have to copy, paste, save, and run it manually...

✅ The OllamaCode Solution

You: "create a Python script that fetches weather data and run it"
OllamaCode: 🔧 Creating weather_fetcher.py...
           🔧 Running python weather_fetcher.py...
 Current weather: 72°F, sunny ☀️
You: 🎉 It actually works!

✨ Key Features

🎯 Direct Tool Execution

LLM calls tools directly instead of generating code blocks. Create files, run commands, manage git - all automatically.

📁 Smart File Operations

Intelligent code generation and execution from natural language with built-in permission system for secure operations.

🔧 Git Workflow Integration

Complete version control operations with AI assistance, from status checks to intelligent commit messages.

🎨 Syntax Highlighting

Beautiful code display with auto-language detection supporting 14+ programming languages.

⚡ Caching System

Fast responses with intelligent caching and enhanced error messages with actionable suggestions.

🌐 Network Endpoints

Connect to remote Ollama servers for powerful models with persistent configuration management.

🚀 Quick Start

Requirements

  • Python 3.9+
  • Ollama with a tool-calling model
  • Recommended: qwen3:latest

Installation

# Install from source
git clone https://github.com/tooyipjee/ollamacode.git
cd ollamacode
pip install -e .
 
# Make sure Ollama is running
ollama serve
 
# Pull a compatible model with tool calling support
ollama pull qwen3:latest
 
# Start coding!
ollamacode

💡 Usage Examples

Interactive Mode

$ ollamacode
 
🦙 OllamaCode - Your AI Coding Companion
 
You: write a file that generates sine wave data and saves as CSV
 
🔧 OllamaCode creates: sine_wave_generator.py
 
 Created functional Python script with:
 numpy for sine wave generation
 pandas for CSV export
 configurable frequency and amplitude
 5 seconds of 440Hz sine wave data
 
You: now run it
 
🔧 Running python sine_wave_generator.py...
 
 Saved 5000 data points to sine_wave.csv
 
You: 🎉 Perfect!

Command Examples

🤖 AI-Powered File Creation: "create a Python REST API with FastAPI that handles user authentication"

🔧 Git Operations: "help me write a commit message for these changes"

🔍 Code Analysis: "explain @main.py and suggest improvements"

🎨 Direct Execution: "optimize this function and run the tests"

Remote Endpoints

# Use a remote Ollama server
ollamacode --endpoint http://192.168.1.100:11434 "explain this algorithm"
 
# Set as default endpoint
ollamacode --set-endpoint http://gpu-server:11434
ollamacode --set-model llama3.1:70b
 
# Now all sessions use the remote server
ollamacode "help me optimize this code"

🛠️ Advanced Features

💡 Smart Auto-Completion

Intelligent suggestions for slash commands, file references, and common operations as you type.

🛡️ Permission System

Safe file operations with granular control. Approve operations once, per session, or deny as needed.

📊 Session Management

Auto-save and resume coding sessions. Never lose your conversation context or progress.

🚨 Enhanced Error Messages

Contextual error handling with actionable suggestions and helpful guidance.

🎯 Project Context

Automatically understands your project structure and provides relevant suggestions.

⚡ Slash Commands

Streamline workflow with built-in commands: /help, /model, /status, /clear, and more.

🔧 Built With

  • Python 3.9+
  • Ollama API
  • Rich (Terminal UI)
  • Ripgrep
  • Git Integration
  • File System Tools

🎯 Perfect For

  • Rapid prototyping
  • Code exploration
  • Learning new languages
  • Automating workflows
  • Debugging assistance
  • Documentation

🚀 Why Choose OllamaCode?

Unlike other AI assistants, OllamaCode actually executes your requests:

  • Creates and runs files automatically
  • Manages git operations intelligently
  • Provides real-time feedback
  • Works completely offline with Ollama

Happy coding with AI! 🦙✨

OllamaCode is open source and free to use. Contributions welcome!