Metadata-Version: 2.5
Name: nvclocktop
Version: 1.2.2
Summary: A fullscreen terminal clock and GPU dashboard for NVIDIA Linux workstations and Apple Silicon Macs.
Author: nvclocktop contributors
License-Expression: MIT
License-File: LICENSE
Keywords: apple-silicon,clock,dashboard,gpu,linux,macos,monitoring,nvidia,nvidia-smi,terminal,tui
Classifier: Development Status :: 5 - Production/Stable
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: POSIX :: Linux
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: System :: Monitoring
Classifier: Topic :: Terminals
Requires-Python: >=3.10
Requires-Dist: psutil>=5.9
Requires-Dist: pyfiglet>=1.0
Requires-Dist: rich>=13.7
Provides-Extra: dev
Requires-Dist: cairosvg>=2.7; extra == 'dev'
Requires-Dist: pillow>=10.0; extra == 'dev'
Requires-Dist: pytest>=8.0; extra == 'dev'
Requires-Dist: ruff>=0.5; extra == 'dev'
Description-Content-Type: text/markdown

<div align="center">

<h1>nvclocktop</h1>

<p>
  <strong>A fullscreen terminal clock and GPU dashboard for NVIDIA Linux workstations and Apple Silicon Macs.</strong>
</p>

<p>
  Turn any terminal into a live status screen for AI workstations, local model machines, homelab servers, and SSH sessions.
</p>

<img src="https://raw.githubusercontent.com/stephenlzc/nvclocktop/main/docs/assets/hero-macos-apple-silicon.png" alt="Apple Silicon dashboard with CPU and GPU, Disk and Log, and a full-width upload and download chart">

</div>

---

The screenshots are rendered by nvclocktop using sample metrics, addresses, and log entries.

## Installation

```bash
pip install nvclocktop
```

Or with `pipx`:

```bash
pipx install nvclocktop
```

## Usage

```bash
nvclocktop
```

Useful options:

```bash
nvclocktop --refresh 1
nvclocktop --once
nvclocktop --font big
nvclocktop --theme cyber
```

The Network, Disk, and Log panels are on by default. Turn them off one by one:

```bash
nvclocktop --no-network
nvclocktop --no-disk
nvclocktop --no-log
```

`--no-disk` also hides disk read and write speeds. `--no-network` stops network sampling and the public IP lookup.

## Features

- Large fixed-position terminal clock with seconds
- CPU usage, memory, load average, and per-thread activity
- NVIDIA GPU usage, memory, temperature, power, fan, and driver info on Linux
- Apple Silicon GPU and unified memory display on macOS
- Network panel with a rolling 10-minute upload and download chart, current rates, interface addresses, and cumulative traffic
- Disk panel: total, used, and available space of the volume that holds the home directory, with the usage rate and the disk read and write speed
- Log panel: the last 10 system log lines, errors in red and warnings in yellow
- Adaptive layout for wide and compact terminals
- Keyboard controls: `Q` to quit, `H` for help
- Works well over SSH

## Layout

Below the clock, the dashboard has three rows when all panels fit.

1. **CPU and GPU**
2. **Disk and Log**
3. **Network**, across the full width

In a short terminal, the Network chart can shrink to two compact trends or just the current rates. Disk and Log appear when space permits.

## Network and privacy

Live mode samples the machine's upload and download rates once per second and keeps the last 10 minutes in memory. `--refresh` controls screen updates. The newest samples appear on the left at `Now` and move right toward `−10 min` as they age. The Linux virtual console draws connected pink and green lines and uses light gray where they share a cell. The legend shows the latest rates. `--once` prints a static snapshot with the Up and Down fields.

```text
If     en0
IPv4   192.168.1.23
IPv6   2001:db8::1
Public 203.0.113.7
Pub6   2001:db8::2
Up     1.2 MB/s
Down   5.6 MB/s
Sent   12.0 GB
Recv   104.0 GB
```

Public IPv6 appears when available. The `+N more` row counts additional interfaces that could not fit.

