Multiply your development productivity – Ask AI, review code, and get instant explanations—all from your terminal. Built with Go for speed, powered by Ollama (100% free & local) or cloud AI for intelligence.
Developers spend 25% of their time context-switching between IDE and documentation. ClawCLI eliminates that friction by bringing AI directly into your workflow—100% free and local with Ollama.
Real-world impact:
- Completely free – runs locally with Ollama, no API costs
- Privacy-first – your code never leaves your machine
- Get code explanations in seconds, not minutes
- Automated code reviews catch issues before production
- Interactive problem-solving without leaving your terminal
- Better code quality with instant feedback loops
| Feature | Capability | Use Case |
|---|---|---|
| Interactive Chat | Multi-turn conversations with context retention | Brainstorming, debugging, architecture discussions |
| Ask Command | Lightning-fast one-shot answers | Quick clarifications, syntax help |
| Code Explanation | Understand complex code instantly | Onboarding, legacy code review, learning |
| Smart Code Review | AI-powered analysis (bugs, performance, security) | Pre-commit checks, PR preparation |
| Flexible Config | Choose model, temperature, token limits | Cost optimization vs. quality tradeoff |
| Beautiful TUI | Production-grade terminal UI | Professional, accessible output |
- Go 1.21+ – Install here
- Ollama – Install here (free, runs locally)
- 5 minutes to set up
# 1. Install Ollama and pull a model
ollama pull qwen2.5-coder
# 2. Clone the repository
git clone https://github.com/SShogun/ClawCLI.git
cd ClawCLI
# 3. Create environment file (defaults work out of the box!)
cp .env.example .env
# 4. Build & run
go build -o clawcli.exe
.\clawcli.exe chatDone! You're now talking to AI from your terminal—completely free and private.
.\clawcli.exe ask "How do I handle errors in Go?"
.\clawcli.exe ask "Write a regex for validating emails".\clawcli.exe chat
> What's the best way to structure a REST API?
> How do I optimize database queries?
> exit.\clawcli.exe explain main.go
.\clawcli.exe explain internal\ai\client.go.\clawcli.exe review service.go
# Get:
# • Bug detection
# • Performance suggestions
# • Security issues
# • Best practicesTip: Add ClawCLI to your PATH to use clawcli instead of .\clawcli.exe
Create a .env file in your project directory:
# Default: Ollama (local, free)
CLAW_PROVIDER=ollama
CLAW_BASE_URL=http://localhost:11434
CLAW_MODEL=qwen2.5-coder
# Optional settings
CLAW_MAX_TOKENS=4096
CLAW_TEMPERATURE=0.7
# For cloud providers (optional, paid)
# CLAW_PROVIDER=anthropic
# CLAW_API_KEY=sk-ant-your_key_here
# CLAW_MODEL=claude-3-5-sonnet-20241022| Model | Size | Speed | Best For |
|---|---|---|---|
| qwen2.5-coder | 7B | Fast | Coding tasks (recommended) |
| codellama | 7B | Fast | Code generation |
| deepseek-coder | 6.7B | Fast | Code analysis |
| llama3.1 | 8B | Medium | General purpose |
Install with: ollama pull <model-name>
| Provider | Model | Cost | Best For |
|---|---|---|---|
| Anthropic | claude-3-5-sonnet | $$ | Complex reasoning |
| Anthropic | claude-3-opus | $$$ | Expert analysis |
Get an AI code review with suggestions:
.\clawcli.exe review main.go
.\clawcli.exe review src\service.goThe review will cover:
- Summary of what the code does
- Potential bugs or issues
- Performance improvements
- Code style and best practices
- Security concerns
Check installed version and build info:
.\clawcli.exe versionWhy Go? – Fast, compiled, single binary deployment. Perfect for CLI tools.
ClawCLI (entrypoint)
├── Cobra (CLI framework)
├── Lipgloss (terminal styling)
├── Viper (configuration)
└── AI Providers:
├── Ollama (local, default)
└── Anthropic (cloud, optional)
ClawCLI/
├── cmd/ # Command implementations
│ ├── ask.go
│ ├── chat.go
│ ├── explain.go
│ ├── review.go
│ └── root.go
├── internal/
│ ├── ai/ # Claude API integration
│ ├── config/ # Environment & settings
│ ├── types/ # Data structures
│ ├── ui/ # Terminal UI styling
│ └── utils/ # File I/O & helpers
└── main.go # Entry point
# Install dependencies
go mod tidy
# Build locally
go build -o clawcli
# Run tests
go test ./...
# Run with coverage
go test -cover ./...We maintain >85% code coverage for critical paths:
go test -coverprofile=coverage.out ./...
go tool cover -html=coverage.outWe believe in learning by building. This is an excellent project for developers who want to:
- Learn Go with a real production codebase
- Understand CLI design (argument parsing, user experience)
- Work with APIs (HTTP clients, error handling)
- Master terminal UI (formatting, styling, interactivity)
# 1. Fork and clone
git clone https://github.com/YOUR-USERNAME/ClawCLI.git
# 2. Create a feature branch
git checkout -b feat/your-feature
# 3. Make improvements
# Tests required for new features
go test ./...
# 4. Push and open a PR
git push origin feat/your-featureFor Teams: ClawCLI is ideal as a training project for junior developers. The codebase is clean, well-structured, and focuses on core programming concepts.
See CONTRIBUTING.md for detailed guidelines.
For Engineering Teams:
| Metric | Impact |
|---|---|
| Cost | $0 - runs locally, no API fees |
| Privacy | 100% - code never leaves your network |
| Dev Productivity | +25-40% faster code reviews |
| Onboarding Time | -50% time to understand legacy code |
| Bug Prevention | ~15% reduction with AI-powered reviews |
| Context Switching | -30% time in docs/searches |
For Startups & Scale-ups:
- Zero recurring costs - no API subscriptions
- Enterprise-ready security - on-premise deployment
- Reduce code review bottlenecks without hiring more seniors
- Accelerate new dev onboarding
- Standardize code quality across distributed teams
- VSCode Extension for inline explanations
- GitHub CI integration (auto-review on PRs)
- Team cache for shared conversation history
- Multi-file analysis & refactoring suggestions
- Performance profiling integration
- Security vulnerability scanning
Q: "clawcli is not recognized"?
A: Use .\clawcli.exe or add it to your PATH
Q: "file not found" error?
A: Use relative path from current directory: .\clawcli.exe explain .\cmd\chat.go
Q: "connection refused" error?
A: Make sure Ollama is running: ollama serve
Q: Want to use cloud AI instead?
A: Set CLAW_PROVIDER=anthropic in .env and add your API key
Docs: Full Documentation
Bugs: GitHub Issues
Discussions: GitHub Discussions
Email: hello@example.com
MIT License – See LICENSE file
You're free to:
- Use commercially
- Modify and redistribute
- Use in private/open-source projects
No warranty. Use at your own discretion. Default setup (Ollama) is 100% free with no API costs.
Built with these incredible tools:
- Cobra – Go CLI framework (elegant & powerful)
- Lipgloss – Terminal styling (beautiful UX)
- Viper – Configuration management
- Ollama – Local AI runtime (free & private)
- Optional: Anthropic Claude for cloud AI
Soham – Full-stack developer & Go enthusiast
GitHub | LinkedIn | Portfolio