{"id":13409616,"url":"https://github.com/goyek/goyek","last_synced_at":"2025-03-14T14:31:36.938Z","repository":{"id":37982711,"uuid":"303125572","full_name":"goyek/goyek","owner":"goyek","description":"Task automation Go library","archived":false,"fork":false,"pushed_at":"2024-04-02T11:00:25.000Z","size":1023,"stargazers_count":496,"open_issues_count":0,"forks_count":29,"subscribers_count":5,"default_branch":"main","last_synced_at":"2024-04-02T12:55:34.230Z","etag":null,"topics":["go","golang"],"latest_commit_sha":null,"homepage":"https://pkg.go.dev/github.com/goyek/goyek/v2","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/goyek.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2020-10-11T13:20:55.000Z","updated_at":"2024-04-15T07:28:49.530Z","dependencies_parsed_at":"2023-02-19T06:16:17.457Z","dependency_job_id":"422b32b7-2237-4aed-a991-4b9a415230c1","html_url":"https://github.com/goyek/goyek","commit_stats":{"total_commits":364,"total_committers":8,"mean_commits":45.5,"dds":0.2802197802197802,"last_synced_commit":"bb7641da84e17e402d4415bd5a521190366844b2"},"previous_names":["pellared/taskflow"],"tags_count":26,"template":false,"template_full_name":"golang-templates/seed","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/goyek%2Fgoyek","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/goyek%2Fgoyek/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/goyek%2Fgoyek/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/goyek%2Fgoyek/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/goyek","download_url":"https://codeload.github.com/goyek/goyek/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243593485,"owners_count":20316192,"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":["go","golang"],"created_at":"2024-07-30T20:01:02.359Z","updated_at":"2025-03-14T14:31:36.922Z","avatar_url":"https://github.com/goyek.png","language":"Go","funding_links":[],"categories":["Uncategorized","构建自动化","Build Automation","Go"],"sub_categories":["Contents"],"readme":"# goyek\n\n[![Go Reference](https://pkg.go.dev/badge/github.com/goyek/goyek.svg)](https://pkg.go.dev/github.com/goyek/goyek/v2)\n[![Keep a Changelog](https://img.shields.io/badge/changelog-Keep%20a%20Changelog-%23E05735)](CHANGELOG.md)\n[![go.mod](https://img.shields.io/github/go-mod/go-version/goyek/goyek)](go.mod)\n[![Go Report Card](https://goreportcard.com/badge/github.com/goyek/goyek/v2)](https://goreportcard.com/report/github.com/goyek/goyek/v2)\n[![codecov](https://codecov.io/gh/goyek/goyek/branch/main/graph/badge.svg)](https://codecov.io/gh/goyek/goyek)\n[![Mentioned in Awesome Go](https://awesome.re/mentioned-badge.svg)](https://github.com/avelino/awesome-go)\n\n**goyek** (/ˈɡɔɪæk/ [🔊 listen](https://ipa-reader.com/?text=%CB%88%C9%A1%C9%94%C9%AA%C3%A6k))\nis a task automation library intended to be an alternative to\n[Make](https://www.gnu.org/software/make/),\n[Mage](https://github.com/magefile/mage),\n[Task](https://taskfile.dev/).\n\nPlease ⭐ `Star` this repository if you find it valuable.\n\nThe primary properties of goyek are:\n\n- Library, not an application, with API inspired by\n  [`testing`](https://golang.org/pkg/testing),\n  [`cobra`](https://github.com/spf13/cobra),\n  [`flag`](https://golang.org/pkg/flag),\n  [`http`](https://golang.org/pkg/http).\n- Cross-platform and shell independent.\n- No binary installation needed.\n- Easy to debug, like regular Go code.\n- Tasks are defined similarly to\n  [`cobra`](https://github.com/spf13/cobra) commands.\n- The task action looks like a Go test.\n  [`goyek.A`](https://pkg.go.dev/github.com/goyek/goyek/v2#A)\n  has similar methods to [`testing.T`](https://pkg.go.dev/testing#T).\n- Reuse any Go code and library e.g. [`viper`](https://github.com/spf13/viper).\n- Highly customizable.\n- Zero third-party dependencies.\n- Additional features in [`goyek/x`](https://github.com/goyek/x).\n\n## Usage\n\nFor build automation, store your code in the `build` directory.\n\nThe following example defines a simple `hello` task that logs a message\nand prints the Go version.\n\nCreate `build/hello.go`:\n\n```go\npackage main\n\nimport (\n\t\"flag\"\n\n\t\"github.com/goyek/goyek/v2\"\n\t\"github.com/goyek/x/cmd\"\n)\n\nvar msg = flag.String(\"msg\", \"greeting message\", \"Hello world!\")\n\nvar hello = goyek.Define(goyek.Task{\n\tName:  \"hello\",\n\tUsage: \"demonstration\",\n\tAction: func(a *goyek.A) {\n\t\ta.Log(*msg)\n\t\tcmd.Exec(a, \"go version\")\n\t},\n})\n```\n\nCreate `build/main.go`:\n\n```go\npackage main\n\nimport (\n\t\"os\"\n\n\t\"github.com/goyek/goyek/v2\"\n\t\"github.com/goyek/x/boot\"\n)\n\nfunc main() {\n\tif err := os.Chdir(\"..\"); err != nil {\n\t\tpanic(err)\n\t}\n\tgoyek.SetDefault(hello)\n\tboot.Main()\n}\n```\n\nThe packages from [`github.com/goyek/x`](https://pkg.go.dev/github.com/goyek/x)\nare used for convenience.\n\nRun help:\n\n```sh\ncd build\ngo mod tidy\ngo run . -h\n```\n\nExpected output:\n\n```out\nUsage of build: [flags] [--] [tasks]\nTasks:\n  hello  demonstration\nFlags:\n  -dry-run\n        print all tasks without executing actions\n  -long-run duration\n        print when a task takes longer (default 1m0s)\n  -msg string\n        Hello world! (default \"greeting message\")\n  -no-color\n        disable colorizing output\n  -no-deps\n        do not process dependencies\n  -skip comma-separated tasks\n        skip processing the comma-separated tasks\n  -v    print all tasks as they are run\n```\n\nRun with verbose output:\n\n```sh\ngo run . -v\n```\n\nExample output:\n\n```out\n===== TASK  hello\n      hello.go:16: greeting message\n      hello.go:17: Exec: go version\ngo version go1.24.0 linux/amd64\n----- PASS: hello (0.12s)\nok      0.123s\n```\n\nInstead of running `go run .` inside `build`, you can use wrapper scripts:\n\n- Bash: [`goyek.sh`](goyek.sh).\n- PowerShell: [`goyek.ps1`](goyek.ps1).\n\nUse [`goyek/template`](https://github.com/goyek/template) when creating\na new repository. For existing repositories, simply copy the relevant files.\n\nLearn more:\n\n- 📺 5-minute video: [Watch here](https://www.youtube.com/watch?v=e-xWEH-fqJ0)\n  ([Slides](https://docs.google.com/presentation/d/1xFAPXeMiOD-92xeIHkUD-SHmJZwc8mSIIgpjuJXEW3U/edit?usp=sharing))\n- 📚 [Package documentation](https://pkg.go.dev/github.com/goyek/goyek/v2)\n\n## Contributing\n\nWe welcome contributions! See [CONTRIBUTING.md](CONTRIBUTING.md) for details.\n\n## License\n\n**goyek** is licensed under the terms of the [MIT license](LICENSE).\n\nNote: **goyek** was named **taskflow** before v0.3.0.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgoyek%2Fgoyek","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgoyek%2Fgoyek","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgoyek%2Fgoyek/lists"}