Skip to main content

A lightweight CLI tool that converts natural language instructions into terminal commands.

Project description

logo

Terma-CLI

A lightweight Python CLI tool that converts natural language instructions into terminal commands.

Overview

Terma-CLI 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-CLI through PyPI:

pip install terma-cli

Locally

git clone https://github.com/ShlokShar/terma.git
cd terma
pip install -e .

Usage

Basic Syntax

terma <command> <args>

Configuration

Terma-CLI 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


Download files

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

Source Distribution

terma_cli-1.0.2.tar.gz (14.9 kB view details)

Uploaded Source

Built Distribution

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

terma_cli-1.0.2-py3-none-any.whl (12.9 kB view details)

Uploaded Python 3

File details

Details for the file terma_cli-1.0.2.tar.gz.

File metadata

  • Download URL: terma_cli-1.0.2.tar.gz
  • Upload date:
  • Size: 14.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.7

File hashes

Hashes for terma_cli-1.0.2.tar.gz
Algorithm Hash digest
SHA256 7c06f396b7d2d194e5d34495e49cbe89ec388fa6b7b27df37b38551ec2950045
MD5 b212ee2c003105769958a0a6f2097d38
BLAKE2b-256 0ec589d19cbaf27bb27468c7411bd32031605a0460e09b3fb2d0f55828eddee0

See more details on using hashes here.

File details

Details for the file terma_cli-1.0.2-py3-none-any.whl.

File metadata

  • Download URL: terma_cli-1.0.2-py3-none-any.whl
  • Upload date:
  • Size: 12.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.7

File hashes

Hashes for terma_cli-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 37a03bc86496acec6d9bda25b0e89ea9b93b2f24e75a51c10a1a68f0658d1452
MD5 2bb1e255fb47ed96217b4c6ca4862610
BLAKE2b-256 84cd995b6e95c94b31e76aa2eacce66fd37f6f746b6cee8295e4cdbcb74fb695

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