Skip to main content

Turn natural language into ready-to-use terminal commands

Project description

gpt-command (gptc)

Turn natural language into ready-to-use terminal commands.

gptc is a lightweight CLI tool that converts plain English (or any language) into executable shell commands for macOS and Linux.


🚀 Installation

pip install gpt-command

🔑 Setup (Required)

Run once to configure your API key and enable shell integration::

gptc-key

This will:

  • Store your OpenAI API key securely
  • Automatically install shell integration (zsh or bash)
  • Detect your current shell and update the correct rc file

After setup, apply changes:

source ~/.zshrc
# or
source ~/.bashrc

Check status:

gptc-key --status

Set default model (optional):

gptc-key --model gpt-5.4-nano

💡 Usage

gptc <your question>

Example

gptc find and delete all txt files in current directory recursively

Output:

find . -type f -name "*.txt" -delete

Then it will automatically prefill your terminal input:

~/current/path$ find . -type f -name "*.txt" -delete

⚠️ The command is NOT executed automatically.


⚙️ Options

📋 Copy to clipboard

gptc --copy compress current folder into tar.gz

📖 Show explanation

gptc --explain find process using port 8000

▶️ Execute command (with confirmation)

gptc --run check disk usage

🧠 Show history

gptc --history

🤖 Specify model

gptc --model gpt-4.1 list all running processes

🔐 Security

  • API key is stored locally at:
~/.config/gptc/config.json

File permissions are restricted to the user (600) Dangerous commands are automatically detected and blocked from execution


⚠️ Disclaimer

  • Always review generated commands before running them
  • Some commands may modify or delete system data
  • Use with caution, especially with elevated privileges (sudo)

🖥️ Supported Platforms

  • macOS
  • Linux (Ubuntu, etc.)

✨ Features

  • Natural language → shell command
  • Auto-prefilled terminal input (no copy-paste needed)
  • Optional execution with confirmation
  • Clipboard copy support
  • Command explanation
  • History tracking
  • Local API key management (no environment variable required)

📌 Summary

Stop Googling terminal commands. Just ask.


📄 License

MIT License

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

gpt_command-0.2.3.tar.gz (9.4 kB view details)

Uploaded Source

Built Distribution

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

gpt_command-0.2.3-py3-none-any.whl (10.1 kB view details)

Uploaded Python 3

File details

Details for the file gpt_command-0.2.3.tar.gz.

File metadata

  • Download URL: gpt_command-0.2.3.tar.gz
  • Upload date:
  • Size: 9.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for gpt_command-0.2.3.tar.gz
Algorithm Hash digest
SHA256 c89a6efdcb959cc6d1c81081dedb1db9f1c630d585a3c148abe721a9e23e00da
MD5 a7952f703d03552052d0ace277ac27e0
BLAKE2b-256 bcf7def8ffa8c80aca9ea4d6bd0fc3626e1339a7df6ed5df15d2b72cbee555bc

See more details on using hashes here.

File details

Details for the file gpt_command-0.2.3-py3-none-any.whl.

File metadata

  • Download URL: gpt_command-0.2.3-py3-none-any.whl
  • Upload date:
  • Size: 10.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for gpt_command-0.2.3-py3-none-any.whl
Algorithm Hash digest
SHA256 e25da3d0571dcb983472bd3353aeeb33311a8c29bf4c3242d8d96772cc0b32d5
MD5 203786d8153ab23eff40e7be8387e034
BLAKE2b-256 90b9512f4e9b234aa95760137d7857f44a725cae69aebdc95170d63de88f3835

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