{"id":24083325,"url":"https://github.com/mitranim/gtg","last_synced_at":"2026-06-18T10:31:09.548Z","repository":{"id":57564360,"uuid":"335269730","full_name":"mitranim/gtg","owner":"mitranim","description":"Go task group / task graph. Good for CLI task orchestration. Replaces Make and Mage.","archived":false,"fork":false,"pushed_at":"2021-05-07T15:33:56.000Z","size":20,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-20T15:57:00.028Z","etag":null,"topics":["golang","task-orchestration","task-runner"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mitranim.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-02-02T11:42:35.000Z","updated_at":"2023-08-01T09:09:42.000Z","dependencies_parsed_at":"2022-09-16T13:46:54.724Z","dependency_job_id":null,"html_url":"https://github.com/mitranim/gtg","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mitranim/gtg","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mitranim%2Fgtg","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mitranim%2Fgtg/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mitranim%2Fgtg/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mitranim%2Fgtg/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mitranim","download_url":"https://codeload.github.com/mitranim/gtg/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mitranim%2Fgtg/sbom","scorecard":{"id":650477,"data":{"date":"2025-08-11","repo":{"name":"github.com/mitranim/gtg","commit":"9443420a7fa707c73cc037056f1da6705f0b40bf"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Code-Review","score":0,"reason":"Found 0/6 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: unlicense:0","Info: FSF or OSI recognized license: The Unlicense: unlicense:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-21T13:23:31.993Z","repository_id":57564360,"created_at":"2025-08-21T13:23:31.993Z","updated_at":"2025-08-21T13:23:31.993Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34487069,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-18T02:00:06.871Z","response_time":128,"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":["golang","task-orchestration","task-runner"],"created_at":"2025-01-09T23:56:24.091Z","updated_at":"2026-06-18T10:31:09.531Z","avatar_url":"https://github.com/mitranim.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Overview\n\n\"Go task group\" or \"Go task graph\". Runs a set of functions as a graph with coordination and deduplication.\n\nGood for CLI task orchestration, serving as a Go-based alternative to Make (see [#comparison](#comparison-with-make)) and a simple, flexible replacement for [Mage](https://github.com/magefile/mage) (see [#comparison](#comparison-with-mage)). May be useful for non-CLI applications.\n\nAPI documentation: https://pkg.go.dev/github.com/mitranim/gtg.\n\nMain concepts:\n\n```golang\ntype Task interface {\n  context.Context\n  TaskGroup\n}\n\ntype TaskGroup interface {\n  Task(TaskFunc) Task\n}\n\ntype TaskFunc func(Task) error\n```\n\n## TOC\n\n* [#Usage](#usage)\n  * [#CLI Usage](#cli-usage)\n* [#Comparisons](#comparisons)\n  * [#Comparison with `\"context\"`](#comparison-with-context)\n  * [#Comparison with Make](#comparison-with-make)\n  * [#Comparison with Mage](#comparison-with-mage)\n* [#Known Limitations and TODOs](#known-limitations-and-todos)\n* [#License](#license)\n\n## Usage\n\n(For CLI, see [#below](#cli-usage).)\n\nThis example demonstrates a diamond-shaped task graph:\n\n```\n    A\n   / \\\n  v   v\n  B   C\n   \\ /\n    v\n    D\n```\n\n* Task A waits on tasks B and C.\n\n* Both B and C wait on D.\n\n* C allows D to fail and logs the error, while B requires D to succeed.\n\n* Each function in the group is called _exactly_ once.\n\n```golang\nimport g \"github.com/mitranim/gtg\"\n\nfunc main() {\n  g.MustRun(context.Background(), A)\n}\n\nfunc A(task g.Task) error {\n  // Allow B and C to run concurrently, wait on both.\n  g.MustWait(task, g.Par(B, C))\n\n  // Any logic here.\n  return nil\n}\n\nfunc B(task g.Task) error {\n  return g.Wait(task, D)\n}\n\nfunc C(task g.Task) error {\n  // Choose one line. Either of them will work.\n  g.Log(g.Wait(task, D))\n  g.MustWait(task, g.Opt(D))\n\n  // Any logic here.\n  return nil\n}\n\nfunc D(_ g.Task) error {\n  return fmt.Errorf(\"arbitrary failure\")\n}\n```\n\n### CLI Usage\n\nReusing the `A B C D` task definitions from the example above:\n\n```golang\nimport g \"github.com/mitranim/gtg\"\n\nfunc main() {\n  g.MustRunCmd(A, B, C, D)\n}\n```\n\nThen from the command line:\n\n```sh\n# Print available tasks.\ngo run .\n\n# Run a specific task.\ngo run . a\n```\n\n## Comparisons\n\n### Comparison with `\"context\"`\n\n* Gtg is an extension of `context`, adding support for running tasks as a graph, with mutual coordination and deduplication.\n\n### Comparison with Make\n\n* Make is a CLI. Gtg is a library with CLI convenience features.\n\n* Make runs shell scripts, Gtg runs Go. Both are good for different things.\n\n* Go scripts are more portable than shell scripts. (My camel-breaking straw was Bash incompatibilities between Ubuntu and MacOS.)\n\n### Comparison with Mage\n\n* Mage is a CLI. Gtg is a library with CLI convenience features.\n\n* Gtg does not require an external CLI to function, and doesn't need separate installation. Just `go run .` which auto-installs all dependencies including Gtg.\n\n* Mage has a build system. Gtg is just a library. No accidental conflicts in imports and declarations. No accidental log suppression or log spam. No need for special system variables. No multi-GiB hidden cache folder stuck forever on your system.\n\n* Gtg has no implicit control flow. Just handle your errors. It provides `Must` shortcuts which are optional, explicit, and conventional.\n\n* Gtg is compatible with external watchers such as [Gow](https://github.com/mitranim/gow).\n\n* Gtg is much smaller and simpler. It adds very few concepts: a minor extension of the `context.Context` interface, and a few utility functions defined in terms of that.\n\n* Gtg is new and immature.\n\n## Known Limitations and TODOs\n\n* CLI usage needs better error logging. Currently we just panic, rendering an error message but also the call stack.\n\n* Task identity is determined via function pointers, using unsafe hacks. May be unreliable, needs more testing.\n\n* `Choose` and `RunCmd` allow to run only one task. We should provide shortcuts for selecting N tasks, which can be run concurrently via `Par` or serially via `Ser`.\n\n* `Ser` should produce an error when other tasks cause the requested tasks to run in a different order. Currently this is unchecked.\n\n## License\n\nhttps://unlicense.org\n\n## Misc\n\nI'm receptive to suggestions. If this library _almost_ satisfies you but needs changes, open an issue or chat me up. Contacts: https://mitranim.com/#contacts\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmitranim%2Fgtg","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmitranim%2Fgtg","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmitranim%2Fgtg/lists"}