{"id":24140856,"url":"https://github.com/maxclaus/gaper","last_synced_at":"2025-04-23T18:22:04.276Z","repository":{"id":54353532,"uuid":"137548214","full_name":"maxclaus/gaper","owner":"maxclaus","description":"Builds and restarts a Go project when it crashes or some watched file changes","archived":false,"fork":false,"pushed_at":"2023-08-08T12:25:52.000Z","size":198,"stargazers_count":81,"open_issues_count":2,"forks_count":7,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-12T04:05:55.310Z","etag":null,"topics":["livereload","restart-server"],"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/maxclaus.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"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}},"created_at":"2018-06-16T02:46:38.000Z","updated_at":"2024-10-26T10:53:24.000Z","dependencies_parsed_at":"2024-01-08T14:30:48.651Z","dependency_job_id":"78f54996-b3d0-4b13-a460-c3d3b953d549","html_url":"https://github.com/maxclaus/gaper","commit_stats":null,"previous_names":["maxclaus/gaper"],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxclaus%2Fgaper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxclaus%2Fgaper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxclaus%2Fgaper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxclaus%2Fgaper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/maxclaus","download_url":"https://codeload.github.com/maxclaus/gaper/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250487773,"owners_count":21438659,"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":["livereload","restart-server"],"created_at":"2025-01-12T04:01:50.283Z","updated_at":"2025-04-23T18:22:04.257Z","avatar_url":"https://github.com/maxclaus.png","language":"Go","readme":"\u003cp align=\"center\"\u003e\n  \u003cimg width=\"200px\" src=\"https://raw.githubusercontent.com/maxcnunes/gaper/master/gopher-gaper.png\"\u003e\n  \u003ch3 align=\"center\"\u003egaper\u003c/h3\u003e\n  \u003cp align=\"center\"\u003e\n   Used to build and restart a Go project when it crashes or some watched file changes\n   \u003cbr /\u003e\n   \u003cb\u003eAimed to be used in development only.\u003c/b\u003e\n  \u003c/p\u003e\n\u003c/p\u003e\n\n---\n\n[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE.md)\n[![Linux - Build Status](https://travis-ci.org/maxcnunes/gaper.svg?branch=master)](https://travis-ci.org/maxcnunes/gaper)\n[![Windows - Build status](https://ci.appveyor.com/api/projects/status/e0g00kmxwv44?svg=true)](https://ci.appveyor.com/project/maxcnunes/gaper)\n[![Coverage Status](https://codecov.io/gh/maxcnunes/gaper/branch/master/graph/badge.svg)](https://codecov.io/gh/maxcnunes/gaper)\n[![Go Doc](https://img.shields.io/badge/godoc-reference-blue.svg?style=flat-square)](http://godoc.org/github.com/maxcnunes/gaper)\n[![Go Report Card](https://goreportcard.com/badge/github.com/maxcnunes/gaper)](https://goreportcard.com/report/github.com/maxcnunes/gaper)\n[![Powered By: GoReleaser](https://img.shields.io/badge/powered%20by-goreleaser-green.svg?style=flat-square)](https://github.com/goreleaser)\n\n## Changelog\n\nSee [Releases](https://github.com/maxcnunes/gaper/releases) for detailed history changes.\n\n## Installation\n\nUsing go tooling:\n\n```\ngo get -u github.com/maxcnunes/gaper/cmd/gaper\n```\n\nOr, downloading the binary instead (example for version 1.1.0, make sure you are using the latest version though):\n\n```\ncurl -SL https://github.com/maxcnunes/gaper/releases/download/v1.1.0/gaper_1.1.0_linux_amd64.tar.gz | tar -xvzf - -C \"${GOPATH}/bin\"\n```\n\n## Usage\n\n```\nNAME:\n   gaper - Used to build and restart a Go project when it crashes or some watched file changes\n\nUSAGE:\n   gaper [global options] command [command options] [arguments...]\n\nVERSION:\n   version\n\nCOMMANDS:\n     help, h  Shows a list of commands or help for one command\n\nGLOBAL OPTIONS:\n   --bin-name value                 name for the binary built by gaper for the executed program (default current directory name)\n   --build-path value               path to the program source code (default: \".\")\n   --build-args value               arguments used on building the program\n   --program-args value             arguments used on executing the program\n   --verbose                        turns on the verbose messages from gaper\n   --disable-default-ignore         turns off default ignore for hidden files and folders, \"*_test.go\" files, and vendor folder\n   --watch value, -w value          list of folders or files to watch for changes\n   --ignore value, -i value         list of folders or files to ignore for changes\n   --poll-interval value, -p value  how often in milliseconds to poll watched files for changes (default: 500)\n   --extensions value, -e value     extensions to watch for changes (default: \"go\")\n   --no-restart-on value, -n value  don't automatically restart the supervised program if it ends:\n                                      if \"error\", an exit code of 0 will still restart.\n                                      if \"exit\", no restart regardless of exit code.\n                                      if \"success\", no restart only if exit code is 0.\n   --help, -h                       show help\n   --version, -v                    print the version\n```\n\n### Watch and Ignore paths\n\nFor those options Gaper supports static paths (e.g. `build/`, `seed.go`) or glob paths (e.g. `migrations/**/up.go`, `*_test.go`).\n\nOn using a path to a directory please add a `/` at the end (e.g. `build/`) to make sure Gaper won't include other matches that starts with that same value (e.g. `build/`, `build_settings.go`).\n\n### Default ignore settings\n\nSince in most projects there is no need to watch changes for:\n\n* hidden files and folders\n* test files (`*_test.go`)\n* vendor folder\n\nGaper by default ignores those cases already. Although, if you need Gaper to watch those files anyway it is possible to disable this setting with `--disable-default-ignore` argument.\n\n### Watch method\n\nCurrently Gaper uses polling to watch file changes. We have plans to [support fs events](https://github.com/maxcnunes/gaper/issues/12) though in a near future.\n\n### Examples\n\nUsing all defaults provided by Gaper:\n\n```\ngaper\n```\n\nExample providing a few custom configurations:\n\n```\ngaper \\\n    --bin-name build/api-dev \\\n    --build-path cmd/server \\\n    --build-args \"-ldflags=\\\"-X 'main.Version=dev'\" \\\n    -w 'public/**' -w '*.go' \\\n    -e js -e css -e html \\\n    --ignore './**/*_mock.go' \\\n    --program-args \"-arg1 ok -arg2=nope\" \\\n    --watch .\n```\n\n## Contributing\n\nSee the [Contributing guide](/CONTRIBUTING.md) for steps on how to contribute to this project.\n\n## Reference\n\nThis package was heavily inspired by [gin](https://github.com/codegangsta/gin) and [node-supervisor](https://github.com/petruisfan/node-supervisor).\n\nBasically, Gaper is a mixing of those projects above. It started from **gin** code base and I rewrote it aiming to get\nsomething similar to **node-supervisor** (but simpler). A big thanks for those projects and for the people behind it!\n:clap::clap:\n\n### How is Gaper different of Gin\n\nThe main difference is that Gaper removes a layer of complexity from Gin which has a proxy running on top of \nthe executed server. It allows to postpone a build and reload the server when the first call hits it. With Gaper \nwe don't care about that feature, it just restarts your server whenever a change is made.\n","funding_links":[],"categories":["Build Automation","Go","构建自动化"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaxclaus%2Fgaper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmaxclaus%2Fgaper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaxclaus%2Fgaper/lists"}