{"id":22870193,"url":"https://github.com/berquerant/execx","last_synced_at":"2025-05-07T15:24:31.565Z","repository":{"id":233089424,"uuid":"785986602","full_name":"berquerant/execx","owner":"berquerant","description":"Provides `os/exec.Cmd` wrappers.","archived":false,"fork":false,"pushed_at":"2025-04-20T07:34:18.000Z","size":105,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-20T08:37:50.117Z","etag":null,"topics":["go"],"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/berquerant.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"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,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-04-13T04:50:51.000Z","updated_at":"2025-04-20T07:34:15.000Z","dependencies_parsed_at":"2024-05-20T03:26:54.810Z","dependency_job_id":"eaabe39c-ae36-4b1f-9c51-611ba48ebb7e","html_url":"https://github.com/berquerant/execx","commit_stats":null,"previous_names":["berquerant/execx"],"tags_count":19,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/berquerant%2Fexecx","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/berquerant%2Fexecx/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/berquerant%2Fexecx/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/berquerant%2Fexecx/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/berquerant","download_url":"https://codeload.github.com/berquerant/execx/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252903717,"owners_count":21822493,"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"],"created_at":"2024-12-13T13:14:05.924Z","updated_at":"2025-05-07T15:24:31.519Z","avatar_url":"https://github.com/berquerant.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Go Report Card](https://goreportcard.com/badge/github.com/berquerant/execx)](https://goreportcard.com/report/github.com/berquerant/execx)\n[![Go Reference](https://pkg.go.dev/badge/github.com/berquerant/execx.svg)](https://pkg.go.dev/github.com/berquerant/execx)\n\n# execx\n\nProvides `os/exec.Cmd` wrappers.\n\n``` go\nimport (\n\t\"bytes\"\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/berquerant/execx\"\n)\n\nfunc main() {\n\tscript := execx.NewScript(\n\t\t`echo line1\necho ${line2}\ncat -\necho line3 \u003e /dev/stderr`,\n\t\t\"sh\",\n\t)\n\tscript.Env.Set(\"line2\", \"LINE2\")\n\n\tif err := script.Runner(func(cmd *execx.Cmd) error {\n\t\tcmd.Stdin = bytes.NewBufferString(\"from stdin\\n\")\n\t\t_, err := cmd.Run(\n\t\t\tcontext.TODO(),\n\t\t\texecx.WithStdoutConsumer(func(x execx.Token) {\n\t\t\t\tfmt.Printf(\"1:%s\\n\", x)\n\t\t\t}),\n\t\t\texecx.WithStderrConsumer(func(x execx.Token) {\n\t\t\t\tfmt.Printf(\"2:%s\\n\", x)\n\t\t\t}),\n\t\t)\n\t\treturn err\n\t}); err != nil {\n\t\tpanic(err)\n\t}\n\n\t// Output:\n\t// 1:line1\n\t// 1:LINE2\n\t// 1:from stdin\n\t// 2:line3\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fberquerant%2Fexecx","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fberquerant%2Fexecx","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fberquerant%2Fexecx/lists"}