Getting started with Ahoy
Install
Section titled “Install”brew install ahoyos=$(uname -s | tr '[:upper:]' '[:lower:]') && architecture=$(case $(uname -m) in (x86_64 | amd64) echo "amd64" ;; (aarch64 | arm64 | armv8*) echo "arm64" ;; (armv7*) echo "armv7" ;; (armv6*) echo "armv6" ;; esac) && { [ -n "$architecture" ] || { echo "Unsupported architecture: $(uname -m)" >&2; false; }; } && sudo wget -q https://github.com/ahoy-cli/ahoy/releases/latest/download/ahoy-bin-$os-$architecture -O /usr/local/bin/ahoy && sudo chown $USER /usr/local/bin/ahoy && chmod +x /usr/local/bin/ahoyOr download the latest release from GitHub and put the binary somewhere in your $PATH.
Use the Linux instructions.
Before you run it, we recommend you verify your download. Then check it works:
ahoy --versionStart with the examples
Section titled “Start with the examples”The fastest way in is the examples file, which has around 30 commands for common development jobs:
cd my-projectahoy config initThis creates an .ahoy.yml in the current directory. Run ahoy on its own to see what’s in it:
ahoyWrite your own commands
Section titled “Write your own commands”Create an .ahoy.yml file in your project root:
ahoyapi: v2
commands: hello: usage: Say hello to someone cmd: echo "Hello, $1!"
start: usage: Start the dev environment cmd: docker-compose up -d
logs: usage: Follow container logs cmd: docker-compose logs -f "$@"Then run them:
ahoy hello World # Hello, World!ahoy startahoy logs webahoy # Lists all commands with their usage textAhoy looks for .ahoy.yml in the current directory and then each parent directory, so these work from anywhere inside the project.
Verifying your download
Section titled “Verifying your download”Homebrew checks each download against the SHA-256 in its formula, so there’s nothing extra to do if you used brew install. If you install the binary yourself, download it, check it, then install the file you checked.
Each release includes an ahoy_<version>_checksums.txt file with a SHA-256 checksum for every file in the release. From v3.0.2, that file is also signed with cosign. Set FILE to the binary for your platform, such as ahoy-bin-darwin-arm64 on an Apple Silicon Mac:
VERSION=3.0.2FILE=ahoy-bin-linux-amd64BASE=https://github.com/ahoy-cli/ahoy/releases/download/v$VERSION
curl -fsSLO $BASE/$FILEcurl -fsSLO $BASE/ahoy_${VERSION}_checksums.txtcurl -fsSLO $BASE/ahoy_${VERSION}_checksums.txt.bundle
cosign verify-blob ahoy_${VERSION}_checksums.txt \ --bundle ahoy_${VERSION}_checksums.txt.bundle \ --certificate-identity "https://github.com/ahoy-cli/ahoy/.github/workflows/release.yml@refs/tags/v${VERSION}" \ --certificate-oidc-issuer https://token.actions.githubusercontent.com \ && sha256sum -c ahoy_${VERSION}_checksums.txt --ignore-missing \ && sudo install -m 755 $FILE /usr/local/bin/ahoyEach step only runs if the one before it passed:
cosignchecks that Ahoy’s own release workflow made the checksums file, for the version you asked for. A signature from any other tag or branch fails.sha256sumchecks your binary against that checksums file.--ignore-missingchecks only the files you downloaded.installputs that same binary in/usr/local/bin.
On macOS, use shasum -a 256 -c instead of sha256sum -c.
There’s no public key to download, because cosign signing here is keyless: the signature records which workflow and tag made it. The signature matters because a checksum shows a file is intact, but not who made it. Someone who could replace the binary could replace the checksums file too.
Releases before v3.0.2
Section titled “Releases before v3.0.2”v3.0.1 has checksums but no signature, so you can only do the checksum step:
VERSION=3.0.1FILE=ahoy-bin-linux-amd64BASE=https://github.com/ahoy-cli/ahoy/releases/download/v$VERSION
curl -fsSLO $BASE/$FILEcurl -fsSLO $BASE/ahoy_${VERSION}_checksums.txt
sha256sum -c ahoy_${VERSION}_checksums.txt --ignore-missing \ && sudo install -m 755 $FILE /usr/local/bin/ahoyIn v3.0.0 and earlier, the checksums file only lists the .tar.gz and .zip archives and SBOMs, so you can’t check the ahoy-bin-* binary on its own.
Next steps
Section titled “Next steps”- Writing commands: arguments, aliases and longer scripts
- Shell autocompletion: set up tab completion
- YAML schema: every field in
.ahoy.yml - CLI reference: flags and built-in commands