{"id":13581857,"url":"https://github.com/silenceper/gowatch","last_synced_at":"2025-05-14T19:04:41.185Z","repository":{"id":14975681,"uuid":"77285544","full_name":"silenceper/gowatch","owner":"silenceper","description":"🚀 gowatch is a command line tool that builds and (re)starts your go project everytime you save a Go or template file.","archived":false,"fork":false,"pushed_at":"2025-03-21T01:42:35.000Z","size":1336,"stargazers_count":853,"open_issues_count":10,"forks_count":101,"subscribers_count":19,"default_branch":"master","last_synced_at":"2025-04-01T14:04:13.099Z","etag":null,"topics":["automate","build","build-tool","go","golang","gowatch","hotreload","inotify","livereload","reload"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/silenceper.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":null,"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":"https://silenceper.com/img/wechat-pay.jpeg"}},"created_at":"2016-12-24T13:59:50.000Z","updated_at":"2025-03-30T15:03:47.000Z","dependencies_parsed_at":"2024-01-13T22:58:33.050Z","dependency_job_id":"67495279-3da8-4e0b-87da-a976b174d49e","html_url":"https://github.com/silenceper/gowatch","commit_stats":{"total_commits":92,"total_committers":10,"mean_commits":9.2,"dds":0.25,"last_synced_commit":"7b9b132728ba9405e290edb617af23f76febd6a2"},"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/silenceper%2Fgowatch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/silenceper%2Fgowatch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/silenceper%2Fgowatch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/silenceper%2Fgowatch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/silenceper","download_url":"https://codeload.github.com/silenceper/gowatch/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247867350,"owners_count":21009240,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["automate","build","build-tool","go","golang","gowatch","hotreload","inotify","livereload","reload"],"created_at":"2024-08-01T15:02:16.840Z","updated_at":"2025-05-14T19:04:41.166Z","avatar_url":"https://github.com/silenceper.png","language":"Go","funding_links":["https://silenceper.com/img/wechat-pay.jpeg"],"categories":["开源类库","Go","Open source library","Repositories"],"sub_categories":["构建编译","Build And Compile"],"readme":"# gowatch\n\n![Go](https://github.com/silenceper/gowatch/workflows/Go/badge.svg)\n[![Go Report Card](https://goreportcard.com/badge/github.com/silenceper/gowatch)](https://goreportcard.com/report/github.com/silenceper/gowatch)\n[![PkgGoDev](https://pkg.go.dev/badge/github.com/silenceper/gowatch)](https://pkg.go.dev/github.com/silenceper/gowatch)\n\n\n[中文文档](./README_ZH_CN.md)\n\ngowatch is a command line tool that builds and (re)starts your go project\neverytime you save a Go or template file.\n\n![gowatch](./screenshot/gowatch.png)\n\n## Installation\n\nThere are two ways to install `gowatch`:\n\n### 1. Install via Go\n\n```go\ngo install github.com/silenceper/gowatch@latest\n```\n\nAfter installation, you need to add `gowatch` binary to PATH environment variable in your ~/.bashrc or ~/.bash_profile file:\n\n```sh\nexport GOPATH=\"$HOME/go\"\nexport PATH=\"$GOPATH/bin:$PATH\"\n```\n\nTo update:\n```go\ngo install github.com/silenceper/gowatch@latest\n```\n\n### 2. Install via Homebrew (macOS)\n\n```bash\n# Tap the repository\nbrew tap silenceper/tap\n\n# Install gowatch\nbrew install gowatch\n```\n\nTo update:\n```bash\nbrew upgrade gowatch\n```\n\n## Usage\n\n```\ncd /path/to/myapp\n```\n\nStart gowatch:\n\n```\ngowatch\n```\n\nGowatch will watch for file events, and every time you create/modify/delete a\nfile it will build and restart the application,If `go build` returns an error,\nit will log it in stdout.\n\n### Support Options\n\n- -o : Not required, specify the target file path for the build\n- -p : Not required, specify the package to be built (can also be a single file)\n- -args: Not required, specify program runtime parameters, for example: -args =\n  '-host =: 8080, -name = demo'\n- -v: Not required, display gowatch version information\n- -l: Not required, specify the log level, default is debug\n- -h: Not required, show usage\n\nexample:\n\n`gowatch -o ./bin/demo -p ./cmd/demo`\n\n### Configuration file\n\nIn most cases, you don't need to specify the configuration. You can meet most of\nthe requirements by directly executing the `gowatch` command.\n\nYou can initialize the gowatch.yml configuration file to the current directory\nwith the default settings running the following command.\n\n```\ngowatch init\n```\n\nCreate a `gowatch.yml` file in the execution directory:\n\n```\n# gowatch.yml configuration example\n\n# The name of the executable file generated under the current directory execution. The default is the current directory name.\nappname: \"test\"\n\n# Specify the command to run after builds done\nrun_cmd: \"./run.sh\"\n\n# Specify the directory where the compiled object files are stored\noutput: /bin/demo\n# The file name suffix that needs to be monitored. By default, there is only a '.go' file.\nwatch_exts:\n    - .yml\n\n# The directory that needs to listen for file changes. By default, only the current directory.\nwatch_paths:\n    - ../pk\n\n# Additional parameters that need to be added when running the application\ncmd_args:\n    - arg1=val1\n\n# Additional parameters that need to be added when building the application\nbuild_args:\n    - -race\n\n# Need to increase environment variables, the current environment variables are loaded by default\nenvs:\n    - a=b\n\n# Whether to listen to file changes in the 'vendor' folder\nvendor_watch: false\n\n# Directory that do not need to listen for file changes\nexcluded_paths:\n    - path\n\n# main package path, can also be a single file, multiple files separated by commas\nbuild_pkg: \"\"\n\n# build tags\nbuild_tags: \"\"\n\n# Commands that can be executed before build the app\n#prev_build_cmds:\n#  - swag init\n\n# Whether to prohibit automatic operation\ndisable_run: false\n\n# use GOGC on build\nbuild_go_gc: false\n\n# log level, support debug, info, warn, error, fatal\nlog_level: \"debug\"\n```\n\n## Author\n\n[@silenceper](http://silenceper.com)\n\n\u003e Inspired by [bee](https://github.com/beego/bee)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsilenceper%2Fgowatch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsilenceper%2Fgowatch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsilenceper%2Fgowatch/lists"}