96 lines
2.2 KiB
Markdown
96 lines
2.2 KiB
Markdown
# mux-0kmtui
|
|
|
|
TUI (Text User Interface) for running commands on multiple VPS simultaneously via `0km vps-mux`.
|
|
|
|
## Features
|
|
|
|
- **Multi-server selection**: Select multiple servers with the spacebar
|
|
- **Filter by name or tag**: Quickly search through your servers
|
|
- **Multi-line commands**: Write complete bash scripts in the editor
|
|
- **Script import**: Load `.sh` files to execute
|
|
- **Parallel execution**: Run commands on all selected servers at once
|
|
- **Real-time logs**: View output from each server in dedicated tabs
|
|
- **Closable tabs**: Close individual tabs when done
|
|
|
|
## Installation
|
|
|
|
```bash
|
|
cd mux-0kmtui
|
|
pip install -e .
|
|
```
|
|
|
|
## Usage
|
|
|
|
```bash
|
|
mux-0kmtui
|
|
```
|
|
|
|
### Workflow
|
|
|
|
1. **Filter** (optional): Type in the search bar to filter by name or tag
|
|
2. **Select**: Check the servers (Space to toggle, or All/None buttons)
|
|
3. **Command**: Type a command or load a script (Ctrl+O)
|
|
4. **Execute**: Press `Ctrl+R` or click "Run"
|
|
5. **Monitor**: View logs from each server in the tabs
|
|
6. **Clean up**: Close tabs with the X button
|
|
|
|
### Keyboard Shortcuts
|
|
|
|
| Key | Action |
|
|
|-----|--------|
|
|
| `F1` | Show help |
|
|
| `Ctrl+Q` | Quit |
|
|
| `Ctrl+R` | Run command |
|
|
| `Ctrl+O` | Load .sh file |
|
|
| `Ctrl+L` | Close all tabs |
|
|
| `Ctrl+A` | Select all visible servers |
|
|
| `Ctrl+D` | Deselect all visible servers |
|
|
| `Escape` | Focus command input |
|
|
| `Space` | Toggle server selection |
|
|
|
|
## Configuration
|
|
|
|
Configuration is read from (in order of priority):
|
|
|
|
1. `~/.config/0kmtui/config.yml`
|
|
2. `~/.config/0km/config.yml`
|
|
3. `/etc/0km/config.yml`
|
|
|
|
### Format
|
|
|
|
```yaml
|
|
hosts:
|
|
my-server.com:
|
|
host: my-server.com
|
|
tags: [prod, web]
|
|
|
|
staging.example.com:
|
|
host: staging.example.com
|
|
tags: [staging, api]
|
|
|
|
db-server:
|
|
host: 192.168.1.100
|
|
user: admin
|
|
port: 2222
|
|
tags: [prod, database]
|
|
```
|
|
|
|
### Fields
|
|
|
|
| Field | Description | Default |
|
|
|-------|-------------|---------|
|
|
| `host` | Hostname or IP | (entry name) |
|
|
| `user` | SSH user | `root` |
|
|
| `port` | SSH port | `22` |
|
|
| `tags` | List of tags for filtering | `[]` |
|
|
|
|
## Requirements
|
|
|
|
- Python 3.10+
|
|
- `0km` command installed and in PATH (from [myc-manage](https://git.myceliandre.fr/Myceliandre/myc-manage))
|
|
- SSH access to configured servers
|
|
|
|
## License
|
|
|
|
AGPL-3.0 - See [LICENSE](../LICENSE)
|