A lightweight CLI tool that converts natural language instructions into terminal commands.
Project description
Terma
A lightweight Python CLI tool that converts natural language instructions into terminal commands.
Overview
Terma lets you describe what you want to do in plain English, and your configured AI provider (OpenAI, Anthropic, or Google GenAI) will translate it into a valid terminal command.
Features
- Convert natural language directly into executable commands
- Multiple AI provider support:
- OpenAI
- Anthropic
- Google GenAI
- AI agent configuration via
terma config - Persistent settings stored automatically at
~/.config/terma/config.json - Simple CLI tool created with Python + Typer
Installation
Globally
You can install Terma through PyPI:
pip install terma
Locally
git clone https://github.com/ShlokShar/terma.git
cd terma
pip install -e .
Usage
Basic Syntax
terma <command> <args>
Configuration
Terma uses a simple config system to set your AI provider, API key, and model. Configuration is required prior to executing the natural language command.
Supported config commands
| Command | Description |
|---|---|
terma config provider <provider> |
Set the AI provider (e.g., openai, anthropic, google) & API key |
terma config provider <provider> --api-key <key> |
Set provider and API key in one line |
terma config api-key |
Set the API key separately |
terma config model <model-name> |
Sets the model (e.g., gpt-4-nano, claude-haiku-4-5, etc.) |
terma config peek |
View Terma's current configuration |
Natural Language Execution
Translate any natural language instruction into a real command:
terma exec <instruction>
Example Commands
Input:
terma exec check node version
Output:
node --version
Input:
terma exec make a new directory called logs and move all .txt files into it
Output:
mkdir logs && mv *.txt logs/
(Actual output may differ depending on the AI provider/model.)
Config File Path
Terma automatically stores configuration settings at:
~/.config/terma/config.json
You do not need to create this manually.
License
This project is licensed under the MIT License.
Contributing
Feel free to open issues, submit PRs, or propose features.
Roadmap
- Command history log for past AI-generated commands
- More provider-specific settings
- Optional safety/output confirmation mode
Author
Shlok Sharma
GitHub: @ShlokShar
Related Projects
- insectool — A lightweight Python web scanner for identifying common web vulnerabilities
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 terma_cli-1.0.0.tar.gz.
File metadata
- Download URL: terma_cli-1.0.0.tar.gz
- Upload date:
- Size: 9.0 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b893d2321c6d3721375ed17addbabb1b43bf2ba46bf32a22c8ffb5bf0f03a9e7
|
|
| MD5 |
d06f8b9eec546add2ba3d864f3030c13
|
|
| BLAKE2b-256 |
96ff2de0c208e4d3359d9d76bed0af92b0ea71c62d678af537cfaa84bae9e09a
|
File details
Details for the file terma_cli-1.0.0-py3-none-any.whl.
File metadata
- Download URL: terma_cli-1.0.0-py3-none-any.whl
- Upload date:
- Size: 12.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bb0f7973a98cccc34811c5e5d658a6a400acd5a59bee8121d0f6d98cd39f7de3
|
|
| MD5 |
787da1cc8085aa27c84bc3129bbee720
|
|
| BLAKE2b-256 |
f2855652ffcd0d902b83f5ac1e12ee3554fe606206e3d42099d09fb173e86393
|