Shell Genie is a command-line tool that lets you interact with the terminal in plain English. You ask the genie what you want to do and it will give you the command you need.
Project description
🧞♂️ Shell Genie
Your wishes are my commands.
Shell Genie is a command-line tool that lets you interact with the terminal in plain English. You ask the genie what you want to do and it will give you the command you need.
Installation
The recommended way to install Shell Genie is using pipx:
- Install Python 3.10 or higher.
- Install pipx.
- Install Shell Genie:
pipx install shell-genie
Alternatively, you can install it using pip:
- Install Python 3.10 or higher.
- Create a virtual environment in your preferred location:
python -m venv .venv
- Activate the virtual environment:
source .venv/bin/activate
- Install Shell Genie:
pip install shell-genie
How to use
-
First, you need to initialize the tool by running the following command:
shell-genie init
This will prompt you to select a backend (either
openai-gpt3.5-turbo
orfree-genie
) and provide any additional information that is required (e.g. your own OpenAI API key foropenai-gpt3.5-turbo
).The
free-genie
backend is free to use. I'm hosting it, and as you can imagine I'm not a big corporation with unlimited money, so there's no guarantee that it will be available at all times. My goal is to generate a dataset of commands to fine-tune a model later on (this is mentioned during the initialization process). -
Once you have initialized the tool, you can start asking the genie what you want to do. For example, you may ask it to find all the
json
files in the current directory that are larger than 1MB:shell-genie ask "find all json files in the current directory that are larger than 1MB"
You'll see an output similar to this:
Command: find . -name "*.json" -size +1M Do you want to run this command? [y/n]:
If you have questions about how the command works, you can ask the genie to explain it:
shell-genie ask "find all json files in the current directory that are larger than 1MB" --explain
And you'll see an output similar to this:
Command: find . -name "*.json" -size +1M Description: This command will search the current directory for all... (shortened for brevity) Do you want to run the command? [y/n]:
You can ask for commands in English or other languages, and the genie will try to provide you with a explanation in the same language.
-
Run the command if you want to. If you're using
free-genie
, and you want to help improve the tool, you can provide feedback after you've run the command.
Using an alias
If you find that writing shell-genie ask
is too verbose, you can create an alias for the tool:
echo "alias please='shell-genie ask'" >> ~/.bashrc
source ~/.bashrc
And now you can ask the genie using please
:
please "find all json files in the current directory that are larger than 1MB"
Examples
Here are two short videos showing how to use the tool:
Limitations
As you can imagine not all the commands provided by the genie work as expected. Use them at your own risk.
License
This project is licensed under the terms of the MIT license.
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
File details
Details for the file shell_genie-0.2.10.tar.gz
.
File metadata
- Download URL: shell_genie-0.2.10.tar.gz
- Upload date:
- Size: 6.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.3.2 CPython/3.10.4 Darwin/22.3.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | cfb2e202ada32f3aa383843fafda3b33a55b79d793df83723e981cb5fa81a7ef |
|
MD5 | efb85afbd7aab305ed31179bbb108bac |
|
BLAKE2b-256 | 639d2569d965fc66112aeb8b0ffa1add6bc4456a1bb74413dff92424c32f6993 |
File details
Details for the file shell_genie-0.2.10-py3-none-any.whl
.
File metadata
- Download URL: shell_genie-0.2.10-py3-none-any.whl
- Upload date:
- Size: 7.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.3.2 CPython/3.10.4 Darwin/22.3.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 319768ce9ed3ccdcabaf94fbdead931fcaa8ee191900123268bbe0add930926e |
|
MD5 | 70476b8a6d4a3f15fa120a1d5ee17d3c |
|
BLAKE2b-256 | 3fb8110789266d62c03805f8ca799e9a4b3f237d8c83643e7c323b0187a716ce |