- The public IPv4 address is looked up over HTTPS, the endpoints are tried in order: `api.ipify.org`, `ifconfig.me`, `cloudflare.com/cdn-cgi/trace`. The lookup runs at most once every 10 minutes.
- The request is a plain HTTPS GET with a fixed User-Agent (`nvclocktop/<version>`) and nothing of this machine in it: no host name, no MAC address, no local address.
- `--no-network` hides the panel and stops the public IP lookup completely, no request leaves the machine.
- The Log panel is read only. macOS reads it with `log show`, Linux with `journalctl` or `/var/log/syslog`. The lines are shown in the local terminal, they are never written to disk and never uploaded.

## Style Presets

`nvclocktop` ships with official clock font and color presets. Invalid preset names are rejected by the CLI, so saved scripts and dashboard setups fail fast instead of silently falling back to an unexpected style.

Available font presets:

```bash
nvclocktop --font terrace
nvclocktop --font big
nvclocktop --font standard
nvclocktop --font slant
nvclocktop --font chunky
```

Available color themes:

```bash
nvclocktop --theme rainbow
nvclocktop --theme cyber
nvclocktop --theme ocean
nvclocktop --theme amber
nvclocktop --theme mono
```

### Preset Gallery

<table>
  <tr>
    <th><code>--font terrace --theme rainbow</code></th>
    <th><code>--font terrace --theme cyber</code></th>
  </tr>
  <tr>
    <td><img src="https://raw.githubusercontent.com/stephenlzc/nvclocktop/main/docs/assets/presets/preset-terrace-rainbow-nvidia.png" alt="NVIDIA dashboard using Terrace and Rainbow" width="420"></td>
    <td><img src="https://raw.githubusercontent.com/stephenlzc/nvclocktop/main/docs/assets/presets/preset-terrace-cyber-nvidia.png" alt="NVIDIA dashboard using Terrace and Cyber" width="420"></td>
  </tr>
  <tr>
    <th><code>--font big --theme ocean</code></th>
    <th><code>--font standard --theme amber</code></th>
  </tr>
  <tr>
    <td><img src="https://raw.githubusercontent.com/stephenlzc/nvclocktop/main/docs/assets/presets/preset-big-ocean-nvidia.png" alt="NVIDIA dashboard using Big and Ocean" width="420"></td>
    <td><img src="https://raw.githubusercontent.com/stephenlzc/nvclocktop/main/docs/assets/presets/preset-standard-amber-nvidia.png" alt="NVIDIA dashboard using Standard and Amber" width="420"></td>
  </tr>
  <tr>
    <th colspan="2"><code>--font slant --theme mono</code></th>
  </tr>
  <tr>
    <td colspan="2" align="center"><img src="https://raw.githubusercontent.com/stephenlzc/nvclocktop/main/docs/assets/presets/preset-slant-mono-nvidia.png" alt="NVIDIA dashboard using Slant and Mono" width="420"></td>
  </tr>
</table>

## Platform Support

Currently supported:

| Platform | GPU support | Notes |
| --- | --- | --- |
| Linux | NVIDIA GPUs via `nvidia-smi` | Best supported path |
| macOS | Apple Silicon GPU display | Includes unified memory display |
| CPU | Intel and AMD CPUs | Uses standard system metrics |

Panel support:

| Panel | macOS | Linux |
| --- | --- | --- |
| Network | Interface addresses and system traffic counters | Interface addresses and system traffic counters |
| Disk | Home volume capacity and system I/O counters | Home volume capacity and system I/O counters |
| Log | `log show` | `journalctl` or `/var/log/syslog` |

Not currently supported:

- AMD GPUs
- Intel GPUs
- Windows native terminal

## Known limitations

- With a VPN the Network panel can show an outdated public IP: a virtual interface that carries the default route may be taken as the main interface.
- A terminal that is too narrow or too short hides the Disk and Log panels.
- An interface that only carries a link-local IPv6 address and no IPv4 address does not show up in the Network panel.

The details are in `docs/ACCEPTANCE_network_v1.0.md` and `docs/ACCEPTANCE_v1.1.md`.

## Keyboard Shortcuts

| Key | Action |
| --- | --- |
| `Q` | Quit |
| `H` | Show or hide help |
| `Ctrl+C` | Quit immediately |

## Development

```bash
git clone https://github.com/stephenlzc/nvclocktop.git
cd nvclocktop
python3 -m venv .venv
. .venv/bin/activate
pip install -e ".[dev]"
pytest
```

With Chrome or Chromium installed, regenerate the README screenshots with `python scripts/render_readme_assets.py`.

## License

MIT
