Skip to main content

AI-powered CLI tool to translate natural language into terminal commands

Project description

cmdgen 🪄

An AI-powered CLI tool that translates your natural language into native terminal commands and lets you review them before execution. Powered by Google's Gemini API.

Features

  • Natural Language to CLI: Just type what you want to do.
  • Context-Aware: Knows your OS (Windows/Linux/macOS), Shell, and Working Directory for perfect commands.
  • Interactive Execution: Uses prompt_toolkit to let you tweak the AI's generated command before running it.
  • Safety First: Warns you with bold yellow text if the command looks destructive (e.g., rm, del, format).
  • Auto-Updater: Silently checks for updates so you're always running the best version.

Installation

The recommended way to install Python CLI tools globally is using pipx:

pipx install cmdgen

(Alternatively, you can pip install cmdgen in a virtual environment)

Quick Start

  1. Get an API Key: Get a free Gemini API key from Google AI Studio.
  2. Configure your Key:
    cmdgen config set --provider gemini --api-key "YOUR_API_KEY"
    
  3. Use the Tool:
    cmdgen "find all python files larger than 10MB in the current directory"
    

You will see an explanation of the command, and an interactive prompt where you can edit it or just press Enter to run it!

Configuration

View your current configuration (safely masked):

cmdgen config view

Contributing

  1. Clone the repository
  2. Install dependencies: pip install -e .[dev]
  3. Run tests: pytest

License

MIT

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

cmdgen_ai_cli-0.1.0.tar.gz (7.5 kB view details)

Uploaded Source

Built Distribution

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

cmdgen_ai_cli-0.1.0-py3-none-any.whl (10.0 kB view details)

Uploaded Python 3

File details

Details for the file cmdgen_ai_cli-0.1.0.tar.gz.

File metadata

  • Download URL: cmdgen_ai_cli-0.1.0.tar.gz
  • Upload date:
  • Size: 7.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.13

File hashes

Hashes for cmdgen_ai_cli-0.1.0.tar.gz
Algorithm Hash digest
SHA256 ecedd135205f40a2cd822080537c30d684f10c680ebc2251e839b1b3daaca2fb
MD5 2cf3b6e4d51b072cbfa06c7dfc19cd2e
BLAKE2b-256 242fd951bf852a76e1e2beee0952376a34f8ccac7dd3cf7de018783206f2fbfd

See more details on using hashes here.

File details

Details for the file cmdgen_ai_cli-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: cmdgen_ai_cli-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 10.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.13

File hashes

Hashes for cmdgen_ai_cli-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5caf05d37438041f70ab7f0a522beb6b71ed23cecd359df4ca633630d056e6ce
MD5 eb347d534ec15428e9f0864a6d505a2d
BLAKE2b-256 7ef3aa43c2718688ab5798538c745983023069e86fc7aa043ba187be48f8a916

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