[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-4761":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":17,"stars7d":18,"stars30d":19,"stars90d":16,"forks30d":16,"starsTrendScore":15,"compositeScore":20,"rankGlobal":10,"rankLanguage":10,"license":21,"archived":22,"fork":22,"defaultBranch":23,"hasWiki":22,"hasPages":22,"topics":24,"createdAt":10,"pushedAt":10,"updatedAt":33,"readmeContent":34,"aiSummary":35,"trendingCount":16,"starSnapshotCount":16,"syncStatus":36,"lastSyncTime":37,"discoverSource":38},4761,"air","air-verse\u002Fair","air-verse","☁️ Live reload for Go apps","",null,"Go",23665,917,80,23,0,4,32,148,43.89,"GNU General Public License v3.0",false,"master",[25,26,27,28,29,30,31,32],"docker","file-watcher","gin","go","live-reload","task-runner","tools","watcher","2026-06-12 02:01:03","# :cloud: Air - Live reload for Go apps\n\n[![Go](https:\u002F\u002Fgithub.com\u002Fair-verse\u002Fair\u002Factions\u002Fworkflows\u002Frelease.yml\u002Fbadge.svg)](https:\u002F\u002Fgithub.com\u002Fair-verse\u002Fair\u002Factions?query=workflow%3AGo+branch%3Amaster) [![Codacy Badge](https:\u002F\u002Fapp.codacy.com\u002Fproject\u002Fbadge\u002FGrade\u002Fdcb95264cc504cad9c2a3d8b0795a7f8)](https:\u002F\u002Fwww.codacy.com\u002Fgh\u002Fair-verse\u002Fair\u002Fdashboard?utm_source=github.com&utm_medium=referral&utm_content=air-verse\u002Fair&utm_campaign=Badge_Grade) [![Go Report Card](https:\u002F\u002Fgoreportcard.com\u002Fbadge\u002Fgithub.com\u002Fair-verse\u002Fair)](https:\u002F\u002Fgoreportcard.com\u002Freport\u002Fgithub.com\u002Fair-verse\u002Fair) [![codecov](https:\u002F\u002Fcodecov.io\u002Fgh\u002Fair-verse\u002Fair\u002Fbranch\u002Fmaster\u002Fgraph\u002Fbadge.svg)](https:\u002F\u002Fcodecov.io\u002Fgh\u002Fair-verse\u002Fair)\n\n![air](docs\u002Fair.png)\n\nEnglish | [简体中文](README-zh_cn.md) | [繁體中文](README-zh_tw.md) | [日本語](README-ja.md)\n\n## Motivation\n\nWhen I started developing websites in Go and using [gin](https:\u002F\u002Fgithub.com\u002Fgin-gonic\u002Fgin) framework, it was a pity\nthat gin lacked a live-reloading function. So I searched around and tried [fresh](https:\u002F\u002Fgithub.com\u002Fpilu\u002Ffresh), it seems not much\nflexible, so I intended to rewrite it better. Finally, Air's born.\nIn addition, great thanks to [pilu](https:\u002F\u002Fgithub.com\u002Fpilu), no fresh, no air :)\n\nAir is yet another live-reloading command line utility for developing Go applications. Run `air` in your project root directory, leave it alone,\nand focus on your code.\n\nNote: This tool has nothing to do with hot-deploy for production.\n\n## Features\n\n- Colorful log output\n- Customize build or any command\n- Support excluding subdirectories\n- Allow watching new directories after Air started\n- Better building process\n- Configurable `.env` file loading\n\n### Overwrite specify configuration from arguments\n\nSupport air config fields as arguments:\n\nYou can view the available command-line arguments by running the following commands:  \n\n```\nair -h\n```\nor  \n```\nair --help\n```\n\nIf you want to config build command and run command, you can use like the following command without the config file:\n\n```shell\nair --build.cmd \"go build -o bin\u002Fapi cmd\u002Frun.go\" --build.entrypoint \".\u002Fbin\u002Fapi\"\n```\n\nUse a comma to separate items for arguments that take a list as input:\n\n```shell\nair --build.cmd \"go build -o bin\u002Fapi cmd\u002Frun.go\" --build.entrypoint \".\u002Fbin\u002Fapi\" --build.exclude_dir \"templates,build\"\n```\n\n## Installation\n\n### Via `go install` (Recommended)\n\nWith go 1.25 or higher:\n\n```shell\ngo install github.com\u002Fair-verse\u002Fair@latest\n```\n\n### Via `go get -tool` (project install)\n\nWith go 1.25 or higher:\n\n```shell\ngo get -tool github.com\u002Fair-verse\u002Fair@latest\n\n# then use it like so:\ngo tool air -v\n```\n\n### Via install.sh\n\n```shell\n# binary will be $(go env GOPATH)\u002Fbin\u002Fair\ncurl -sSfL https:\u002F\u002Fraw.githubusercontent.com\u002Fair-verse\u002Fair\u002Fmaster\u002Finstall.sh | sh -s -- -b $(go env GOPATH)\u002Fbin\n\n# or install it into .\u002Fbin\u002F\ncurl -sSfL https:\u002F\u002Fraw.githubusercontent.com\u002Fair-verse\u002Fair\u002Fmaster\u002Finstall.sh | sh -s\n\nair -v\n```\n\n### Via [goblin.run](https:\u002F\u002Fgoblin.run)\n\n```shell\n# binary will be \u002Fusr\u002Flocal\u002Fbin\u002Fair\ncurl -sSfL https:\u002F\u002Fgoblin.run\u002Fgithub.com\u002Fair-verse\u002Fair | sh\n\n# to put to a custom path\ncurl -sSfL https:\u002F\u002Fgoblin.run\u002Fgithub.com\u002Fair-verse\u002Fair | PREFIX=\u002Ftmp sh\n```\n\n### Via [Homebrew](https:\u002F\u002Fgithub.com\u002FHomebrew\u002Fbrew)\n\n```shell\nbrew install go-air\n```\n\n### Using software package manager [mise](https:\u002F\u002Fgithub.com\u002Fjdx\u002Fmise)\n\n```shell\nmise use -g air\n```\n\n### Docker\u002FPodman\n\nPlease pull this Docker image [cosmtrek\u002Fair](https:\u002F\u002Fhub.docker.com\u002Fr\u002Fcosmtrek\u002Fair).\n\n```shell\ndocker\u002Fpodman run -it --rm \\\n    -w \"\u003CPROJECT>\" \\\n    -e \"air_wd=\u003CPROJECT>\" \\\n    -v $(pwd):\u003CPROJECT> \\\n    -p \u003CPORT>:\u003CAPP SERVER PORT> \\\n    cosmtrek\u002Fair\n    -c \u003CCONF>\n```\n\n#### Docker\u002FPodman .${SHELL}rc\n\nif you want to use air continuously like a normal app, you can create a function in your ${SHELL}rc (Bash, Zsh, etc…)\n\n```shell\nair() {\n  podman\u002Fdocker run -it --rm \\\n    -w \"$PWD\" -v \"$PWD\":\"$PWD\" \\\n    -p \"$AIR_PORT\":\"$AIR_PORT\" \\\n    docker.io\u002Fcosmtrek\u002Fair \"$@\"\n}\n```\n\n`\u003CPROJECT>` is your project path in container, eg: \u002Fgo\u002Fexample\nif you want to enter the container, Please add --entrypoint=bash.\n\n\u003Cdetails>\n  \u003Csummary>For example\u003C\u002Fsummary>\n\nOne of my project runs in Docker:\n\n```shell\ndocker run -it --rm \\\n  -w \"\u002Fgo\u002Fsrc\u002Fgithub.com\u002Fcosmtrek\u002Fhub\" \\\n  -v $(pwd):\u002Fgo\u002Fsrc\u002Fgithub.com\u002Fcosmtrek\u002Fhub \\\n  -p 9090:9090 \\\n  cosmtrek\u002Fair\n```\n\nAnother example:\n\n```shell\ncd \u002Fgo\u002Fsrc\u002Fgithub.com\u002Fcosmtrek\u002Fhub\nAIR_PORT=8080 air -c \"config.toml\"\n```\n\nthis will replace `$PWD` with the current directory, `$AIR_PORT` is the port where to publish and `$@` is to accept arguments of the application itself for example -c\n\n\u003C\u002Fdetails>\n\n## Usage\n\nFor less typing, you could add `alias air='~\u002F.air'` to your `.bashrc` or `.zshrc`.\n\nFirst enter into your project\n\n```shell\ncd \u002Fpath\u002Fto\u002Fyour_project\n```\n\nThe simplest usage is to run\n\n```shell\n# first tries `.air.toml` in current directory; if not found, uses defaults\nair\n```\n\nTo use a specific config file explicitly, pass `-c`:\n\n```shell\nair -c .air.toml\n```\n\nYou can initialize the `.air.toml` configuration file to the current directory with the default settings running the following command.\n\n```shell\nair init\n```\n\nAfter this, you can just run the `air` command without additional arguments, and it will use the `.air.toml` file for configuration.\n\n```shell\nair\n```\n\nFor modifying the configuration refer to the [air_example.toml](air_example.toml) file.\n\n### Runtime arguments\n\nYou can pass arguments for running the built binary by adding them after the air command.\n\n```shell\n# Will run .\u002Ftmp\u002Fmain bench\nair bench\n\n# Will run .\u002Ftmp\u002Fmain server --port 8080\nair server --port 8080\n```\n\nYou can separate the arguments passed for the air command and the built binary with `--` argument.\n\n```shell\n# Will run .\u002Ftmp\u002Fmain -h\nair -- -h\n\n# Will run air with custom config and pass -h argument to the built binary\nair -c .air.toml -- -h\n```\n\n### Startup banner\n\nUse `misc.startup_banner` to control what Air prints at startup.\n\n```toml\n[misc]\n# Not set (default): show built-in ASCII banner with version.\n\n# Set to empty string: print nothing.\nstartup_banner = \"\"\n\n# Set to custom text: print this text instead of the built-in banner.\n# startup_banner = \"API watcher\"\n```\n\n### Entrypoint\n\nUse `build.entrypoint` to point at the binary generated by `build.cmd` and describe how it should be executed. The value can be either a string (just the executable) or an array of strings. When using an array, the first element is the executable (resolved relative to `root` unless it lacks a path separator, in which case `$PATH` is consulted) and every subsequent element is treated as a default argument. Values from `build.args_bin` and the command line are appended after the inline arguments. The legacy `build.bin` field is deprecated and will be removed in a future release, so prefer the entrypoint form going forward.\n\n```toml\n[build]\nentrypoint = [\".\u002Ftmp\u002Fmain\"]\nargs_bin = [\"server\", \":8080\"]\n\n# Inline the default arguments directly after the binary.\nentrypoint = [\".\u002Ftmp\u002Fmain\", \"server\", \":8080\"]\n\n# Use PATH-resolved tools like dlv by omitting path separators.\nentrypoint = [\n  \"dlv\", \"exec\", \"--accept-multiclient\", \"--log\", \"--headless\", \"--continue\",\n  \"--listen=:8999\", \"--api-version\", \"2\", \".\u002Ftmp\u002Fmain\",\n]\n```\n\n### Environment Files\n\nAir can automatically load environment variables from `.env` files before both building and running when `env_files` is configured.\n\n```toml\n# Loads .env.development and then .env files.\n# Values in the lattermost file overwrite any preceding ones.\n# Does not overwrite variables that were present before running air.\nenv_files = [\".env.development\", \".env\"]\n```\n\n\n### Platform-specific build overrides\n\nYou can override build settings per OS with `[build.windows]`, `[build.darwin]`, and `[build.linux]`. These blocks override the base `[build]` values when running on the matching platform. Only the fields below are supported in platform blocks: `pre_cmd`, `cmd`, `post_cmd`, `bin`, `entrypoint`, `full_bin`, `args_bin`.\n\n```toml\n[build]\ncmd = \"go build -o .\u002Ftmp\u002Fmain .\"\nbin = \".\u002Ftmp\u002Fmain\"\n\n[build.windows]\ncmd = \"go build -o .\u002Ftmp\u002Fmain.exe .\"\nbin = \"tmp\\\\main.exe\"\nentrypoint = [\"tmp\\\\main.exe\"]\n```\n\nRunning `air init` adds a platform block for the current OS when its defaults differ from the base configuration.\n\n### Docker Compose\n\n```yaml\nservices:\n  my-project-with-air:\n    image: cosmtrek\u002Fair\n    # working_dir value has to be the same of mapped volume\n    working_dir: \u002Fproject-package\n    ports:\n      - \u003Cany>:\u003Cany>\n    environment:\n      - ENV_A=${ENV_A}\n      - ENV_B=${ENV_B}\n      - ENV_C=${ENV_C}\n    volumes:\n      - .\u002Fproject-relative-path\u002F:\u002Fproject-package\u002F\n```\n\n### Debug\n\n`air -d` prints all logs.\n\n## Installation and Usage for Docker users who don't want to use air image\n\n`Dockerfile`\n\n```Dockerfile\n# Choose whatever you want, version >= 1.25\nFROM golang:1.25-alpine\n\nWORKDIR \u002Fapp\n\nRUN go install github.com\u002Fair-verse\u002Fair@latest\n\nCOPY go.mod go.sum .\u002F\nRUN go mod download\n\nCMD [\"air\", \"-c\", \".air.toml\"]\n```\n\n`docker-compose.yaml`\n\n```yaml\nversion: \"3.8\"\nservices:\n  web:\n    build:\n      context: .\n      # Correct the path to your Dockerfile\n      dockerfile: Dockerfile\n    ports:\n      - 8080:3000\n    # Important to bind\u002Fmount your codebase dir to \u002Fapp dir for live reload\n    volumes:\n      - .\u002F:\u002Fapp\n```\n\n## Q&A\n\n### \"command not found: air\" or \"No such file or directory\"\n\n```shell\nexport GOPATH=$HOME\u002Fxxxxx\nexport PATH=$PATH:$GOROOT\u002Fbin:$GOPATH\u002Fbin\nexport PATH=$PATH:$(go env GOPATH)\u002Fbin #Confirm this line in your .profile and make sure to source the .profile if you add it!!!\n```\n\n### Error under wsl when ' is included in the bin\n\nShould use `\\` to escape the `'` in the bin. related issue: [#305](https:\u002F\u002Fgithub.com\u002Fair-verse\u002Fair\u002Fissues\u002F305)\n\n### Question: how to do hot compile only and do not run anything?\n\n[#365](https:\u002F\u002Fgithub.com\u002Fair-verse\u002Fair\u002Fissues\u002F365)\n\n```toml\n[build]\n  cmd = \"\u002Fusr\u002Fbin\u002Ftrue\"\n```\n\n### How to Reload the Browser Automatically on Static File Changes\n\nRefer to issue [#512](https:\u002F\u002Fgithub.com\u002Fair-verse\u002Fair\u002Fissues\u002F512) for additional details.\n\n- Ensure your static files in `include_dir`, `include_ext`, or `include_file`.\n- Ensure your HTML has a `\u003C\u002Fbody>` tag\n- Activate the proxy by configuring the following config:\n\n```toml\n[proxy]\n  enabled = true\n  proxy_port = \u003Cair proxy port>\n  app_port = \u003Cyour server port>\n```\n\n## Development\n\nPlease note that it requires Go 1.25+ (see `go.mod`).\n\n```shell\n# Fork this project\n\n# Clone it\nmkdir -p $GOPATH\u002Fsrc\u002Fgithub.com\u002Fcosmtrek\ncd $GOPATH\u002Fsrc\u002Fgithub.com\u002Fcosmtrek\ngit clone git@github.com:\u003CYOUR USERNAME>\u002Fair.git\n\n# Install dependencies\ncd air\nmake ci\n\n# Explore it and happy hacking!\nmake install\n```\n\nPull requests are welcome.\n\n### Release\n\n```shell\n# Checkout to master\ngit checkout master\n\n# Add the version that needs to be released\ngit tag v1.xx.x\n\n# Push to remote\ngit push origin v1.xx.x\n\n# The CI will process and release a new version. Wait about 5 min, and you can fetch the latest version\n```\n\n## Star History\n\n[![Star History Chart](https:\u002F\u002Fapi.star-history.com\u002Fsvg?repos=air-verse\u002Fair&type=Date)](https:\u002F\u002Fstar-history.com\u002F#air-verse\u002Fair&Date)\n\n## Sponsor\n\n[![Buy Me A Coffee](https:\u002F\u002Fcdn.buymeacoffee.com\u002Fbuttons\u002Fdefault-orange.png)](https:\u002F\u002Fwww.buymeacoffee.com\u002Fcosmtrek)\n\nGive huge thanks to lots of supporters. I've always been remembering your kindness.\n\n## License\n\n[GNU General Public License v3.0](LICENSE)\n","Air 是一个为 Go 应用程序提供实时重载功能的命令行工具。它支持自定义构建命令、排除指定目录监控以及在 Air 启动后添加新的监控目录等功能，同时具备彩色日志输出和环境变量文件加载等特性。通过简单的配置，开发者可以在修改代码后无需手动重启应用即可看到效果，极大地提高了开发效率。Air 适用于使用 Go 语言进行 Web 开发或其他需要频繁编译运行的应用场景中，特别是在结合 Gin 等框架时更为便利。",2,"2026-06-11 03:00:22","top_language"]