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

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:

  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.2.tar.gz (29.0 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.2-py3-none-any.whl (33.0 kB view details)

Uploaded Python 3

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

Hashes for termi_ai-0.1.2.tar.gz
Algorithm Hash digest
SHA256 20a9cc6a26058a243c3bb19b4433b1d0cafeb8abad1ba9fe0bd8cadefad11a94
MD5 decf7257928178f0fb40942c4a9b9a81
BLAKE2b-256 dcbace94a0ab0efd0db4607f6c8eeef2f343dd19ad9a2eb1c2b10230ceed9305

See more details on using hashes here.

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

Hashes for termi_ai-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 0d1318fa5b0e08bbc74a2d0a18e8c80a437d8caf5e2bb51ec0355e20d0716498
MD5 408dd8271e2b11345bd3c307d92b62f0
BLAKE2b-256 f04f3c8f2fdbcfa929112eef9235ba686042ef2f11e43ec91dd68b74e45ce1e0

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