šŸ¦™ OllamaCode

An intelligent CLI companion for developers

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

Python 3.9+
Ollama Compatible
Tool Execution
File Operations
Git Integration
MIT License

šŸŽÆ 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: ```python [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!
demo_1.gif
OllamaCode Demo

✨ 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

āš™ļø Supported Languages

• Python
• JavaScript/TypeScript
• Rust
• Go
• Java
• C/C++
• HTML/CSS
• And more!
installation.sh
# 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

terminal.sh
$ 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

remote-setup.sh
# 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

Ready to supercharge your coding workflow? šŸš€

Happy coding with AI! šŸ¦™āœØ