Termai is a command-line tool specially designed for beginners,it translates natural language instructions into shell commands and executes them. It streamlines terminal interactions by automating command generation, reducing the need to memorize complex syntax.
- Natural Language to Shell Command Conversion – Converts plain English instructions into executable shell commands using the Gemini language model.
- Command Review – Allows users to review generated commands before execution to ensure accuracy.
- Command Execution – Runs commands directly and presents output in a user-friendly format.
- Shell Detection – Identifies the active shell environment (bash, zsh, PowerShell, etc.) for compatibility.
- Command Validation – Implements security measures to prevent execution of potentially harmful commands.
pip install termai-cli
git clone https://github.com/ayushgupta4002/Termai
cd termai
pip install .
termai "Your instruction here" -e
termai "Make a Next.js project and spin up a PostgreSQL image in Docker" -e
termai "Show all running Docker containers" -e
termai "Find and delete all .log files in this folder" -e
Termai's core logic is in cli.py
, which:
- Receives a natural language instruction.
- Uses
get_shell_command
(vialangchain_google_genai
) to generate shell commands. - Validates commands using
validate_command
inutils.py
. - Executes commands securely and displays results.
termai/
├── src/
│ ├── cli.py # Command-line interface logic
│ ├── utils.py # Utility functions (validation, shell detection)
│ └── __init__.py
├── setup.py # Build script for packaging
└── README.md
- Python – Primary language
- Typer – CLI framework
- Pydantic – Data validation
- Rich – Enhanced terminal output
- google-generativeai & langchain-google-genai – AI model integration
- python-dotenv – Environment variable management
- setuptools – Packaging and distribution
- subprocess – Command execution
Before using Termai, set up your Gemini API key:
echo "GOOGLE_API_KEY=your_api_key" > .env
Contributions are welcome! Please submit a pull request or open an issue.
For any issues or feature requests, please open an issue on GitHub.