{"id":29128225,"url":"https://github.com/mibk/shellexec","last_synced_at":"2025-06-30T01:37:50.528Z","repository":{"id":57499293,"uuid":"104529511","full_name":"mibk/shellexec","owner":"mibk","description":"a convenience package for shell-like execution of commands in Go","archived":false,"fork":false,"pushed_at":"2017-10-09T07:46:03.000Z","size":23,"stargazers_count":12,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-06-19T05:44:10.977Z","etag":null,"topics":["go","golang","golang-library","shell"],"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/mibk.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}},"created_at":"2017-09-23T00:27:40.000Z","updated_at":"2024-03-08T12:45:00.000Z","dependencies_parsed_at":"2022-08-28T14:21:03.019Z","dependency_job_id":null,"html_url":"https://github.com/mibk/shellexec","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/mibk/shellexec","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mibk%2Fshellexec","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mibk%2Fshellexec/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mibk%2Fshellexec/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mibk%2Fshellexec/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mibk","download_url":"https://codeload.github.com/mibk/shellexec/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mibk%2Fshellexec/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262694476,"owners_count":23349854,"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","golang-library","shell"],"created_at":"2025-06-30T01:37:49.524Z","updated_at":"2025-06-30T01:37:50.507Z","avatar_url":"https://github.com/mibk.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# shellexec [![GoDoc](https://godoc.org/github.com/mibk/shellexec?status.png)](https://godoc.org/github.com/mibk/shellexec)\n\nPackage shellexec provides cross-platform shell-like command execution. It\nsupports a small subset of the Shell Command Language related to executing\nof commands. Package shellexec isn't a replacement for `os/exec`. It's rather\njust a convenience package for use-cases that require/prefer having just a\nsingle string to define the command to execute.\n\n## Installation\n\n```bash\n$ go get github.com/mibk/shellexec\n```\n\n## Example\n\n```go\npackage main\n\nimport (\n\t\"log\"\n\t\"os\"\n\n\t\"github.com/mibk/shellexec\"\n)\n\nfunc main() {\n\trun(`echo  'Sup'ports  \"\\\"quotes\\\",\"`)\n\trun(`VARIABLE=assignment, X=3 env`)\n\trun(`echo \"and variable expansion, $USER.\"`)\n\trun(`echo Returns just '\"os/exec\".Cmd,' that can be`)\n\trun(`echo further adjusted before running.`)\n\n\trun(`echo The goal is to support a really \\*small\\* subset`)\n\trun(`echo of the Shell language while being 100\\% compatible.`)\n}\n\nfunc run(command string) {\n\tcmd, err := shellexec.Command(command)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tcmd.Stdin = os.Stdin\n\tcmd.Stdout = os.Stdout\n\tcmd.Stderr = os.Stderr\n\n\tif err := cmd.Run(); err != nil {\n\t\tlog.Fatal(err)\n\t}\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmibk%2Fshellexec","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmibk%2Fshellexec","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmibk%2Fshellexec/lists"}