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.1.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.1-py3-none-any.whl (12.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: terma_cli-1.0.1.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.1.tar.gz
Algorithm Hash digest
SHA256 f35cff24c27b095abf681fc5293d5b02025703e2d9172aa37c3ab25b1598a0c9
MD5 62a5f619fa460a3102b72e370adf9426
BLAKE2b-256 8055a00f1653751d7d9128552c4cf3d4a05298516f46249ec4cc6a5cdcbecb23

See more details on using hashes here.

File details

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

File metadata

  • Download URL: terma_cli-1.0.1-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

Hashes for terma_cli-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 592ca6b8dbaa8f2f53857bbb9775281ac60508436890090ee5060d95d40c4ff7
MD5 389f0ec8ac24102a7c9b4723293a4f74
BLAKE2b-256 ac848778fe875aa580ceba0ecba8eda0912a6e0710e12fa1b6921320ac30646d

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