{"id":20388580,"url":"https://github.com/efureev/go-commander","last_synced_at":"2026-05-10T18:04:52.016Z","repository":{"id":57703854,"uuid":"496598635","full_name":"efureev/go-commander","owner":"efureev","description":"Commander","archived":false,"fork":false,"pushed_at":"2022-06-10T10:31:06.000Z","size":3,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-15T09:02:36.725Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/efureev.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":"2022-05-26T11:46:46.000Z","updated_at":"2022-11-19T19:45:13.000Z","dependencies_parsed_at":"2022-09-26T21:12:00.169Z","dependency_job_id":null,"html_url":"https://github.com/efureev/go-commander","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/efureev%2Fgo-commander","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/efureev%2Fgo-commander/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/efureev%2Fgo-commander/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/efureev%2Fgo-commander/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/efureev","download_url":"https://codeload.github.com/efureev/go-commander/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241940541,"owners_count":20045878,"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":[],"created_at":"2024-11-15T03:11:40.130Z","updated_at":"2026-05-10T18:04:51.962Z","avatar_url":"https://github.com/efureev.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Commander\n\n[![Go Report Card](https://goreportcard.com/badge/github.com/efureev/go-commander)](https://goreportcard.com/report/github.com/efureev/go-commander)\n![GitHub go.mod Go version](https://img.shields.io/github/go-mod/go-version/efureev/go-commander)\n![GitHub release (latest by date)](https://img.shields.io/github/v/release/efureev/go-commander)\n![GitHub](https://img.shields.io/github/license/efureev/go-commander)\n\nCommand executor\n\n## Installation\n\n```shell\ngo get github.com/efureev/go-commander\n```\n\n## Usage\n\n```go\npackage main\n\nimport (\n\tcommander \"github.com/efureev/go-commander\"\n)\n\nfunc main() {\n\tcmdr := commander.NewCommander().\n\t\tAdd(\n\t\t\tcommander.NewCommand(`info`).\n\t\t\t\tOnRun(func(cmd *commander.Command) error {\n\t\t\t\t\tprintln(cmd.Name)\n\t\t\t\t\treturn nil\n\t\t\t\t}),\n\t\t\tcmdFinish(`finish`),\n\t\t\t// ... \n\t\t)\n\n\tcmdr.Run()\n}\n\nfunc cmdFinish(t string) *commander.Command {\n\treturn commander.NewCommand(`Finish!`).\n\t\tOnPrepare(func(cmd *commander.Command) error {\n\t\t\tprintln(`OnPrepare`)\n\t\t\treturn nil\n\t\t}).\n\t\tOnRun(func(cmd *commander.Command) error {\n\t\t\tprintln(t)\n\t\t\treturn nil\n\t\t}).\n\t\tOnDone(func(cmd *commander.Command) error {\n\t\t\tprintln(`OnDone`)\n\t\t\treturn nil\n\t\t})\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fefureev%2Fgo-commander","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fefureev%2Fgo-commander","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fefureev%2Fgo-commander/lists"}