{"id":14008068,"url":"https://github.com/mxssl/cmd-runner","last_synced_at":"2025-07-13T02:32:46.019Z","repository":{"id":57662883,"uuid":"139340492","full_name":"mxssl/cmd-runner","owner":"mxssl","description":"Execute commands on remote hosts asynchronously over ssh","archived":false,"fork":false,"pushed_at":"2018-09-16T11:15:06.000Z","size":1644,"stargazers_count":24,"open_issues_count":0,"forks_count":3,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-08-10T11:02:32.359Z","etag":null,"topics":["configuration","go","golang","ssh"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mxssl.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":"2018-07-01T15:31:23.000Z","updated_at":"2021-05-07T18:38:25.000Z","dependencies_parsed_at":"2022-09-13T06:50:23.883Z","dependency_job_id":null,"html_url":"https://github.com/mxssl/cmd-runner","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mxssl%2Fcmd-runner","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mxssl%2Fcmd-runner/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mxssl%2Fcmd-runner/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mxssl%2Fcmd-runner/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mxssl","download_url":"https://codeload.github.com/mxssl/cmd-runner/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225850176,"owners_count":17534067,"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":["configuration","go","golang","ssh"],"created_at":"2024-08-10T11:01:12.023Z","updated_at":"2024-11-22T06:12:17.124Z","avatar_url":"https://github.com/mxssl.png","language":"Go","funding_links":[],"categories":["Go"],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://github.com/mxssl/cmd-runner/blob/master/cmd-runner-logo.png\"\u003e\n\u003c/p\u003e\n\n# cmd-runner\n\nExecute commands on remote hosts asynchronously over ssh\n\n## Installation\n\nDownload compiled binary for your system\n\n[Linux](https://github.com/mxssl/cmd-runner/releases/download/0.0.4/cmd-runner-linux-amd64)\n\n[MacOS](https://github.com/mxssl/cmd-runner/releases/download/0.0.4/cmd-runner-darwin-amd64)\n\nExample\n\n```bash\nwget https://github.com/mxssl/cmd-runner/releases/download/0.0.4/cmd-runner-linux-amd64 -O cmd-runner\nmv cmd-runner /usr/local/bin/cmd-runner\nchmod +x /usr/local/bin/cmd-runner/cmd-runner\n```\n\n## How to run\n\n### Usecase 1\n\n#### Run commands from local file\n\n1. Create config file - `config.toml`\n\nExample:\n\n```toml\n# Credentials\nusername = \"root\"\npassword = \"password\"\n\n# SSH private and public keys\nssh_private_key = \"/home/user/.ssh/id_rsa\"\nssh_public_key = \"/home/user/.ssh/id_rsa.pub\"\n\n# SSH port\nssh_port = \"22\"\n\n# Connection method: \"key\" or \"password\"\nconnection_method = \"key\"\n\n# Remote hosts\nhosts = [\n\t\"1.1.1.1\",\n\t\"2.2.2.2\",\n\t\"3.3.3.3\"\n]\n\n# File with commands for \"cmd-runner start\" command\ncommands_file = \"commands.txt\"\n\n# \u003e Full \u003c source and destination path to file for \"cmd-runner copy\" command \nsource_path = \"/opt/scripts/script.sh\"\ndestination_path = \"/tmp/script.sh\"\n```\n\n2. Create file with commands that you want to run on remote hosts - `commands.txt`\n\nExample:\n\n```bash\napt-get update\napt-get upgrade -y\n```\n\n3. Start program `cmd-runner start`\n\nIf you want files with stdout per host then start `cmd-runner` with key:\n```\ncmd-runner start --file\n```\n\n`cmd-runner` will create files `hostname-output.txt`\n\n### Usecase 2\n\n#### Copy local file to remote hosts\n\n1. The same as `Usecase 1`\n\n2. Start program `cmd-runner copy`\n\n### Usecase 3\n\n#### Combine Usecase 1 and Usecase 2\n\nYou can copy bash script to remote hosts with `cmd-runner copy` and run this script with `cmd-runner start`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmxssl%2Fcmd-runner","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmxssl%2Fcmd-runner","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmxssl%2Fcmd-runner/lists"}