Skip to content

v0.8.0

Latest

Choose a tag to compare

@github-actions github-actions released this 15 Oct 14:54

Install with Homebrew

ai-usage now installs with Homebrew, on macOS and Linux:

brew install neoromantic/tap/ai-usage
ai-usage               # collect, register with launchd or cron, and print the report
ai-usage app install   # on macOS 14 and later, the menu bar app

Before ai-usage, run ai-usage team join and paste a teammate's key to join their team, and ai-usage relay set URL for your own relay. Homebrew installs the binary and nothing else, so the first ai-usage registers the 15-minute run, as the installer's first run does. Type the full name, neoromantic/tap/ai-usage, in every brew command: Homebrew trusts the tap by it, and refreshes the tap before an upgrade only when it is named. The one-line installer works as before. See Homebrew in the README.

Updates with Homebrew

A copy Homebrew installed never replaces itself: Homebrew owns its files. It still checks for releases at every run, so you know when one is out:

update  v0.8.1 is out; run brew upgrade neoromantic/tap/ai-usage or ai-usage update
  • ai-usage update runs brew upgrade neoromantic/tap/ai-usage for you, and then brings the menu bar app to the release brew installed: installed v0.8.1 with Homebrew; the next run uses it. The menu bar app's Update and Check for Updates run it too.
  • A plain brew upgrade works as well. When you run ai-usage, or the menu bar app reads the report, before the next scheduled run, it notices the upgrade, and on macOS 27 launchd refuses no scheduled run. Otherwise launchd refuses one, as after a self-update, and the next run repairs it.
  • Homebrew is a few minutes behind GitHub. The release workflow puts each release in the tap once it is published. Until then, ai-usage update says Homebrew's formula is at v0.8.0; GitHub has v0.8.1, which reaches Homebrew soon.
  • The team waits for it. A Homebrew machine updates when someone runs brew on it, not within 15 minutes, so it can hold back what the team turns on only once every machine has a release. After 7 hours on the older release, the report names it: mira-mbp runs v0.8.0 and has not updated; run ai-usage update on it.

The menu bar app with ai-usage app install

ai-usage app install adds the menu bar app of the binary's release on macOS 14 and later, whatever installed ai-usage: Homebrew, or the installer with AI_USAGE_NO_APP=1. It quits a copy that runs and opens the new one, and runs keep the app at the binary's release from then on. There is no Homebrew cask: Homebrew quarantines what a cask downloads, and macOS would refuse the app, which is not notarized.

In the app, About says "Command-Line Tool (Homebrew)" for a Homebrew install, a release that is out says "v0.8.1 is out; Update runs brew upgrade neoromantic/tap/ai-usage", and the screen shown without ai-usage adds the Homebrew command under the installer's. When an update fails, the app shows ai-usage's own error, not what brew printed before it.

The team's words for a machine that has not updated

A machine on an older release no longer "updates itself within 15 minutes": it "should update within 15 minutes", since a Homebrew machine waits for brew. One that has not, as when its update fails or Homebrew installed it, is asked for by name: leo-air runs v0.3.4 and has not updated; run ai-usage update on it, or run ai-usage update on leo-air, srv1, which have not updated. The first-run guide's invite now says a colleague runs ai-usage team join and pastes the key, or installs with it as AI_USAGE_TEAM_KEY.

JSON: how this copy updates

collector.update has method, "self" or "homebrew", and command, "brew upgrade neoromantic/tap/ai-usage" for a Homebrew copy and null otherwise, including as root. A report from an earlier release has neither; read them as "self" and null. collector.schedule.error can now be set while the schedule is registered, to say that another copy of ai-usage should go. The schema version stays 4. See docs/json-schema.md.

Switch to Homebrew, or back

From the installer to Homebrew. Remove the installer's copy, rm ~/.local/bin/ai-usage (or the path which -a ai-usage shows), and the block that starts with # Added by the ai-usage installer in your shell profile. Then brew install neoromantic/tap/ai-usage and run ai-usage. The state folder and the team key stay, so the machine stays the same device in the team.

If you keep both, the scheduler runs only Homebrew's copy: the installer's registers Homebrew's in its place and stops updating itself. ai-usage status says which copy to remove. A copy an earlier installer put in /opt/homebrew/bin or /usr/local/bin keeps brew from linking its own there; brew link --overwrite neoromantic/tap/ai-usage replaces it. Another user's Homebrew copy, in a prefix you share, leaves yours alone.

From Homebrew to the installer. brew uninstall neoromantic/tap/ai-usage, then run the installer again. Run ai-usage schedule remove before uninstalling for good; Uninstall has the Homebrew lines.

Compatibility and upgrade

What to do. Nothing, for a script install. Releases from v0.2.5 on install v0.8.0 within 15 minutes, and on a Mac the menu bar app updates with the binary.

The installer. install.sh stops when Homebrew installed ai-usage for the user who runs it, and says to use brew upgrade instead, unless AI_USAGE_BIN_DIR is set. A new install no longer goes into /opt/homebrew/bin or /usr/local/bin, which are Homebrew's: it goes into ~/.local/bin or ~/bin. A copy already in one of them is still upgraded where it is.

Homebrew starts at v0.8.0. The tap has no older release: a binary before v0.8.0 does not know Homebrew installed it, and would replace itself inside Homebrew's folders.

State. The state folder keeps ran_version, the release of the last run. The snapshot and the relay do not change, and the menu bar app keeps its settings.

For the website

This release changes claims of the README, its install commands, and what it says of the menu bar app:

  • a second install command, brew install neoromantic/tap/ai-usage, beside the one-line installer, with ai-usage app install for the menu bar app;
  • updates: self-update cannot be turned off for a script install, and a Homebrew install updates with brew upgrade or ai-usage update; the Highlights line now says so;
  • the menu bar app comes with the installer or with ai-usage app install, not only with the installer;
  • the team's words for a machine on an older release, and the first-run guide's invite, which show in the pictures team.png, team-light.png, team-80.png, team-devices.png, team-bots.png, team-status.png, install.png, and the tour in docs/demo.

Known limitations

  • Homebrew machines update only when someone runs brew upgrade or ai-usage update on them, and the snapshot does not say which machines Homebrew installed. The team sees such a machine as one that has not updated.
  • Homebrew installs are per-user. As root, ai-usage update refuses, and the report has no command.
  • brew uninstall without ai-usage schedule remove first leaves the launch agent or crontab line behind, which fails silently every 15 minutes. The README says how to remove it by hand.
  • On macOS 27, launchd running Homebrew's linked path after brew upgrade has been reasoned through, and is repaired as after a self-update, but not yet watched on a real upgrade.
  • Windows has no Homebrew; install.ps1 is unchanged.

Full Changelog: v0.7.0...v0.8.0