Crates.io | cmdo-gen |
lib.rs | cmdo-gen |
version | 0.2.2 |
source | src |
created_at | 2024-07-19 11:07:56.478271 |
updated_at | 2024-07-20 05:27:25.857022 |
description | Utility script to generate terminal commands using natural language |
homepage | https://github.com/parassharmaa/cmdo |
repository | https://github.com/parassharmaa/cmdo |
max_upload_size | |
id | 1308532 |
size | 207,995 |
This utility script allows users to generate terminal commands using natural language descriptions.
To install the script, run the following command:
npm install -g cmdo-gen
or
cargo install cmdo-gen
Before generating commands, you need to set your OpenAI API key. Run the following command:
cmdo set-key <your-openai-api-key>
This will save your API key to a configuration file in your home directory (~/.cmd.config
).
To generate a terminal command based on an action description, run:
cmdo gen "<action-description>"
For example:
cmdo gen "list all files in the current directory"
The script will generate a command and prompt you to either copy it to the clipboard or exit.
set-key
: Save the OpenAI API key to the configuration file.gen
: Generate a terminal command based on the provided action description.cmdo set-key sk-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
cmdo gen "ping google.com 3 times"
Output:
crafting command for: ping google.com 3 times
> ping -c 3 google.com
(c) copy, (e) execute, (q) quit
Feel free to open issues or submit pull requests with improvements or bug fixes.