Repolode
air-verse

air-verse/air

Command-line tool that watches Go source files and automatically rebuilds and restarts your app during development.

Stars
24,088
Forks
928
Open issues
14
Last commit
2 months ago

What is it?

Air is a live-reload command line utility for developing Go applications. Run it in your project root and it rebuilds and restarts the program whenever source files change, so you can keep editing without manually stopping and starting the process. It is meant for development only and is unrelated to hot deployment in production.

Behavior is controlled through a .air.toml file, which can be generated with `air init`, or through command-line flags. You can set custom build and run commands, exclude directories, watch new directories while running, load .env files, and pass arguments to the built binary. Rules can run arbitrary commands, such as frontend builds or code generators like templ, instead of a full rebuild. An optional proxy injects a script into HTML responses so the browser reloads after each rebuild.

Air can be installed with go install, Homebrew, Scoop, mise, an install script, or as a Docker image, and a project can pin it with `go get -tool`.

Key features

  • 01Rebuilds and restarts the Go app automatically when files change
  • 02Configurable build and run commands via .air.toml or CLI flags
  • 03Excludes subdirectories and watches newly created directories
  • 04Watch rules run custom commands for assets or code generation
  • 05Optional proxy that reloads the browser after each rebuild
  • 06Loads .env files before building and running

Use cases

  • Developing a Go web server such as one built with gin and reloading on every save
  • Running frontend asset builds or templ/go generate steps alongside the Go app
  • Running Air inside a Docker container with the project mounted for live reload

Quick start

  1. 1

    Install Air with go install (requires Go 1.25+)

    go install github.com/air-verse/air@latest
  2. 2

    Add the Go bin directory to your PATH

    export PATH="$PATH:$(go env GOPATH)/bin"
  3. 3

    Enter your project directory and run air

    air

Things to know

  • The README states Air is for development only and is unrelated to production hot-deploy.
  • Licensed under GPL-3.0, a copyleft license that requires derivative distributions to be open source.

Topics

FAQ

What is air?
Command-line tool that watches Go source files and automatically rebuilds and restarts your app during development. Air is a live-reload command line utility for developing Go applications. Run it in your project root and it rebuilds and restarts the program whenever source files change, so you can keep editing without manually stopping and starting the process. It is meant for development only and is unrelated to hot deployment in production.
Is air free to use? What license does it have?
air is open source under the GPL-3.0 license. Check the license terms before using it in commercial products.
Is air still maintained?
Updated within 6 months. The last commit to air was on Aug 27, 2026.
What can I use air for?
Developing a Go web server such as one built with gin and reloading on every save Running frontend asset builds or templ/go generate steps alongside the Go app Running Air inside a Docker container with the project mounted for live reload
How do I install air?
Install Air with go install (requires Go 1.25+): go install github.com/air-verse/air@latest Add the Go bin directory to your PATH: export PATH="$PATH:$(go env GOPATH)/bin" Enter your project directory and run air: air
Where can I get air?
The source code and installation instructions are on GitHub: https://github.com/air-verse/air

Summary generated by AI from the project's README. GitHub stats refresh daily.

Related projects