Command generation tool
Project description
๐ CommandGen: Your AI-Powered Terminal Buddy
Ever wished you had a tech wizard in your terminal? ๐งโโ๏ธโจ
Tired of Googling how to use grep or find? ๐ฅด
Fear not, CommandGen is here! ๐
CommandGen is your AI-powered terminal assistant that translates plain English into shell commands using the Google Gemini API. Just describe what you need, and CommandGen will generate and (optionally) run the command for you! ๐ฅ๏ธโก
๐ฅ Features
โ
Natural Language Magic โ No more awk-ward moments, just type what you want!
โ
Preview Before You Wreck โ Avoid accidental rm -rf / disasters. ๐ฌ
โ
Custom Shell Support โ Bash? Zsh? Fish? We got you. ๐
โ
Clipboard & Save Options โ Because typing is hard. ๐คท
โ
Command History โ Never forget that genius one-liner again. ๐
โ
Configurable & Secure โ Your API key stays safe. ๐
โ๏ธ CLI Options
-q, --query ๐ฌ Your natural language command request.
--run ๐ Executes the command immediately (with confirmation).
--shell ๐ Specify a shell (bash, zsh, fish).
--history ๐ View past generated commands.
--copy ๐ Copy command to clipboard.
--save FILE ๐พ Save the generated command to a file.
--json ๐ฆ Output the generated command in JSON format.
--setup ๐ง Run interactive setup for API key and model selection.
--version ๐ท๏ธ Show the current version of CommandGen.
๐ฆ Installation
git clone https://github.com/freemarketamilitia/cmdgen.git
cd commandgen
pip install -e .
๐ cmdgen: Your AI-Powered CLI Assistant
Run Terminal Commands Like a Wizard! ๐งโโ๏ธโจ
cmdgen is a command-line tool powered by the Google Gemini API that converts natural language into terminal commands. No more Googling weird syntaxโjust ask, confirm, and run.
๐ง Setting Up cmdgen as a Global Command
Want to run cmdgen from anywhere instead of typing python cli.py? Hereโs how! ๐ ๏ธ
๐ ๏ธ 1๏ธโฃ Rename cli.py to cmdgen (Optional)
Make your script executable:
mv cli.py cmdgen
chmod +x cmdgen # Make it executable
๐ 2๏ธโฃ Move It to a Directory in Your System PATH
Move the script to a directory already in $PATH, such as /usr/local/bin on macOS/Linux or the user scripts directory on Windows.
๐ On macOS/Linux
mv cmdgen /usr/local/bin/
Now you can run:
cmdgen
from anywhere. ๐
๐ On Windows
- Find your Python scripts directory:
python -c "import sys; print(sys.executable)"
- Copy
cmdgento this folder - Add it to the PATH variable:
- Open Control Panel โ System โ Advanced System Settings
- Click Environment Variables
- Find Path under System Variables โ Click Edit
- Click New and paste the path of the directory containing
cmdgen - Click OK, close everything, and restart your terminal.
Now you can run:
cmdgen
from anywhere on Windows! ๐
๐ข Test It Out!
After adding cmdgen to your path, test it by running:
cmdgen --help
If it works, youโre all set! ๐
๐ก Bonus: Add Autocomplete
For an even smoother experience, add shell autocomplete:
Bash/Zsh (Mac/Linux)
echo 'complete -W "$(cmdgen --help)" cmdgen' >> ~/.bashrc
source ~/.bashrc
PowerShell (Windows)
Set-PSReadLineOption -PredictionSource History
Now enjoy AI-powered command generation with cmdgen! ๐๐ฅ
๐ ๏ธ How to Use
Just ask CommandGen like a normal human:
commandgen -q "list all files in the current directory"
โก๏ธ This outputs:
ls
Simple, right? No more Stack Overflow rabbit holes! ๐ณ๏ธ๐
๐ Why Use CommandGen?
๐ Boost Productivity โ No more wasting time figuring out syntax.
๐ Look Like a Pro โ Impress your coworkers with obscure one-liners.
๐ก๏ธ Safer Execution โ Always review before running.
๐ค Under the Hood
CommandGen uses Google Gemini API to convert plain English into accurate shell commands.
The generated command is previewed before execution for safety.
๐ค Contributing
Want to improve CommandGen? Found a bug? PRs welcome! ๐
Clone the repo, make changes, and submit a pull request.
git clone https://github.com/yourusername/commandgen.git
cd commandgen
๐ License
MIT License. Use it, improve it, but donโt blame us if you rm -rf / your system. ๐
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 cmdgen-2.0.0.tar.gz.
File metadata
- Download URL: cmdgen-2.0.0.tar.gz
- Upload date:
- Size: 3.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e66bf55ce23bbb906553dca38873e473ab29e68c091cc4d6b6b175b1c6588849
|
|
| MD5 |
699d28d128a7d871f6407e20bf42743a
|
|
| BLAKE2b-256 |
788ecdb5becac133148d6fd5d61beccd38c744379ff99e1da15a49d95e0527b8
|
File details
Details for the file cmdgen-2.0.0-py3-none-any.whl.
File metadata
- Download URL: cmdgen-2.0.0-py3-none-any.whl
- Upload date:
- Size: 3.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
50e200005d99431ca54b0e236a01de13adc123120a57bf48b52cf5c125f9c603
|
|
| MD5 |
7c14128d6ec91b8061d5bf6400c12f23
|
|
| BLAKE2b-256 |
f6bd7de28c3b21d834869bd7b3f6307430fe81a6def95627030ba163094b0d1e
|