cd /home/core/dev/bricked-code/ollama-code
npm install
npm run build
# Optional: Install globally
npm run link# Using npm dev
npm run dev
# Or after global install
ollama-code
# Or explicitly with 'chat' command
ollama-code chat# Use Qwen3-Coder (best for code)
npm run dev -- chat --model qwen3-coder:30b
# Use GPT-OSS (best for reasoning)
npm run dev -- chat --model gpt-oss:20b
# Use Llama 3.1 (fastest)
npm run dev -- chat --model llama3.1:8b# See all tool calls and iterations
npm run dev -- chat --verbose
# Short form
npm run dev -- chat -v# Qwen3-Coder with verbose output
npm run dev -- chat -m qwen3-coder:30b -v
# GPT-OSS with custom temperature
npm run dev -- chat -m gpt-oss:20b -t 0.5
# All options
npm run dev -- chat -m qwen3-coder:30b -v -t 0.7 --url http://localhost:11434# Connect to remote Ollama
npm run dev -- chat --url http://192.168.1.100:11434
# Or use environment variable
export OLLAMA_URL=http://192.168.1.100:11434
npm run dev# Check health
npm run dev -- health
# List models
npm run dev -- models
# Show help
npm run dev -- --help
npm run dev -- chat --help$ npm run dev -- chat -m qwen3-coder:30b -v
ollama-code> Create a file called hello.txt with "Hello World!"
[Iteration 1]
Tool calls: write_file
✓ Response: File created successfully: hello.txt
ollama-code> Now read that file
[Iteration 1]
Tool calls: read_file
✓ Response:
1→Hello World!$ npm run dev -- chat -m qwen3-coder:30b
ollama-code> Find all TypeScript files in the src directory
✓ Response: Found 15 TypeScript files:
src/cli.ts
src/cli/repl.ts
src/llm/agent.ts
src/llm/model-manager.ts
...$ npm run dev -- chat -m gpt-oss:20b -v
ollama-code> Search for all files containing "OllamaClient", then read the main one
[Iteration 1]
Tool calls: grep
[Files found: src/llm/ollama-client.ts, src/llm/agent.ts]
[Iteration 2]
Tool calls: read_file
[Reading src/llm/ollama-client.ts]
✓ Response: The OllamaClient class provides...
[Shows summary of the file]# Ollama server URL
export OLLAMA_URL=http://localhost:11434
# Default model
export DEFAULT_MODEL=qwen3-coder:30b
# Then start
npm run devCreate ~/.ollama-code/config.json:
{
"ollamaUrl": "http://localhost:11434",
"defaultModel": "qwen3-coder:30b",
"temperature": 0.7,
"maxTokens": 4096
}Once in the REPL:
/help Show help
/models List available models
/model NAME Switch to a different model
/verbose Toggle verbose mode
/clear Clear conversation history
/exit Exit REPL
# Start with Qwen3-Coder for code analysis
ollama-code chat -m qwen3-coder:30b
> Find all .ts files in src/tools
> Read the file-ops.ts file
> Explain what the write_file function does
> Are there any potential bugs?# Use verbose mode to see tool usage
ollama-code chat -v
> What TypeScript files exist in this project?
> Show me the directory structure
> Search for all occurrences of "ToolManager"# Use GPT-OSS for planning, then Qwen for coding
ollama-code chat -m gpt-oss:20b
> Plan a new feature: add support for JSON file validation
> /model qwen3-coder:30b
> Implement the JSON validation tool we discussed# Run the tool test suite
npx tsx test-simple.ts
# Run integration tests
npx tsx test-integration.ts# Watch mode (auto-rebuild on changes)
npm run watch
# In another terminal, run
npm run devimport { Agent } from './src/llm/agent.js';
import { ModelManager } from './src/llm/model-manager.js';
import { ToolManager } from './src/tools/tool-manager.js';
import { ConfigManager } from './src/config/index.js';
import { allTools } from './src/tools/index.js';
const config = new ConfigManager();
await config.load();
const toolManager = new ToolManager();
toolManager.registerTools(allTools);
const modelManager = new ModelManager(config.get());
await modelManager.initialize();
const agent = new Agent(config.get(), toolManager, modelManager);
const response = await agent.run('List all files in src/', {
verbose: true,
model: 'qwen3-coder:30b'
});
console.log(response);# Check if Ollama is running
ollama list
# If not, start it
ollama serve
# Or specify a different URL
ollama-code chat --url http://localhost:11434# List available models
ollama list
# Pull a model if needed
ollama pull qwen3-coder:30b
ollama pull gpt-oss:20b
ollama pull llama3.1:8b
# Verify
ollama-code modelsSome models have better tool calling support than others:
- ✅ Llama 3.1 - Excellent tool calling
⚠️ Qwen3-Coder - Understands tools but uses non-standard format⚠️ GPT-OSS - Variable support
For best results, use: -m llama3.1:8b
-
Use smaller models for simple tasks
ollama-code chat -m llama3.1:8b
-
Lower temperature for deterministic outputs
ollama-code chat -t 0.3
-
Use verbose mode only when debugging
# Adds overhead ollama-code chat -v -
Enable GPU acceleration
- Ensure NVIDIA drivers are installed
- Ollama automatically uses GPU if available
# Aider
aider --model gpt-4
# Ollama Code (100% local)
ollama-code chat -m qwen3-coder:30b# Copilot (cloud-based)
gh copilot suggest "list files"
# Ollama Code (local)
ollama-code chat -m llama3.1:8b
> list files in current directory- Try the examples above
- Explore different models
- Create custom workflows
- Contribute to the project
- 📖 README:
README.md - 🔧 Implementation:
IMPLEMENTATION.md - 🚀 Quick Start:
QUICKSTART.md - 🧪 Test Report:
TEST-REPORT.md - 📝 This guide:
USAGE.md
Happy Coding with Ollama Code! 🚀