Skip to content

catallo/ht

Repository files navigation

ht - a shell command that answers your questions about shell commands.

ht_demo_2.3.4.mp4

ht is a shell helper tool focused on simplicity that can generate, explain and execute shell commands using AI.

Usage
  • ht <instruction> - answers with shell command

  • ht e|explain - explains last answer

  • ht e|explain  [command] - explains command

  • ht x|execute - executes last answer

Examples
  • ht find all IPv4 addresses in file A and write to file B
  • ht explain
  • ht explain ls -lS
  • ht explain "ps -aux | grep nvidia"
  • ht execute

Features

  • Low token usage
  • Cached responses
  • Easy installation (no root required)
  • Automatic updates
About

I initially created ht as a simple experiment to test GPT3's usefulness with shell commands. However, I now find myself using it extensively in my daily tasks. So I'm sharing it with the hope that it can benefit others in the same way. It's using OpenAI's GPT3.5-Turbo model now and I plan to add more models in the future, including locally running models.

ht is written in Dart. As a result, it is compiled into a single, self-contained binary. This means that the ht binary operates independently without requiring any external dependencies or runtime environments. Linux (x86_64) and MacOS (arm64 & Intel) binaries are available for download.

To use ht, you'll need an OpenAI API key. The good news is that due to ht's low token usage, a typical request costs about $0.00025, making it an incredibly budget-friendly tool for daily usage. You can sign up for an API key here or refer to this article for detailed instructions.

Privacy

ht communicates directly with OpenAI's API, without involving a third-party server. For automated updates to work, ht will send a request to the GitHub API to check for new releases.

Installation
  1. Download the archive for your platform from the Downloads section below.
  2. Unzip the archive.
  3. Using a terminal, navigate to the directory containing the ht binary and run it with the -i flag to start the installation process.
cd Downloads
./ht_2-0-3_linux64 -i

ht will be installed to '~/.config/ht' and the directory will be added to your PATH. Future updates will be installed automatically.

Downloads