Skip to main content

Use ChatGPT for quick command-line advice

Project description

PyHowDoI

A utility for quick command-line guidance from ChatGPT.

⚠️ Use at your own risk. Carefully inspect all commands before running them. ⚠️

For example:

howdoi get a list of all files modified in the last five minute

Response:

find . -type f -mmin -5

No more trips to StackOverflow or man pages for simple things!

Installation

pip install pyhowdoi

Usage

You must set the environment variable OPENAPI_API_KEY in order for this utility to function. You will be charged for any usage of the API.

howdoi <any question here>
howdoi spin up a simple HTTP server
howdoi check how much disk space is currently being used
howdoi make a cron string that runs every wednesday at 5 am
howdoi find all lines that have TODO in them

If you wish to use special characters that might normally be interpreted by the shell, you can wrap your question in quotes:

howdoi 'replace all instance of $ with € in a file'

By default, the model gpt-3.5-turbo is used, but you can override this by setting the OPENAI_CHAT_MODEL environment variable:

export OPENAI_CHAT_MODEL=gpt-4
howdoi check that the hash of a file is correct

See https://platform.openai.com/docs/models/overview for a full list of available models.

You can also pipe in standard input to provide additional context for the utility. For instance, you could pass in the help message or man page for a command:

curl -h 2>&1 | howdoi use curl to upload a file

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

pyhowdoi-1.1.2.tar.gz (3.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyhowdoi-1.1.2-py3-none-any.whl (3.8 kB view details)

Uploaded Python 3

File details

Details for the file pyhowdoi-1.1.2.tar.gz.

File metadata

  • Download URL: pyhowdoi-1.1.2.tar.gz
  • Upload date:
  • Size: 3.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.5.1 CPython/3.10.6 Darwin/22.5.0

File hashes

Hashes for pyhowdoi-1.1.2.tar.gz
Algorithm Hash digest
SHA256 04f98cca120f65488e83d356ab34e7f2437f2f3769392b0c8d29af0792e900d9
MD5 29154b967de82da7f53d3b3e1fe334c1
BLAKE2b-256 acf2bbfd5ea1caaf205c180e71aac37060d72b976acda82a71f9b1e1ae712cc7

See more details on using hashes here.

File details

Details for the file pyhowdoi-1.1.2-py3-none-any.whl.

File metadata

  • Download URL: pyhowdoi-1.1.2-py3-none-any.whl
  • Upload date:
  • Size: 3.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.5.1 CPython/3.10.6 Darwin/22.5.0

File hashes

Hashes for pyhowdoi-1.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 cfd1d09ae9f37dca6d6ad50d970835c977c08069e9d0e3159f351798726e7858
MD5 34efd3b06c3803f5bfe3de82b343ef83
BLAKE2b-256 8a8260d6e36ccf92fd03ee60cfcb6895cd0cc15c2a610fcbbe90bbdcd9ca4428

See more details on using hashes here.

Supported by

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