Shell Whiz: AI assistant right in your terminal
Project description
Shell Whiz is an AI assistant for the command line. It will help you find the right command for your task.
All features
- Command suggestions: It suggests shell commands based on your input. For example, if you want to know the timestamp of a file, you can run
?? what is the timestamp of file.txt
and it will suggeststat -c %y file.txt
, which will print the last modification time of the file. - Command explanations: It will try to explain, piece by piece, what the suggested command will do, so you can learn new things about your shell and the commands you use.
- Revisions: If the suggested command is not exactly what you need, you are on a different platform, or you want to see other options, you can ask for a revision. It will suggest a different command that is similar to the previous one.
Supported platforms
Shell Whiz is designed to work on various platforms and shells, but it is best suited for Bash on Linux. However, it may sometimes suggest commands that are not compatible with your specific platform or terminal. If this happens, feel free to request a revision.
Installation and setup
To install Shell Whiz, run the following command:
pip install shell-whiz
This will add the sw
command to your PATH.
To use Shell Whiz, you need an API key from OpenAI. You can obtain this key by visiting https://platform.openai.com/account/api-keys. Once you have the key, you can configure Shell Whiz by running the following command:
sw config
Free API plan for new users
New users receive $5 for free to try and test the API during the first 3 months. However, it is recommended to upgrade to a paid plan in order to have a more comfortable experience using Shell Whiz. This is because the free plan has restrictions on the number of requests allowed per minute.
Upgrading
To upgrade Shell Whiz, run the following command:
pip install --upgrade shell-whiz
Usage
You can run Shell Whiz directly using sw ask
, but I recommend creating an alias for it. For example, you can add the following line to your ~/.bashrc
file:
alias ??='sw ask'
To track API usage and costs, you can check the OpenAI API Usage page.
Tips
- If you want to pass an argument that starts with a hyphen, you can use
--
to separate the command from the arguments. For example,sw ask -- emulate ARM kernel on versatilepb architecture -cpu cortex-a8
. - Add
-m gpt-4
or--model gpt-4
to use thegpt-4
model instead of the standardgpt-3.5-turbo
model. However, this will cost more and may take longer. - Add
--explain-using-gpt-4
to use thegpt-4
model for the explanatory part. - Use
-n
or--dont-explain
to disable automatic explanations. You can still request an explanation through the menu when a command is suggested.
The original author of the program usually uses alias ??='sw ask -n --'
because he has a good understanding of the command line, but if he doesn't understand the generated command he chooses to explain it using GPT-4 via the menu. You can choose the settings that work best for you.
More examples
License
Shell Whiz is licensed under the GNU General Public License v3.0.
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
Hashes for shell_whiz-0.7.7-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | dfce8f363ad7051b8c28fb185d2aa59c8b4a4f93e98e7979b72ae0bb94b9f89d |
|
MD5 | 0917f2d8e00192df485d38506f87745a |
|
BLAKE2b-256 | 9ade3e765821a6e7055789194c9c0508f46dd6eda9531e941e32c2445b173d23 |