Air watches Go project files and rebuilds your application when sources change, then restarts the binary so you can keep coding. It targets local development, not production hot deploy.
Overview
Air runs from your project root as a long-lived command that monitors configured directories and file patterns. When matching files change, it runs your build steps and launches the compiled program again, optionally forwarding extra arguments to the binary.
Behavior is controlled through a TOML configuration file, which you can generate with an init command or override partially from the command line. Settings cover build and run commands, directory excludes, colored logs, debounced watches, and loading variables from configured dotenv files. Platform-specific build blocks can differ on Windows, macOS, and Linux.
Watch rules let certain file changes trigger auxiliary commands—such as code generators or frontend asset pipelines—without a full rebuild, while a proxy mode can refresh the browser after successful rebuilds by forwarding HTTP traffic and injecting a small reload script into HTML responses.
Installation paths include Go toolchain installs, package managers, shell installers, and an official container image for running Air inside Docker or Podman workflows, including compose setups that mount the project tree into the container.
Key features
- File watching with rebuild
- Configurable build and run commands
- TOML configuration file
- Watch rules for side commands
- Browser reload proxy mode
- Dotenv loading support
- Platform-specific build overrides
- Official Docker image
Use cases
- Local Go web app development
- Auto-restart after code edits
- Generator pipelines on file save
- Dockerized dev environments
- Gin and similar framework workflows