homebrew-tap/Formula/aio.rb
2026-11-28 15:28:07 +02:00

35 lines
1.1 KiB
Ruby

# Homebrew formula for aio, the MozOut All in One AI command.
# The package is the aio-<version>.tgz asset of the api-cli release on GitHub.
class Aio < Formula
desc "Command-line client for MozOut All in One AI"
homepage "https://docs.mozout.com/cli/"
url "https://git.mozout.com/mozout-com/api-cli/releases/download/v1.0.0/aio-1.0.0.tgz"
sha256 "ee24a684ff004dc38847c0c1c8d63ee091f04a752bab9bf5f4d99a7a8cf92a14"
license "MIT"
depends_on "node"
def install
# aio is a single file with no dependencies: keep it in libexec and
# start it with the Node.js from Homebrew, whatever node is on PATH.
libexec.install "bin/aio.js"
(bin/"aio").write <<~SH
#!/bin/sh
exec "#{Formula["node"].opt_bin}/node" "#{libexec}/aio.js" "$@"
SH
chmod 0755, bin/"aio"
end
def caveats
<<~EOS
Create an API key with the ai:read and ai:write permissions in the
API Center (https://www.my.mozout.com/api-center.php), then run:
aio auth login
Or set the key in the AIO_API_KEY environment variable.
EOS
end
test do
assert_match "aio #{version}", shell_output("#{bin}/aio --version")
end
end