Metadata-Version: 2.4
Name: svtop
Version: 0.1.3
Summary: A pragmatic TUI for monitoring multi-server NVIDIA GPU utilization
Author: Astrorix
License: MIT
Requires-Python: >=3.10
Requires-Dist: paramiko>=3.4.0
Requires-Dist: textual>=0.58.0
Description-Content-Type: text/markdown

# svtop

`svtop` is a pragmatic TUI command for monitoring NVIDIA GPU usage across multiple servers.

Design goals inspired by Linus-style pragmatism:

- one job: show GPU health clearly
- simple state storage: `~/.svtop/servers.json` + `~/.svtop/settings.json`
- no mystery services, no daemon, no lock-in

## Features

- Multi-server polling over SSH
- Real-time TUI table with per-server aggregate rows, including CPU and system memory usage
- Press `Enter` to expand/collapse GPU detail rows for a server
- Expanded GPU detail row shows per-card user usage (sorted by usage)
- Press `s` on a selected server row to open an SSH shell (auto-installs your local public key when using password auth)
- Dual-pane transfer TUI (`svtop transfer`) for local/server browsing, queued rsync transfers, OSS-backed transfers via `ossutil cp`, and remembered transfer workspace
- Color-coded GPU and temperature severity for quick scanning
- First-run setup flow
- Editable server profiles via `svtop config`
- Per-server proxy jump chain (different server can use different bastion chain)
- Two auth paths:
  - plaintext password
  - one-key-copy bootstrap (`copy-key`) to install your local SSH public key remotely

## Install

```bash
pip install svtop
```

For local development:

```bash
pip install -e .
```

## Usage

Run monitor:

```bash
svtop
```

or:

```bash
svtop run --interval 2.5
```

If your network is slower (or via bastion/proxy jump), increase probe timeout:

```bash
svtop run --timeout 15
```

Open configuration menu:

```bash
svtop config
```

Open transfer UI:

```bash
svtop transfer
```

Tune transfer task concurrency:

```bash
svtop transfer --parallel 4
```

Use OSS cache for server-to-server transfers (default):

```bash
svtop transfer --relay oss
```

Use the older local rsync staging relay instead:

```bash
svtop transfer --relay rsync
```

List configured servers:

```bash
svtop list
```

When using password auth, pressing `s` first tries to install your local public key on the remote host, then switches that profile to key auth automatically. If no password is saved, it will ask once in terminal (leave empty to skip), and then continue with normal password login for that session.

When adding/editing a server profile, you can set:

- `Proxy jump chain (comma-separated user@host[:port])`

Examples:

- one bastion: `ops@jump-a`
- multi-hop chain: `ops@jump-a,core@jump-b:2222`

## Transfer mode quick keys

- top bar `Left` / `Right`: choose `Local` or any configured server from a dropdown
  - `oss`: use `ossutil cp` through `oss://nralgo/pth/mj/tmp/svtop` for any Local↔Server or Server↔Server transfer
  - `rsync`: use rsync directly for Local↔Server and local staging for Server↔Server
- each pane path bar: paste a local or remote path and press `Enter` to jump there
- last left/right endpoints, directories, direction, active pane, and relay engine are restored from `~/.svtop/settings.json`
- `Tab`: switch active pane
- `1` / `2`: cycle left/right endpoint
- `d`: toggle transfer direction (`L -> R` / `L <- R`)
- `Enter` or double-click: open highlighted directory
- `Space`: mark/unmark file or directory
- `F5` or click `Transfer`: transfer current item or all selected items to the other pane
- `Backspace`: go to parent directory
- `r`: refresh pane listing

## Remote requirements

- SSH access to each server
- `nvidia-smi` available in `PATH`
- `rsync` available locally (and on remote servers when using rsync transfer mode)
- `ossutil` configured on the local machine and/or remote servers used with OSS transfer mode
- if `proxy jump chain` is used, local `ssh` command must be available

## Security note

If you choose password auth, the password is stored in plaintext in `~/.svtop/servers.json` (mode `600`).
Prefer `copy-key` and SSH key auth for long-term use.
