Meet hai, a tiny CLI tool that turns natural language into shell commands. You describe what you want to do, hai suggests a command, and asks if you'd like to run it. A simple, unix-y tool that does one thing /really/ well.
$ hai "use pandoc to convert all the markdown files in this directory to an ebook"
Command: pandoc -f markdown -t epub -o book.epub *.md
✔ Looks good?
Just describe what you want:
hai "copy all txt files to the backup directory"
Or pipe stuff into it hai
:
cat some-file | hai
Some more examples:
$ hai "find and delete all log files"
Command: find . -name "*.log" -delete
$ hai "list all running docker containers"
Command: docker ps
$ hai "find all jpg files and resize them to 800px wide"
Command: find . -name "*.jpg" -print0 | xargs -0 mogrify -resize 800x
$ hai "search all markdown files for TODO and save the results to todos.txt"
Command: grep -r "TODO" *.md > todos.txt
Full documentation is available in the man pages:
- hai(1) - Main command documentation
- hai-config(5) - Configuration file documentation
All installation methods include these man pages, which are installed to
standard system locations and can be accessed with man hai
and man hai-config
after installation.
The easiest way to install hai on macOS or Linux is using the shell installer:
# Install the latest version
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/gregbell/hai/releases/latest/download/hai-installer.sh | sh
This will install hai to ~/.local/bin
(following XDG standards) and man pages to standard system locations.
For Windows users, you can install hai using PowerShell:
# Install the latest version
irm https://github.com/gregbell/hai/releases/latest/download/hai-installer.ps1 | iex
# Add the tap and install
brew tap gregbell/tap/hai
You can download pre-built binaries for your platform from the GitHub Releases page.
-
Clone the repository:
git clone https://github.com/gregbell/hai.git cd hai
-
Build and install:
# Build and install to ~/.local/bin (XDG standard location) make local-install # Or for a system-wide installation sudo make install
-
Run hai for the first time to set up your configuration:
hai
This will guide you through setting up your configuration and API keys.
We would love your help with Hai! If you want to discuss Hai, The best place is the Github discussions: https://github.com/gregbell/hai/discussions.
If you run into a bug or want to contribute with code, open an issue or PR. We'd love to see them.
hai is written in Rust. To build from source:
git clone https://github.com/gregbell/hai.git
cd hai
# Install pandoc (required for building man pages)
# On Debian/Ubuntu: apt-get install pandoc
# On macOS: brew install pandoc
# On Windows: choco install pandoc
# Build the application and documentation
make
# Run tests
make test
# Build only the documentation
make doc
# Clean build artifacts
make clean
To create a release, simply tag the version in git and push the tag:
git tag v0.2.0
git push origin v0.2.0
This will trigger GitHub Actions workflows that will:
- Build the application for all supported platforms
- Create release artifacts (tarballs, installers, etc.)
- Publish the release on GitHub
The make release
command is still available for local testing:
make release VERSION=0.2.0
To bump the version across all project files:
make bump-version VERSION=0.2.0
This will update the version number in:
- Cargo.toml
- Documentation files
- Test files
- README.md
- CHANGELOG.md (adds a new entry)
After running this command, you should:
- Review and update the CHANGELOG.md with the new features/fixes
- Commit the changes
- Create a release when ready
This project is Copyright 2025 Greg Bell and licensed under the GPL-3.0. See LICENSE.