Get command line help using AI
Project description
uh halp
Install:
pip install uh-halp
Configure:
$ uh reverse file.txt
>>> Need an openai key, it'll be saved to ~/.uh-key: <paste here>
>> Saving openai key to ~/.uh-keys
tac file.txt
Usage:
$ uh check my syslog
tail -f /var/log/syslog
$ uh clean up docker disk space
docker system prune -a
$ uh sync this shit to /home/gaz/project on gaz@server
rsync -avz --progress . gaz@server:/home/gaz/project
$ uh how much space have I got free here?
df -h .
$ uh gimme a socks proxy on 192.168.0.1
ssh -D 8080 username@192.168.0.1
$ uh check if the internet is up
ping -c 3 google.com
$ uh make annoying beeping noises randomly in the background forever
while true; do echo -e "\a"; sleep $((RANDOM % 10)); done &
Notes
It currently defaults to OpenAI. If you want to use something else, open
~/.uh-config.json
and change current
and edit the config. If you want
to add your own custom back-end, give the name of a module that has a
query
function in it, then fill in the parameters with templates vars
in the example format. Use {key}
as one of the params to send the key
wherever you like (postdata, query param, cookie or other header).
Look before you paste. There's no protection against doing things like
$(uh how do I break this computer?)
. So please don't just execute its
output!
Seems to work well in bash and zsh on Linux and macOS. It's not had much testing elsewhere else. Windows, BSD, Solaris, zOS etc should also work.
Disclaimer
If it blows your machine up it's your own fault. Don't run code produced by a language model without reading it.
License
WTFPL with one additional clause: don't blame me!
Project details
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 uh_halp-0.1.4.tar.gz
.
File metadata
- Download URL: uh_halp-0.1.4.tar.gz
- Upload date:
- Size: 6.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 48616e3341d5b640e1090a3db9a26d57bf5a793b0b923c59f8b2ff9e7fb4b048 |
|
MD5 | 1b6ac78cf931321d2d3b5e11b077e8e8 |
|
BLAKE2b-256 | 492062ea481c933672138997c05c6333d04c05480cbc207d7998e3bf43e27a36 |
File details
Details for the file uh_halp-0.1.4-py3-none-any.whl
.
File metadata
- Download URL: uh_halp-0.1.4-py3-none-any.whl
- Upload date:
- Size: 8.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6722aeeef63099e7eba7408f40d273b1e30f8a81fd9802c71414ca5a9de8737f |
|
MD5 | cb1d2cd587a65fb6639b1ffd22a720dc |
|
BLAKE2b-256 | 50d4de1b20785199bc4bae36a900341d9cca9bf531b36328706c180f36773d97 |