---
title: Getting Started with Ahoy
description: Install Ahoy and run your first commands
---
import { Tabs, TabItem } from "@astrojs/starlight/components";
import { Aside } from "@astrojs/starlight/components";
## Installation
```bash
brew install ahoy
```
```bash
os=$(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/ahoy
```
Or download the [latest release from GitHub](https://github.com/ahoy-cli/ahoy/releases) and place the binary somewhere in your `$PATH`.
Use the Linux instructions above.
For security's sake, please [verify your download](#verifying-your-download).
Then verify that `ahoy` is working:
```bash
ahoy --version
```
## Start with examples
The quickest way to get going is to initialise a project with our curated examples file. It includes 20+ ready-to-use commands for common development workflows.
```bash
cd my-project
ahoy config init
```
This creates an `.ahoy.yml` in the current directory. Run `ahoy` on its own to see what's available:
```bash
ahoy
```
## Write your own commands
Create an `.ahoy.yml` file in your project root:
```yaml
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 "$@"
```
Run your commands from anywhere in the project tree:
```bash
ahoy hello World # Hello, World!
ahoy start
ahoy logs web
ahoy # Shows all commands and their usage text
```
## 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__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](https://docs.sigstore.dev/). Set `FILE` to the binary for your platform, such as `ahoy-bin-darwin-arm64` on an Apple Silicon Mac:
```bash
VERSION=3.0.2
FILE=ahoy-bin-linux-amd64
BASE=https://github.com/ahoy-cli/ahoy/releases/download/v$VERSION
curl -fsSLO $BASE/$FILE
curl -fsSLO $BASE/ahoy_${VERSION}_checksums.txt
curl -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/ahoy
```
Each step only runs if the one before it passed:
1. `cosign` checks 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.
2. `sha256sum` checks your binary against that checksums file. `--ignore-missing` checks only the files you downloaded.
3. `install` puts 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
v3.0.1 has checksums but no signature, so you can only do the checksum step:
```bash
VERSION=3.0.1
FILE=ahoy-bin-linux-amd64
BASE=https://github.com/ahoy-cli/ahoy/releases/download/v$VERSION
curl -fsSLO $BASE/$FILE
curl -fsSLO $BASE/ahoy_${VERSION}_checksums.txt
sha256sum -c ahoy_${VERSION}_checksums.txt --ignore-missing \
&& sudo install -m 755 $FILE /usr/local/bin/ahoy
```
In 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
- [Writing Commands](/guides/writing-commands) - practical patterns and real-world examples
- [Shell Autocompletion](/guides/shell-autocompletion) - set up tab completion
- [YAML Schema Reference](/reference/yaml-schema) - complete field-by-field reference
- [CLI Reference](/reference/cli) - all command-line flags and built-in commands