Skip to main content

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>
Sure, what do you need help with?

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

uh_halp-0.1.1.tar.gz (6.1 kB view details)

Uploaded Source

Built Distribution

uh_halp-0.1.1-py3-none-any.whl (7.6 kB view details)

Uploaded Python 3

File details

Details for the file uh_halp-0.1.1.tar.gz.

File metadata

  • Download URL: uh_halp-0.1.1.tar.gz
  • Upload date:
  • Size: 6.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.13

File hashes

Hashes for uh_halp-0.1.1.tar.gz
Algorithm Hash digest
SHA256 4b5e97f6f0a57ebc79874bb4bc0efcffa89b9b1d3ae9f4599e7344e14ce638b7
MD5 7b2dc62eb0b8f2b2c9652c5abaf0df90
BLAKE2b-256 13bba6febb74427a4f22a294f4c8fa55c6103b9309c7ded710f88929562c01ca

See more details on using hashes here.

File details

Details for the file uh_halp-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: uh_halp-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 7.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.13

File hashes

Hashes for uh_halp-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 8a0cc5a1896ce6ccc7cf28ab22fd37e53237dd5dcffd8a524f8f686692e45132
MD5 a91d87e1e32c29008432831bfc43c15d
BLAKE2b-256 1983a2a2a81fbf4c9307d9f4eda70cac49f2ac201ff5d0b829a98e5286e0c395

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page