A modern, open-source AI terminal assistant. Free, beautiful, and lives in your terminal.
βββββββββββββββββββββββββββββββ
β T e r m M i n d β
β AI Terminal Assistant β
βββββββββββββββββββββββββββββββ
TermMind is a CLI tool that lets you chat with AI models directly in your terminal. It can read, write, and edit files, run commands, understand your codebase, and help you code faster β all with a beautiful, rich terminal UI.
Think Claude Code or Aider, but free, open-source, and lightweight.
- π¨ Beautiful terminal UI β Syntax highlighting, markdown rendering, streaming responses
- π Multi-provider β OpenAI, Anthropic Claude, Google Gemini, Groq, Together.ai, OpenRouter, Ollama
- π° Free tiers supported β Works with Gemini, Groq, and Ollama at zero cost
- π Smart context β Automatically includes relevant files from your project
- βοΈ File editing β AI-powered file creation and editing with diff support
- β©οΈ Undo system β Every edit is tracked; undo any change with
/undo - πΎ Session management β Save and load conversations
- π Cost tracking β Real-time token count and cost estimation
- π Provider switching β Change models mid-conversation with
/provider - π³ File tree β Visual project structure with
.termmindignoresupport - π Code search β Find anything in your project files
- π Git integration β Status, diff, log, and AI-generated commit messages
- β‘ Streaming β See responses as they're generated, not after
- π¦ Snippet Manager β Save, search, and reuse code snippets with template variables
- ποΈ Project Templates β Scaffold projects from 8 built-in templates (Python, FastAPI, React, Next.js, etc.)
- π§ Refactoring Engine β AI-powered refactoring with diff preview, confirmation, and undo
pip install termmindOr from source:
git clone https://github.com/rudra496/termmind.git
cd termmind
pip install -e .termmind initThis walks you through selecting a provider and entering your API key. You can also manually edit ~/.termmind/config.json.
termmind chattermmind ask "Explain async/await in Python"termmind edit main.py "Add input validation to the parse_args function"termmind review ./src| Command | Description |
|---|---|
termmind init |
Configure API provider, key, and model |
termmind chat |
Start interactive chat session |
termmind ask "q" |
One-shot question (no session) |
termmind edit file |
Edit a file with AI |
termmind review path |
Review code in directory |
termmind explain file |
Explain a file |
termmind test file |
Generate tests for a file |
termmind history |
Show saved sessions |
termmind config |
Show current configuration |
Inside termmind chat, use slash commands:
| Command | Description |
|---|---|
/edit <file> [instruction] |
Edit a file with AI |
/run <command> |
Run a shell command |
/files |
List files in context |
/add <file> |
Add file to context |
/search <query> |
Search project files |
/tree |
Show file tree |
/clear |
Clear conversation |
/save [name] |
Save session |
/load <name> |
Load saved session |
/model [name] |
Show/switch model |
/provider [name] |
Show/switch provider |
/cost |
Show token usage & cost |
/theme dark/light |
Change color theme |
/undo |
Undo last file edit |
/diff |
Show session changes |
/status |
Git status + context info |
/git [status/log/diff] |
Git operations |
/snippet save <name> |
Save code as a snippet |
/snippet list |
List saved snippets |
/snippet load <name> |
Load snippet into context |
/snippet search <query> |
Search snippets |
/template list |
List project templates |
/template use <name> |
Scaffold a project |
/refactor <op> <file> |
AI-powered refactoring |
/refactor undo |
Undo last refactoring |
/help |
Show all commands |
- Go to aistudio.google.com
- Create a free API key
- Select
geminiduringtermmind init
- Go to console.groq.com
- Sign up and create an API key
- Super fast inference on open-source models
- Install:
curl -fsSL https://ollama.ai/install.sh | sh - Pull a model:
ollama pull llama3.2 - No API key needed! Just select
ollamaduring setup
- Go to platform.openai.com
- Create an API key
- Supports GPT-4o, GPT-4o-mini, etc.
- Go to openrouter.ai
- Access 100+ models from one API key
Config is stored at ~/.termmind/config.json:
{
"provider": "gemini",
"api_key": "your-key-here",
"model": "gemini-2.0-flash",
"max_tokens": 4096,
"temperature": 0.7,
"theme": "dark"
}Like .gitignore but for AI context. Create in your project root:
node_modules/
__pycache__/
*.min.js
dist/
.env
| Feature | TermMind | Claude Code | Aider | Open Interpreter |
|---|---|---|---|---|
| Open Source | β MIT | β | β Apache | β MIT |
| Free Tier | β (Gemini/Groq) | β | β | β |
| Local/Offline | β (Ollama) | β | β | β |
| Streaming | β | β | β | β |
| Multi-Provider | β 6+ | β | β | β |
| Rich Terminal UI | β | β | β | β |
| File Editing | β | β | β | β |
| Undo Edits | β | β | β | β |
| Cost Tracking | β | β | β | β |
| Session Save/Load | β | β | β | β |
| Dependencies | 4 | Heavy | Moderate | Heavy |
| Python | β 3.8+ | Node.js | Python | Python |
# Build and run
docker compose up --build
# With local Ollama (fully offline)
docker compose --profile local-llm up --build
# One-shot question via Docker
docker compose run --rm termmind ask "Explain async/await in Python"# Auto-install for your current shell
termmind completions install
# Or manually: generated scripts live in ~/.termmind/completions/
# Bash:
echo 'source ~/.termmind/completions/termmind.bash' >> ~/.bashrc
# Zsh:
echo 'fpath=(~/.termmind/completions $fpath)' >> ~/.zshrc
# Fish:
cp ~/.termmind/completions/termmind.fish ~/.config/fish/completions/βββββββββββββββββββββββββββββββββββββββββββββββ
β CLI (cli.py) β
β click commands: chat, ask, edit, reviewβ¦ β
ββββββββββββ¬βββββββββββββββ¬ββββββββββββββββββββ
β β
ββββββββΌβββββββ ββββββΌβββββββββββ
β Commands β β Diff Engine β
β (/edit,β¦) β β (diff_ β
β commands.py β β engine.py) β
ββββββββ¬βββββββ βββββββββββββββββ
β
ββββββββΌβββββββββββββββββββββββββββ
β Context Engine β
β context.py + memory.py β
β (smart file selection, β
β code index, caching) β
ββββββββ¬βββββββββββββββββββββββββββ
β
ββββββββΌβββββββ βββββββββββββββββ
β File Ops β β Git Module β
β file_ops.py β β git.py β
ββββββββ¬βββββββ βββββββββββββββββ
β
ββββββββΌβββββββββββββββββββββββββββ
β API Client β
β api.py + providers.py β
β (streaming, multi-provider) β
ββββββββββββββββββββββββββββββββββ
β
ββββββββΌβββββββββββββββββββββββββββ
β Plugin System β
β plugins.py (on_start, on_msgβ¦) β
ββββββββββββββββββββββββββββββββββ
These features set TermMind apart from every other AI coding assistant:
- Side-by-side diff view in the terminal with rich syntax highlighting
- Hunk-by-hunk confirmation β accept or reject individual changes
- Auto-detect edit type β insert, delete, replace, move, rename
- Multi-file diff statistics β insertions, deletions, files changed
- Beautiful colored output (red for removals, green for additions)
- Persists across sessions β remembers your project structure
- Lightweight code index β function signatures, class definitions, imports
- Incremental updates β only re-indexes changed files
- 9 languages supported β Python, JS, TS, Go, Rust, Java, Ruby, C, C++
- Query the index β find functions/classes by name pattern instantly
- Auto-detect shell β bash, zsh, fish
- Generate completion scripts for all three shells
- Terminal capability detection β true color, Unicode, emoji, copy/paste
- Auto-resize handling β responds to terminal resize events
- One-command install β
termmind completions install
- Save snippets from conversations β extracts code blocks automatically
- Search by name, description, tags, or code content with relevance scoring
- Template variables β
{{filename}},{{datetime}},{{user}},{{cwd}},{{year}}, etc. - Auto-suggest relevant snippets based on conversation context
- Import/Export β share snippet collections as JSON files
- Usage tracking β tracks how often each snippet is used
- Language detection β auto-detects programming language from content
- Stored in
~/.termmind/snippets/β portable and shareable
- 8 built-in templates β scaffold complete projects instantly:
python-packageβ Modern Python package with pyproject.toml, tests, CIfastapi-apiβ FastAPI REST API with auth, DB, Dockerflask-apiβ Flask REST API with SQLAlchemycli-toolβ Python CLI tool with clickreact-appβ React + TypeScript + Vitenextjs-appβ Next.js with App Routerexpress-apiβ Express.js REST APIdjango-appβ Django with Django REST Framework
- Template variables β
{{project_name}},{{module_name}},{{author}}, etc. - Custom templates β add your own to
~/.termmind/templates/ - Post-generation instructions β clear next steps for each template
- 8 refactoring operations β extract-function, rename, inline, extract-class, simplify, dead-code, sort-imports, add-types
- AI-powered β uses your configured model for intelligent refactoring
- Diff preview β see exactly what will change before applying
- Confirmation step β approve or reject each refactoring
- Undo support β every refactoring is tracked and reversible
- History β view past refactorings with
/refactor history - Local sort-imports β PEP 8 import sorting without AI needed
| Operation | Time |
|---|---|
| Startup (cold) | ~0.3s |
| Startup (warm) | ~0.1s |
| Context selection (10 files) | ~0.05s |
| Code index build (100 files) | ~0.8s |
| Code index update (incremental) | ~0.05s |
| Diff render (1000 lines) | ~0.02s |
Measured on a typical developer machine. Actual times vary.
# Clone
git clone https://github.com/rudra496/termmind.git
cd termmind
# Install in dev mode
pip install -e .
# Run directly
python -m termmind.cli chat
# Test
python -m pytest
# Docker dev environment
docker compose up --buildtermmind/
βββ termmind/
β βββ __init__.py # Version info
β βββ cli.py # Main CLI entry point
β βββ api.py # API client (streaming, multi-provider)
β βββ config.py # Configuration management
β βββ context.py # Smart file context builder
β βββ commands.py # Slash command handlers
β βββ file_ops.py # File read/write/edit/search
β βββ git.py # Git operations
β βββ providers.py # Provider implementations
β βββ plugins.py # Plugin system
β βββ sessions.py # Session save/load
β βββ themes.py # Color themes
β βββ diff_engine.py # Smart diff preview system
β βββ memory.py # Code context memory/index
β βββ shell.py # Shell integration & completions
β βββ snippets.py # Snippet manager (save/search/reuse)
β βββ templates.py # Project scaffolding templates
β βββ refactor.py # AI-powered refactoring engine
β βββ utils.py # Token counting, utilities
βββ tests/
βββ Dockerfile
βββ docker-compose.yml
βββ pyproject.toml
βββ README.md
βββ CODE_OF_CONDUCT.md
βββ SECURITY.md
βββ CONTRIBUTING.md
βββ LICENSE
See CONTRIBUTING.md for detailed guidelines on:
- Setting up the dev environment
- Code style and conventions
- Adding new providers and commands
- Plugin development
- Testing guidelines
- PR and issue templates
This project follows the Contributor Covenant Code of Conduct. By participating, you agree to uphold this standard.
See SECURITY.md for our security policy, supported versions, and vulnerability reporting guidelines.
Quick start:
- Fork the repository
- Create your feature branch:
git checkout -b feature/amazing - Commit your changes:
git commit -m 'Add amazing feature' - Push:
git push origin feature/amazing - Open a Pull Request
MIT License β see LICENSE for details.
Made with β€οΈ by the TermMind contributors
- 7 providers, 1 tool β No need to switch between ChatGPT, Claude, Gemini apps
- Code-aware β Understands your project structure, not just isolated files
- Works offline β Use Ollama or local models with zero API costs
- Extensible β Plugin system lets you add custom commands
- Zero config β Works out of the box, configure only when you want to
- Session history β Never lose context between sessions
| Role | How They Use It |
|---|---|
| Full-Stack Devs | Quick code generation, refactoring, and debugging across languages |
| DevOps Engineers | Generate Dockerfiles, CI configs, and Terraform files |
| Students | Learn programming with an AI tutor that explains concepts |
| Open Source Contributors | Understand unfamiliar codebases quickly |
| AI Enthusiasts | Experiment with multiple LLM providers side by side |
Built with β€οΈ by rudra496 Β· LinkedIn
MIT License Β· Free & Open Source Forever