A command-line tool to execute commands on multiple remote hosts
Project description
Ananta (formerly Hydra)
Ananta is a powerful command-line tool that unleashes simultaneous SSH command execution across multiple remote hosts. It streamlines workflows, automates repetitive tasks, and enhances efficiency for system administrators and developers managing distributed systems.
Namesake
Ananta, inspired by Ananta Shesha or Ananta Nagaraja (อนันตนาคราช), is a many-headed serpentine demigod from Hindu mythology that has taken deep root in Thai culture.
This project used to be named Hydra, the many-headed serpent in Greek mythology. However, due to numerous Hydra and hydra-* projects on PyPI (see the old project at https://pypi.org/project/hydra-ssh/), I renamed it to Ananta-shorter and more unique!
Features
- Execute commands across multiple remote hosts concurrently
- Supports flexible CSV-based host list configuration
- SSH authentication with public key support
- Lightweight and intuitive command-line interface
- Color-coded output for easy host differentiation
- Option to separate host outputs without interleaving
- Handles cursor control codes for commands requiring specific layouts (e.g.,
fastfetch,neofetch)
Installation
System Requirements
- Python 3.10 or higher
pippackage manager- Required dependencies:
asyncssh,argparse,asyncio - Optional:
uvloop(Unix-like systems) orwinloop(Windows) for enhanced performance
Installing via pip
Install Ananta directly using pip:
$ pip install ananta --user
Note: Ensure Python 3.10 or higher is installed on your system.
Note: If you previously used hydra-ssh, switch to pip install ananta for the latest updates!
Usage
Hosts File Format
Create a hosts file in CSV format with the following structure:
#alias,ip,port,username,key_path
host-1,10.0.0.1,22,user,/home/user/.ssh/id_ed25519
host-2,10.0.0.2,22,user,#
- Lines starting with
#are ignored. key_path:- Specify the path to an SSH private key.
- Use
#to use the default key provided via the-Koption. - If
#is used without-K, Ananta attempts to use common SSH keys from~/.ssh/.
Running Commands
Execute a command on remote hosts with:
$ ananta [hosts file] [command]
Example:
$ ananta hosts.csv "uptime"
Options
-N, --no-color: Disable colorized output-S, --separate-output: Display output from each host separately-W, --terminal-width: Manually set terminal width-E, --allow-empty-line: Permit printing of empty lines-C, --allow-cursor-control: Enable cursor control codes (e.g., forfastfetchorneofetch)-V, --version: Display Ananta version-K, --default-key: Specify path to default SSH private key
License
The MIT License (MIT)
Copyright (c) 2023-2025 cwt(at)bashell(dot)com
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ananta-1.0.3.tar.gz.
File metadata
- Download URL: ananta-1.0.3.tar.gz
- Upload date:
- Size: 1.1 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.1.2 CPython/3.13.2 Linux/6.13.9-200.fc41.x86_64
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
aba16bfb97cdc9139924c001675ea06c24e12dc1ff04d4c1de17327030370c3b
|
|
| MD5 |
1e9a83bbaef112d1915e9f68f027db0b
|
|
| BLAKE2b-256 |
eb1913064a3a2ebd20d469bd7dd9ecc4ad735e7559da95d9aa5ff9cff7eabe45
|
File details
Details for the file ananta-1.0.3-py3-none-any.whl.
File metadata
- Download URL: ananta-1.0.3-py3-none-any.whl
- Upload date:
- Size: 1.5 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.1.2 CPython/3.13.2 Linux/6.13.9-200.fc41.x86_64
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b18af8a14d30fcfb4209909341fecc5e8e380bf214d8693308a430aaa1714858
|
|
| MD5 |
6225aaa9d9ea0be2033aab684f99c9ea
|
|
| BLAKE2b-256 |
d3b6356a1f442520129e7fc30bf44b4c7af03507b4fc14afebef28ea853e7bba
|