{"id":26873649,"url":"https://github.com/cwt/hydra","last_synced_at":"2025-03-31T09:19:46.323Z","repository":{"id":285244727,"uuid":"957495812","full_name":"cwt/hydra","owner":"cwt","description":"command-line tool to execute commands on multiple remote hosts (mirror)","archived":false,"fork":false,"pushed_at":"2025-03-30T14:26:58.000Z","size":135,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-30T15:27:49.597Z","etag":null,"topics":["asyncio","asyncssh","python","ssh"],"latest_commit_sha":null,"homepage":"https://sr.ht/~cwt/hydra/","language":"Python","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/cwt.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-03-30T14:17:25.000Z","updated_at":"2025-03-30T14:42:33.000Z","dependencies_parsed_at":"2025-03-30T15:38:46.156Z","dependency_job_id":null,"html_url":"https://github.com/cwt/hydra","commit_stats":null,"previous_names":["cwt/hydra"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cwt%2Fhydra","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cwt%2Fhydra/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cwt%2Fhydra/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cwt%2Fhydra/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cwt","download_url":"https://codeload.github.com/cwt/hydra/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246443534,"owners_count":20778252,"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":["asyncio","asyncssh","python","ssh"],"created_at":"2025-03-31T09:19:45.673Z","updated_at":"2025-03-31T09:19:46.309Z","avatar_url":"https://github.com/cwt.png","language":"Python","readme":"# Hydra\n\nHydra is a command-line tool that allows users to execute commands on multiple remote hosts at once via SSH. With Hydra, you can streamline your workflow, automate repetitive tasks, and save time and effort.\n\n## Features\n\n- Execute commands on multiple remote hosts simultaneously\n- Flexible and configurable host list format (CSV)\n- Supports SSH and public key authentication\n- Clean, lightweight, and easy-to-use command-line interface\n- Color-coded output for easy host identification\n- Option to separate output for each host without interleaving\n- Support for cursor control codes for commands requiring special layout (e.g., `fastfetch`, `neofetch`)\n\n## Installation\n\n### System Requirements\n\n- Python 3.10 or higher\n- pip package manager\n- Required dependencies: `asyncssh`, `argparse`, `asyncio`\n- Optional: `uvloop` for improved performance on Unix-like systems\n\n### Installing via Mercurial\n\nClone the project via Mercurial:\n\n```\n$ hg clone https://hg.sr.ht/~cwt/hydra\n$ cd hydra\n$ pip install -r requirements.txt --user\n```\n\n### Installing via Download\n\nAlternatively, you can download the latest code:\n\n```\n$ curl https://hg.sr.ht/~cwt/hydra/archive/tip.tar.gz | tar zxf -\n$ cd hydra-tip\n$ pip install -r requirements.txt --user\n```\n\n**Note:** Ensure you have Python 3.10 or higher installed.\n\n## Usage\n\n### Hosts File Format\n\nCreate a hosts file in CSV format with the following structure:\n\n```csv\n#alias,ip,port,username,key_path\nhost-1,10.0.0.1,22,user,/home/user/.ssh/id_25519\nhost-2,10.0.0.2,22,user,#\n```\n\n- Lines starting with `#` are ignored.\n- In the `key_path` field:\n  - Specify the path to the SSH private key file.\n  - Use `#` to indicate that the default key specified via the `-K` option should be used.\n  - If no key is specified and `#` is used without `-K`, Hydra will attempt to use common SSH keys in `~/.ssh/`.\n\n### Running Commands\n\nTo execute a command on the remote hosts, use:\n\n```\n$ ./hydra.py [hosts file] [command]\n```\n\nFor example:\n\n```\n$ ./hydra.py hosts.csv \"ls -l\"\n```\n\n### Options\n\n- `-N, --no-color`: Disable host coloring.\n- `-S, --separate-output`: Print output from each host without interleaving.\n- `-W, --terminal-width`: Set terminal width manually.\n- `-E, --allow-empty-line`: Allow printing empty lines.\n- `-C, --allow-cursor-control`: Allow cursor control codes for commands like `fastfetch` or `neofetch`.\n- `-V, --version`: Show the version of Hydra.\n- `-K, --default-key`: Path to default SSH private key.\n\n## License\n\n```\nThe MIT License (MIT)\n\nCopyright (c) 2023-2025 cwt(at)bashell(dot)com\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n```\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcwt%2Fhydra","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcwt%2Fhydra","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcwt%2Fhydra/lists"}