{"id":30313873,"url":"https://github.com/jonahbraun/wago","last_synced_at":"2025-08-17T18:52:28.501Z","repository":{"id":7010855,"uuid":"8279467","full_name":"JonahBraun/wago","owner":"JonahBraun","description":"Automate the actions you do after saving code.","archived":false,"fork":false,"pushed_at":"2019-08-06T21:09:46.000Z","size":84,"stargazers_count":60,"open_issues_count":3,"forks_count":2,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-08-14T19:50:53.654Z","etag":null,"topics":["cli","developer-tools","development","go","watcher"],"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/JonahBraun.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"license.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-02-18T23:28:53.000Z","updated_at":"2024-06-07T11:01:38.000Z","dependencies_parsed_at":"2022-09-13T08:02:00.427Z","dependency_job_id":null,"html_url":"https://github.com/JonahBraun/wago","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/JonahBraun/wago","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JonahBraun%2Fwago","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JonahBraun%2Fwago/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JonahBraun%2Fwago/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JonahBraun%2Fwago/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JonahBraun","download_url":"https://codeload.github.com/JonahBraun/wago/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JonahBraun%2Fwago/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270892209,"owners_count":24663543,"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","status":"online","status_checked_at":"2025-08-17T02:00:09.016Z","response_time":129,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["cli","developer-tools","development","go","watcher"],"created_at":"2025-08-17T18:52:26.312Z","updated_at":"2025-08-17T18:52:28.442Z","avatar_url":"https://github.com/JonahBraun.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"**Do you routinely?:**\n\n1. Save your code.\n2. Do something in a terminal: kill a command, restart a daemon, wait for stuff to finish successfully, refresh a browser.\n3. *Repeat…*\n\nWago\u003csup\u003eWatch, Go\u003c/sup\u003e watches your code, then starts a conditional action chain capable of process monitoring and management.\n\n## Examples\n* Run a Ruby script.\n```bash\nwago -cmd='ruby script.rb'\n```\n* Watch your **Go** webapp, test, install, launch server, wait for it to connect to the DB, kick off a custom curl test suite.\n```bash\nwago -cmd='go test \u0026\u0026 go install' -daemon='appName' -timer=35 -pcmd='test_suite.sh'\n```\n* Watch your **Elixir** webapp, restarting iex, waiting for it to load, refreshing Chrome. You can still interact with iex between builds!\n```bash\nwago -q -dir=lib -daemon='iex -S mix' -trigger='iex(1)\u003e' -url='http://localhost:8123/'\n```\n* Watch your **Compass/SASS** directory for changes. Recompile and refresh your Chrome tab so you can see the results. `compass watch` will also watch your files, but does so with far greater processor usage.\n```bash\nwago -dir sass/ -cmd 'compass compile' -url 'http://localhost:8080/somewhere.html'\n```\n* Recursively develop Wago!\n```bash\nwago -q -ignore='(\\.git|tmp)' -cmd='go install -race' -daemon='wago -v -dir tmp -cmd \"echo foo\"' -pcmd='touch tmp/a \u0026\u0026 rm tmp/a'\n```\n* Run a **static webserver** in the current directory for a one-off HTML/CSS/JS test page.\n```bash\nwago -fiddle\n```\n\n## Install\nGo (golang), requires Go 1.5+: `go get github.com/JonahBraun/wago`\n\nMac OS X, Intel (darwin/amd64): [Download from the Releases page](https://github.com/JonahBraun/wago/releases)\n\nLinux (amd64): [Download from the Releases page](https://github.com/JonahBraun/wago/releases)\n\n# How it Works\n### Action Chain\nActions are run in the following order. All actions are optional but there must be at least one. The chain is stopped if an action fails (exit status \u003e0).\n\n1. `-cmd` is run and waited to finish.\n1. `-daemon` is run. If `-trigger`, chain continues after `-daemon` outputs the exact trigger string. Otherwise, `-timer` milliseconds is waited and then the chain continues.\n1. `-pcmd` is run and waited to finish.\n1. `-url` is opened.\n\nWhen a matching file system event occurs, all actions are killed and the chain is started from the beginning.\n\nCommands are executed by `-shell`, which defaults to your current shell. This allows you to do stuff like `some_command \u0026\u0026 some_script.sh`. Output and input are connected to your terminal so that you can interact with commands. Note that `-daemon` and `-pcmd` will run concurrently and input will be sent to both. If you require distinct input, use shell I/O redirection or wrap a command in a script.\n\nWago reports actions as they occur. Once you are comfortable with what is happening, consider using `-q` to make things less noisy.\n\n### File system events\nWago begins by recursively (`-recursive` defaults to true) watching all the directories in `-dir` except for those matching `-ignore`.\n\nEvents are ignored unless they match `-watch`. You can listen for all sorts of events, even deletes. Use `-v` to see all events and modify `-watch` accordingly.\n\nRegex explained:\n- **-ignore** `\\.(git|hg|svn)` Ignore directories a dot followed by either git, hg, or svn.\n- **-watch** `/[^\\.][^/]*\": (CREATE|MODIFY$)` Only react to CREATE and MODIFY events where the filename (everything after the last /) does not start with a dot. A simple regex to watch all files is: `(CREATE|MODIFY)$`\n\n### Webserver\nIf you are developing a static site, Wago can run a static web server for you. To start it, set the port number(s) with `-http` and/or `-h2`.\n\n`-h2` serves both HTTPS (TLS) and HTTP2 on the same port. A X.509 certificate is required for this and one is included in Wago. Because the private key is published in GitHub, **the bundled certificate is unsafe** and should only be used over local and private networks. You can set your own certificate with `-key` and `-cert`.\n\nTo generate your own self-signed certificate pair, try this command:\n```bash\nyes \"\" | openssl req -x509 -newkey rsa:2048 -keyout key.pem -out cert.pem -days 4000 -nodes\n```\n\n# Command Reference\nRun Wago without any switches to get this reference:\n```\nWaGo (Watch, Go) build tool. Version 1.2.0\n  -cert string\n    \tX.509 cert file for HTTP2/TLS, eg: cert.pem\n  -cmd string\n    \tRun command, wait for it to complete.\n  -daemon string\n    \tRun command and leave running in the background.\n  -dir string\n    \tDirectory to watch, defaults to current.\n  -exitwait int\n    \tMax miliseconds a process has after a SIGTERM to exit before a SIGKILL. (default 50)\n  -fiddle\n    \tCLI fiddle mode! Start a web server, open browser to URL of targetDir/index.html\n  -h2 string\n    \tStart a HTTP/TLS server on this port, e.g. :8421\n  -http string\n    \tStart a HTTP server on this port, e.g. :8420\n  -ignore string\n    \tIgnore directories matching regex. (default \"\\\\.(git|hg|svn)\")\n  -key string\n    \tX.509 key file for HTTP2/TLS, eg: key.pem\n  -pcmd string\n    \tRun command after daemon starts. Use this to kick off your test suite.\n  -q\tQuiet, only warnings and errors\n  -recursive\n    \tWatch directory tree recursively. (default true)\n  -shell string\n    \tShell used to run commands, defaults to $SHELL, fallback to /bin/sh\n  -timer int\n    \tWait miliseconds after starting daemon, then continue.\n  -trigger string\n    \tWait for daemon to output this string, then continue.\n  -url string\n    \tOpen browser to this URL after all commands are successful.\n  -v\tVerbose\n  -watch string\n    \tReact to FS events matching regex. Use -v to see all events. (default \"/[^\\\\.][^/]*\\\": (CREATE|MODIFY$)\")\n  -webroot string\n    \tLocal directory to use as root for web server, defaults to -dir.\n```\n\n# Troubleshooting\n\n### ☠  Error… too many open files\nUse `-dir` to specify a subdirectory or set `-recursive=false`. Another option is to expand the regex of `-ignore` which will prevent directories from being watched.\n\nYou can also raise the open file limit for your system. Try `ulimit -n` to see the current limit and raise it with `ulimit -n 2000`.\n\n### Orphaned sub processes or resources are being left open\nShort answer: Try increasing `-exitwait` to something longer than the default of 50ms.\n\nExplanation: Wago runs commands in a new process group, sends SIGTERM, waits `-exitwait`, then sends SIGKILL if the process group is still running. Some commands (eg: Elixir) will spin up their own subprocesses in a new process group which will not receive WaGo's signals. Your command should be cleaning up for exit when it receives SIGTERM, so check that it is doing so. 50ms should be long enough in most circumstances. If you continue to have problems with a popular tool or library, please open an issue. \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjonahbraun%2Fwago","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjonahbraun%2Fwago","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjonahbraun%2Fwago/lists"}