AI-powered cross-platform terminal assistant that converts natural language into shell commands.
Project description
๐ค Termi
AI-powered multi-LLM terminal assistant that converts natural language into executable shell commands.
๐ Project Description
Termi lets you describe what you want to do in plain English and get back a real, executable shell command โ no more digging through man pages or half-remembered find flags.
It works across Windows, Linux, and macOS, automatically detects your operating system and shell, and supports five different LLM providers so you're never locked into one vendor. Termi remembers what you've asked in the current session. It can explain what a command does before you run it, diagnose why a command failed after you run it and like any responsible assistant sitting in front of your terminal, it always asks before executing anything.
๐ฅ Demo
https://github.com/user-attachments/assets/778762da-46b0-4f7a-b4ab-8d96ec2c46a3
โจ Features
| Feature | Description | |
|---|---|---|
| โ | Natural language โ shell commands | Describe a task in plain English, get back a real, runnable command |
| โ | Multiple LLM providers | Groq, OpenAI, Gemini, Anthropic, and Ollama (local) |
| โ | Runtime provider switching | Swap providers mid-session with /provider set <name> |
| โ | Automatic OS detection | Detects Windows, Linux, or macOS automatically |
| โ | Automatic shell detection | Detects bash, zsh, fish, PowerShell, or cmd automatically |
| โ | Persistent command history | Every prompt, command, and result is logged to SQLite |
| โ | Command explanation | Ask Termi to explain any shell command in plain English |
| โ | AI-powered error explanation | When a command fails, Termi diagnoses why and suggests a fix |
| โ | Confirmation before execution | Nothing runs without your explicit go-ahead |
| โ | Cross-platform | Windows, Linux, and macOS |
| โ | Installable CLI package | pip install -e . and run termi from anywhere |
๐ฆ Installation
From source
git clone https://github.com/<shreya-ramesh>/termi.git
cd termi
python3 -m venv .venv
source .venv/bin/activate
pip install -e ".[dev]"
cp .env.example .env
# add your API key(s) to .env
termi
Via pip
pip install termi-ai
termi
โ๏ธ Configuration
Termi reads its configuration from a .env file at the project root so fill in the keys for whichever provider(s) you plan to use โ you only need the ones you'll actually use.
| Variable | Description |
|---|---|
GROQ_API_KEY |
API key for Groq |
OPENAI_API_KEY |
API key for OpenAI |
GEMINI_API_KEY |
API key for Google Gemini |
ANTHROPIC_API_KEY |
API key for Anthropic Claude |
OLLAMA_BASE_URL |
URL of a locally running Ollama server (default: http://localhost:11434) |
๐ Project Structure
termi/
โโโ termi/
โ โโโ __init__.py
โ โโโ cli.py # Typer + Rich CLI entrypoint
โ โโโ core/
โ โ โโโ agent.py # Orchestrates generation, safety, execution
โ โ โโโ provider_manager.py # Single entry point to LLM providers
โ โ โโโ conversation.py # Conversational memory
โ โ โโโ executor.py # Shell command execution
โ โ โโโ settings.py # Persistent user settings
โ โ โโโ system.py # OS / shell / cwd / user detection
โ โ โโโ system_query.py # Local (LLM-free) system-info queries
โ โ โโโ explainer.py # Command explanation
โ โ โโโ error_explainer.py # AI-powered failure diagnosis
โ โ โโโ intent.py # LLM output โ clean shell command
โ โโโ providers/
โ โ โโโ base.py # Abstract BaseProvider interface
โ โ โโโ factory.py # ProviderFactory
โ โ โโโ groq_provider.py
โ โ โโโ openai_provider.py
โ โ โโโ gemini_provider.py
โ โ โโโ anthropic_provider.py
โ โ โโโ ollama_provider.py
โ โโโ database/
โ โ โโโ database.py # SQLite connection + schema
โ โ โโโ history_repository.py # History CRUD
โ โโโ utils/
โ โโโ logger.py
โ โโโ exceptions.py
โ โโโ dangerous_commands.py # Destructive-command heuristics
โโโ tests/ # pytest suite
โโโ settings.json
โโโ pyproject.toml
โโโ requirements.txt
โโโ .env.example
โโโ .gitignore
โโโ LICENSE
๐ค Contributing
Contributions are welcome! If you'd like to help:
- Fork the repository
- Create a feature branch (
git checkout -b feature/my-feature) - Make your changes, following the existing style (
black,isort,ruff) - Run the test suite (
pytest) - Open a pull request describing what changed and why
๐ Please keep pull requests focused on one feature or fix per PR makes review much faster.
๐ License
This project is licensed under the MIT License โ see LICENSE for details.
๐ Acknowledgements
Termi is built on top of a great open-source ecosystem, including Typer, Rich, and python-dotenv, along with the official SDKs for Groq, OpenAI, Google Gemini, and Anthropic, plus Ollama for local inference.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file termi_ai-0.1.2.tar.gz.
File metadata
- Download URL: termi_ai-0.1.2.tar.gz
- Upload date:
- Size: 29.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
20a9cc6a26058a243c3bb19b4433b1d0cafeb8abad1ba9fe0bd8cadefad11a94
|
|
| MD5 |
decf7257928178f0fb40942c4a9b9a81
|
|
| BLAKE2b-256 |
dcbace94a0ab0efd0db4607f6c8eeef2f343dd19ad9a2eb1c2b10230ceed9305
|
File details
Details for the file termi_ai-0.1.2-py3-none-any.whl.
File metadata
- Download URL: termi_ai-0.1.2-py3-none-any.whl
- Upload date:
- Size: 33.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0d1318fa5b0e08bbc74a2d0a18e8c80a437d8caf5e2bb51ec0355e20d0716498
|
|
| MD5 |
408dd8271e2b11345bd3c307d92b62f0
|
|
| BLAKE2b-256 |
f04f3c8f2fdbcfa929112eef9235ba686042ef2f11e43ec91dd68b74e45ce1e0
|