Skip to content

"Get directions for how to do anything in the terminal. Powered by ChatGPT. Like TLDR, but smarter."

License

Notifications You must be signed in to change notification settings

richbai90/howto

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Welcome to HowTo 👋

Version License: MIT

Get directions for how to do anything in the terminal. Powered by ChatGPT. Like TLDR, but smarter.

Install

cargo install howtoshell

Usage

howtoshell query "unpack a tar.gz file"

Advanced Usage

The howtoshell command has two subcommands, query and auth. The auth subcommand has two additional subcommands, login and logout.

Log in to the ChatGPT API

The login subcommand is used to log in to the ChatGPT API and only needs to be run once.

$ howtoshell auth login

Log out of the ChatGPT API

The logout subcommand is used to log out of the ChatGPT API and clear the API key from the local machine.

$ howtoshell auth logout

Query the ChatGPT API

The query subcommand is used to get directions on how to do something in the terminal. The query takes a single argument, which can be a word or a phrase.

$ howtoshell query "unpack a tar.gz file"

Internally, the query is prefixed with the phrase Provide a command to do the following in a terminal: to limit the context of the query to commands in the terminal.

The response from the ChatGPT API will be printed to the terminal.

Alias

After installing the howto command, you can add an alias to your shell's configuration file to make it easier to use. For example, if you use bash, you can add the following to your ~/.bashrc file:

alias howto="howtoshell query"

Then you can run the command like this (in a new terminal session):

$ howto "unpack a tar.gz file"

Getting an API key

For the howtoshell command to work, you need to get an API key for the OpeanAI API. Once you've signed up for an account, you can create an API key by going to the API Keys page and generating a new API. Currently the API key comes with $18.00 of free credits, which should be enough to run the howtoshell command for a while. After the free credits are used up, the cost is $0.002 / 1K tokens. For more information on tokens and how to count them, see this OpenAI API article.


Author

👤 Rich Baird

Show your support

Give a ⭐️ if this project helped you!


This README was generated with ❤️ by readme-md-generator

About

"Get directions for how to do anything in the terminal. Powered by ChatGPT. Like TLDR, but smarter."

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages