Putting Hoi to use

By Kevin , May 22nd, 2025

In my last post I mentioned releasing a small project in Rust called Hoi, a task runner meant for collaboration or personal use. Since then I was able to add a few more features, nearing a point which I consider 'feature complete':

  • Run unit and integration tests under Linux, Mac and Windows instead of just Linux
  • Refactor test code to use fixtures and temp directories more efficiently
  • Better support of $HOME directory differences on Unix and Windows systems
  • Better support of canonical or symlink paths on Unix or Windows systems
  • Added a global init command to spawn a boilerplate .hoi.yml file in the current directory
  • Added support for loading and using values from a .env/.env.local file at the same level of a .hoi.yml file in a directory

It works great for me on Linux (Fedora 42) and MacOS. From the integration tests that run under windows-latest in GitHub Actions, I assume it works under Windows too. I don't have a good way to test that myself yet. I assume if it did not, the integration tests would fail.

The most rewarding part of this to me is winding up with software I can now use for myself. Here is an example.

I use command-line on some systems to control connection to VPN. These command line statements can get pretty long and I am relying on zsh history to store it and basically not forget. It is a pain to type out.

Using hoi init in my $HOME/.hoi directory, I created a .hoi.global.yml file. Inside of it, I added the following:

version: 1
description: "Global commands for my personal workstation."
commands:
  vpn:
    cmd: sudo openfortivpn VPN_HOSTNAME:VPN_PORT --username=VPN_USERNAME --realm=sso --cookie=$(/path/to/openfortivpn-webview.AppImage  --url 'https://VPN_HOSTNAME:VPN_PORT/VPN_REALM' | sed -n 's/^SVPNCOOKIE=\(.*\)$/\1/p')
    description: "Connect to the default VPN."

You may recall this command from this other recent article. Now, when I want to connect to the VPN, I can just type this:

hoi vpn

Instead of sudo openfortivpn... incantation. It keeps the command saved in one spot for easy editing instead of the various versions in my zsh history. I can keep adding from here for common commands I use and always know what I have available to use anywhere in my system.

I don't know how much more I could really add to Hoi, I think it does quite a bit and I met most of the goals I set out to hit with the project. It has over 1500 downloads now, which is surprising.

I would love to continue building and writing with Rust, it seems to be a super interesting language and highly effective.

Tags