{"id":27282760,"url":"https://github.com/cwt/ananta","last_synced_at":"2025-04-11T18:16:20.722Z","repository":{"id":285244727,"uuid":"957495812","full_name":"cwt/ananta","owner":"cwt","description":"command-line tool to execute commands on multiple remote hosts (mirror)","archived":false,"fork":false,"pushed_at":"2025-04-04T05:30:20.000Z","size":223,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-11T18:16:15.520Z","etag":null,"topics":["asyncio","asyncssh","python","ssh"],"latest_commit_sha":null,"homepage":"https://sr.ht/~cwt/ananta","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-04-04T05:30:24.000Z","dependencies_parsed_at":"2025-03-30T15:38:46.156Z","dependency_job_id":null,"html_url":"https://github.com/cwt/ananta","commit_stats":null,"previous_names":["cwt/hydra","cwt/ananta"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cwt%2Fananta","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cwt%2Fananta/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cwt%2Fananta/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cwt%2Fananta/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cwt","download_url":"https://codeload.github.com/cwt/ananta/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248456368,"owners_count":21106604,"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-04-11T18:16:19.084Z","updated_at":"2025-04-11T18:16:20.558Z","avatar_url":"https://github.com/cwt.png","language":"Python","readme":"# Ananta (formerly Hydra)\n\nAnanta is a *powerful* command-line tool designed to simplify simultaneous SSH command execution across multiple remote hosts. It enhances workflows, automates repetitive tasks, and improves efficiency for system administrators and developers managing distributed systems.\n\n## Namesake\n\nAnanta draws inspiration from Ananta Shesha or Ananta Nagaraja (อนันตนาคราช), the many-headed serpentine demigod from Hindu mythology deeply rooted in Thai culture.\n\nInitially, this project was named Hydra, referencing the many-headed serpent in Greek mythology. However, due to the abundance of projects named Hydra or hydra-* on PyPI (e.g., the previous project at [https://pypi.org/project/hydra-ssh/](https://pypi.org/project/hydra-ssh/)), it was renamed to Ananta. The commands you now use are `ananta`, which is shorter, more distinctive, and easier to remember than `hydra-ssh`.\n\n## Features\n\n- Concurrent execution of commands across multiple remote hosts\n- Flexible CSV-based host list configuration\n- SSH authentication with public key support\n- Lightweight and user-friendly command-line interface\n- Color-coded output for easy host differentiation\n- Option to separate host outputs for clarity\n- Support for cursor control codes for specific layouts (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` (Unix-based systems) or `winloop` (Windows) for enhanced performance\n\n### Installing via pip\n\nInstall Ananta using pip:\n\n```bash\npip install ananta --user\n```\n\nInstall Ananta using pip with `uvloop` or `winloop` for *speed* enhancement:\n```bash\npip install ananta[speed] --user\n```\n\n**Note:** Ensure Python 3.10 or higher is installed on your system.  \nIf you previously used `hydra-ssh`, update your command to `pip install ananta` to access the latest version.\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_ed25519\nhost-2,10.0.0.2,22,user,#\n```\n\n- Lines beginning with `#` are ignored.\n- **`key_path` details:**\n  - Provide the path to an SSH private key.\n  - Use `#` to indicate the default key specified via the `-K` option.\n  - If `#` is used without `-K`, Ananta will attempt to use commonly available SSH keys from `~/.ssh/`.\n\n### Running Commands\n\nRun commands on remote hosts with:\n\n```bash\nananta \u003coptions\u003e [hosts file] [command]\n```\n\n**Example:**\n\n```console\n$ ananta hosts.csv uptime\n$ ananta -S sensors\n$ ananta -CS hosts.csv fastfetch\n```\n\n### Options\n\n- `-N, --no-color`: Disable colorized output\n- `-S, --separate-output`: Display output from each host separately\n- `-W, --terminal-width`: Manually set terminal width\n- `-E, --allow-empty-line`: Permit printing of empty lines\n- `-C, --allow-cursor-control`: Enable cursor control codes (e.g., for `fastfetch` or `neofetch`)\n- `-V, --version`: Display the Ananta version\n- `-K, --default-key`: Specify the default SSH private key path\n\n### Demo\n\n[![asciicast](https://asciinema.org/a/711115.svg)](https://asciinema.org/a/711115)\n\n[![asciicast](https://asciinema.org/a/711116.svg)](https://asciinema.org/a/711116)\n\n## License\n\n```text\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%2Fananta","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcwt%2Fananta","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcwt%2Fananta/lists"}