Skip to main content

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

Demo GIF / Video coming soon


โœจ 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

๐Ÿ—๏ธ Architecture

                          โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
                          โ”‚   CLI (Typer/Rich)   โ”‚
                          โ”‚         โ”‚
                          โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                                     โ”‚
                                     โ–ผ
                          โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
                          โ”‚        Agent         โ”‚
                          โ”‚   (orchestrator)      โ”‚
                          โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                                     โ”‚
        โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
        โ–ผ               โ–ผ           โ–ผ               โ–ผ               โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ Conversation   โ”‚ โ”‚ Provider  โ”‚ โ”‚ Command โ”‚ โ”‚   Settings    โ”‚ โ”‚  System   โ”‚
โ”‚   Manager      โ”‚ โ”‚ Manager   โ”‚ โ”‚Executor โ”‚ โ”‚   Manager     โ”‚ โ”‚ Detector  โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                         โ”‚
                         โ–ผ
              โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
              โ”‚   ProviderFactory     โ”‚
              โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                         โ”‚
     โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
     โ–ผ         โ–ผ          โ–ผ          โ–ผ            โ–ผ
  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
  โ”‚ Groq โ”‚ โ”‚ OpenAI โ”‚ โ”‚ Gemini โ”‚ โ”‚ Anthropic โ”‚ โ”‚ Ollama โ”‚
  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

                         โ”‚
                         โ–ผ
              โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
              โ”‚   SQLite Database     โ”‚
              โ”‚   โ”‚
              โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

๐Ÿ“ฆ 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 (once published)

pip install termi
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:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/my-feature)
  3. Make your changes, following the existing style (black, isort, ruff)
  4. Run the test suite (pytest)
  5. 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

termi_ai-0.1.0.tar.gz (29.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

termi_ai-0.1.0-py3-none-any.whl (33.4 kB view details)

Uploaded Python 3

File details

Details for the file termi_ai-0.1.0.tar.gz.

File metadata

  • Download URL: termi_ai-0.1.0.tar.gz
  • Upload date:
  • Size: 29.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.7

File hashes

Hashes for termi_ai-0.1.0.tar.gz
Algorithm Hash digest
SHA256 7c62744f555bb5d7e0a766904cd8740a3865fd94f8222de51647c6e24d7595ee
MD5 9b8ba02745ce67306403d389b7bed1ae
BLAKE2b-256 cb45300cf261d9ef45ecafb0ac1468aff553ab920291db9f0a197419c60129b9

See more details on using hashes here.

File details

Details for the file termi_ai-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: termi_ai-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 33.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.7

File hashes

Hashes for termi_ai-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 115269266ae0936576591440798a74f0bc9fd96b73ee88b1639617d612002499
MD5 8f86f2ed2c33724aa9422979fb38dadf
BLAKE2b-256 e98b4a0de45133c9574e23d0a6f65d5964c1aef946c6ae9810a56d5a256873fd

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page