termmind

PyPI version Python License Downloads Tests Code style

TermMind β€” AI-Powered Terminal Assistant | Multi-Provider CLI Coding Tool

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      β•‘
  β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•

What is TermMind?

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.

✨ Features

πŸš€ Installation

pip install termmind

Or from source:

git clone https://github.com/rudra496/termmind.git
cd termmind
pip install -e .

🏁 Quick Start

1. Set up your API

termmind init

This walks you through selecting a provider and entering your API key. You can also manually edit ~/.termmind/config.json.

2. Start chatting

termmind chat

3. Ask questions

termmind ask "Explain async/await in Python"

4. Edit files

termmind edit main.py "Add input validation to the parse_args function"

5. Review code

termmind review ./src

πŸ“‹ Commands

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

Chat Commands

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

πŸ”‘ Provider Setup

πŸ†“ Free Options (no cost)

Google Gemini

  1. Go to aistudio.google.com
  2. Create a free API key
  3. Select gemini during termmind init

Groq

  1. Go to console.groq.com
  2. Sign up and create an API key
  3. Super fast inference on open-source models

Ollama (fully offline)

  1. Install: curl -fsSL https://ollama.ai/install.sh | sh
  2. Pull a model: ollama pull llama3.2
  3. No API key needed! Just select ollama during setup

πŸ’³ Paid Options

OpenAI

  1. Go to platform.openai.com
  2. Create an API key
  3. Supports GPT-4o, GPT-4o-mini, etc.

OpenRouter

  1. Go to openrouter.ai
  2. Access 100+ models from one API key

βš™οΈ Configuration

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"
}

.termmindignore

Like .gitignore but for AI context. Create in your project root:

node_modules/
__pycache__/
*.min.js
dist/
.env

πŸ†š Comparison

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

🐳 Docker Quick Start

# 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"

πŸ”§ Shell Completions

# 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/

πŸ—οΈ Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                   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…) β”‚
    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

✨ What Makes TermMind Unique

These features set TermMind apart from every other AI coding assistant:

🎨 Smart Diff Preview System

🧠 Code Context Memory

🐚 Shell Integration

πŸ“¦ Snippet Manager

πŸ—οΈ Project Templates

πŸ”§ Refactoring Engine

⚑ Performance

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.

πŸ› οΈ Development

# 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 --build

Project Structure

termmind/
β”œβ”€β”€ 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

🀝 Contributing

See CONTRIBUTING.md for detailed guidelines on:

πŸ“œ Code of Conduct

This project follows the Contributor Covenant Code of Conduct. By participating, you agree to uphold this standard.

πŸ”’ Security

See SECURITY.md for our security policy, supported versions, and vulnerability reporting guidelines.

Quick start:

  1. Fork the repository
  2. Create your feature branch: git checkout -b feature/amazing
  3. Commit your changes: git commit -m 'Add amazing feature'
  4. Push: git push origin feature/amazing
  5. Open a Pull Request

πŸ“„ License

MIT License β€” see LICENSE for details.


Made with ❀️ by the TermMind contributors

πŸ’‘ Why TermMind?

πŸ‘€ Who Uses This?

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

🌐 Connect


Built with ❀️ by rudra496 · LinkedIn
MIT License Β· Free & Open Source Forever