CommanDeft
CommanDeft is a simple Python CLI tool designed to generate useful shell commands based on user prompts. It utilizes OpenAI's chat models to provide intelligent suggestions and help users compose shell commands quickly and efficiently.
Requirements
- In order to use CommanDeft you will need an OpenAI API Key which will be asked of you during the initial configuration. You can easily get one from HERE
-If you are using Linux you might have to install xclip using your package manager.
For example, in Debian:
sudo apt-get install xclip
Installation
To install CommanDeft, you can use the following command:
pip install commandeft
Example Usage
-
Generate a shell command based on a prompt:
commandeft --prompt "list all files in the current directory" OR commandeft -p "list all files in the current directory"
This will provide a shell command suggestion based on the given prompt:
> ls -a
-
Run CommanDeft in interactive mode:
commandeft --interactiveThis will start CommanDeft in interactive mode, allowing you to input prompts and receive command suggestions directly within the CLI.
-
Re-configure:
commandeft --configureThis will run the configuration flow for CommanDeft, allowing you to set up your preferences and customize the behavior of the tool.
Configuration
During the initial configuration or when running:
commandeft --configure (or -c)
- You can choose the generated answer's
temperature. Because this tool is geared towards code generation, lower temperatures perform better. More information about temeratures HERE - You can choose the
max_tokenvalue.
⚠️ Keep in Mind that the guided prompt(assistant role prompt + user role prompt without user's prompt) consumes ~70 tokens. The value you specify won't include these tokens. - You will also be asked about the action that will be performed every time when you accept a generated command when running in interactive mode.
The available actions are:
- Running the generated command
- Copying it to the clipboard
Don't worry though, after this you will be asked to apply your selected action on every generation.
Options
Once installed, you can run CommanDeft using the commandeft command. Here are the available options:
-h, --help: Show the help message and exit.-v, --version: Show the version information and exit.-c, --configure: Configure CommanDeft (Like the one on the first run).-i, --interactive: Run CommanDeft in interactive mode.-p, --prompt "TEXT": Specify your prompt inline.
Contributing
Contributions to CommanDeft are welcome! If you encounter any issues, have suggestions for improvements, or would like to contribute code, please check out the project repository on GitHub: Repo
License
This project is licensed under the MIT License. See the LICENSE file for more details.
Feedback
If you find CommanDeft useful or have any feedback, I would love to hear from you! Please feel free to reach out and let me know how I can make this tool even better.
Metadata
Release files for commandeft 0.6.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| commandeft-0.6.1.tar.gz | 20.7 kB | Without provenance | Details for commandeft-0.6.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| commandeft-0.6.1-py3-none-any.whl | Python 3 | none | any | Details for commandeft-0.6.1-py3-none-any.whl |
Total release size: 39.0 kB
Release files / commandeft-0.6.1.tar.gz
| Download URL | commandeft-0.6.1.tar.gz |
|---|---|
| Size | 20.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b3cc69445fdf4dc4847991b7faf3ed78ecd8493ab03a0a4f1af52e4e6f26ce37
|
|
BLAKE2b-256 checksum How to use checksums |
d64540e15571b942e4fd82b0946a9a2b792f12937ed5bfd99cc10bd7842a5bf1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
pdm/2.10.1 CPython/3.11.5
|
Release files / commandeft-0.6.1-py3-none-any.whl
| Download URL | commandeft-0.6.1-py3-none-any.whl |
|---|---|
| Size | 18.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
23f80e5ce9212c644d7da3d7691e1fa37fb9a8956e1ee1950df3124e84e903cb
|
|
BLAKE2b-256 checksum How to use checksums |
27a8a0d1dc27a01bac0bb1f03d236c5a7abde7a6c212934d4aca79e2557a995a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
pdm/2.10.1 CPython/3.11.5
|
Security for commandeft 0.6.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.