{"id":20284502,"url":"https://github.com/artyom/rex","last_synced_at":"2026-03-03T23:31:16.019Z","repository":{"id":25923675,"uuid":"29364788","full_name":"artyom/rex","owner":"artyom","description":"rex executes given command(s) on multiple remote hosts, ssh-connecting to them in parallel","archived":false,"fork":false,"pushed_at":"2025-04-16T17:58:48.000Z","size":35,"stargazers_count":5,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-13T19:36:03.763Z","etag":null,"topics":["devops-tools","remote-control","ssh"],"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/artyom.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","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":"2015-01-16T19:42:48.000Z","updated_at":"2025-04-16T17:58:52.000Z","dependencies_parsed_at":"2024-06-19T11:30:53.428Z","dependency_job_id":"cc9ec861-1496-446d-8b6b-3771db23b6bb","html_url":"https://github.com/artyom/rex","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/artyom/rex","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/artyom%2Frex","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/artyom%2Frex/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/artyom%2Frex/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/artyom%2Frex/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/artyom","download_url":"https://codeload.github.com/artyom/rex/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/artyom%2Frex/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30065769,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-03T18:21:05.932Z","status":"ssl_error","status_checked_at":"2026-03-03T18:20:59.341Z","response_time":61,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["devops-tools","remote-control","ssh"],"created_at":"2024-11-14T14:19:58.403Z","updated_at":"2026-03-03T23:31:15.988Z","avatar_url":"https://github.com/artyom.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# rex (remote execute)\n\nrex executes given command(s) on multiple remote hosts, ssh-connecting to them\nin parallel.\n\nYou're expected to have passwordless access to hosts, rex authenticates itself\nwith the help of ssh-agent that is expected to be running.\n\n[![asciicast](https://asciinema.org/a/960vkpm5z1ktwm3jhuh5kvgxo.png)](https://asciinema.org/a/960vkpm5z1ktwm3jhuh5kvgxo)\n\n## Setup\n\n\tgo install github.com/artyom/rex@latest\n\nBinary will be placed either to directory set with `${GOBIN}` environment or to `${GOPATH}/bin` which defaults to `${HOME}/go/bin`.\n\n## Usage examples\n\nExecute `uptime` command on multiple hosts:\n\n\trex -l root -cmd 'uptime' host1.example.com host2.example.com\n\nDefault username may be overridden on a per-host basis:\n\n\trex -l root -cmd 'uptime' host1.example.com admin@host2.example.com\n\nDefault username can be set as environment variable:\n\n\texport REX_USER=admin\n\nIf output should be saved to files, not printed to console, use `-logs` flag:\n\n\trex -logs -l root -cmd '/etc/init.d/mysql restart' db1.example.com db2.example.com\n\nBy default output would be saved to `/tmp/db1.example.com.stdout`,\n`/tmp/db1.example.com.stderr`, etc. Empty files would be automatically removed.\nOverride filename templates with `-logs.stderr` and `-logs.stdout` flags.\n\nWhen complex processing is required on remote hosts, it can be easier to write\nseparate script and pass it via `-stdin` flag:\n\n\trex -stdin my-script.sh -cmd '/bin/sh' host1.example.com host2.example.com\n\nNote, `-stdin` argument should be a **regular file**, since it is read multiple\ntimes — one time per remote host, so giving something pipe-like here won't\nwork.\n\nThe same mechanism can be used to copy arbitrary data:\n\n\trex -stdin archive.tar.gz -cmd 'tar xz -C /tmp \u0026\u0026 cp -v /tmp/file-from-archive /dst' host1 host2\n\nSince in most workflows multiple hosts are used together over and over again,\nit's easier to group them together. rex treats hostname starting with `@`\nsymbol as group name; groups are read from yaml file specified by `-g` flag\nwhich defaults to `$HOME/.rex-groups.yaml`. Consider the file with following\ncontent:\n\n\talpha:\n\t  - alpha1.example.com\n\t  - alpha2.example.com\n\t  - alpha3.example.com\n\tbeta:\n\t  - beta1.example.com\n\t  - beta2.example.com\n\t  - beta3.example.com\n\t  - beta4.example.com\n\nNow rex can use groups:\n\n\trex -cmd 'uptime' @alpha @beta\n\nBoth groups and arbitrary hosts can be used together.\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fartyom%2Frex","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fartyom%2Frex","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fartyom%2Frex/lists"}