Skip to main content

A real-time machine-stats CLI dashboard with a JSON export API

Project description

minit-cli

A cross-platform (Ubuntu & Windows) real-time machine-stats CLI tool with a JSON export API.

PyPI Python License: MIT

Features

Feature Details
Per-core CPU Usage % for every logical core + overall average, physical/logical count, frequency
Memory Virtual RAM and swap utilisation (MB, %)
Disk space Per-partition used/free/total (GB, %) for all mounted filesystems
Disk I/O Cumulative read/write bytes and operation counts per disk
Network Per-NIC bytes sent/received, packet counts, errors and drops
Process list Top-N processes sorted by CPU %, with PID, name, user, status, CPU%, Mem%
Real-time dashboard Full-screen terminal dashboard via rich, refreshed every 2 s
JSON export API FastAPI server exposing last 10 minutes of snapshots at GET /stats

Install from PyPI

pip install minit-cli
minit setup          # adds minit to PATH (user shells + optionally system)
minit dashboard

Requirements: Python 3.9+ on Ubuntu/Debian or Windows 10/11.


Local setup

# 1. Clone the repo
git clone https://github.com/vamsi-ehc/minit-cli
cd minit-cli

# 2. (Recommended) Create and activate a virtual environment
python -m venv .venv
source .venv/bin/activate        # Linux / macOS
# .venv\Scripts\activate         # Windows

# 3. Install dependencies
pip install -r requirements.txt

# 4. Install the package in editable mode
pip install -e .

# 5. Verify the CLI is available
minit --help

Run tests

pytest

Commands

minit dashboard

Launch the full-screen real-time terminal dashboard (press Ctrl-C to quit).

minit dashboard              # default: refresh every 2 s
minit dashboard --refresh 5  # refresh every 5 s

minit serve

Start the JSON export API server. Stats are collected in the background and kept for 10 minutes (configurable via --interval).

minit serve                          # http://127.0.0.1:8000
minit serve --host 0.0.0.0 --port 9000 --interval 5

Endpoints:

Method Path Description
GET /health Liveness probe
GET /stats All snapshots from the last 10 minutes (JSON array)
GET /stats/latest Most recent snapshot (JSON object)

Interactive API docs are available at http://<host>:<port>/docs.

minit stats

Print a one-shot JSON snapshot to stdout (useful for scripting).

minit stats              # compact JSON
minit stats --pretty     # indented JSON

minit setup

Add the minit install directory to PATH so the command is available in every new shell session.

minit setup              # user-level: ~/.bashrc and ~/.zshrc (Linux/macOS)
                         #             HKCU\Environment via setx (Windows)
minit setup --system     # also update system-wide PATH
                         # Linux/macOS: /etc/environment (requires sudo)
                         # Windows:     HKLM environment key (requires admin shell)

Publishing to PyPI

Publishing is handled automatically by the GitHub Actions workflow on every pushed tag. To release a new version:

  1. Bump version in pyproject.toml
  2. Commit and push, then create a tag:
git tag v0.2.0
git push origin v0.2.0

The workflow builds and uploads the package to PyPI.


Project layout

minit_cli/
  cli.py                  # Click CLI entry point
  collectors/
    cpu.py                # Per-core CPU stats (psutil)
    memory.py             # RAM + swap stats
    disk.py               # Disk space + I/O
    network.py            # Per-NIC network stats
    processes.py          # Top-N process list
  dashboard/
    live.py               # Rich live dashboard
  api/
    server.py             # FastAPI application
    store.py              # Thread-safe 10-min rolling buffer
tests/
  test_collectors.py
  test_store.py
  test_server.py
  test_cli.py

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

minit_cli-0.2.0.tar.gz (15.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

minit_cli-0.2.0-py3-none-any.whl (15.2 kB view details)

Uploaded Python 3

File details

Details for the file minit_cli-0.2.0.tar.gz.

File metadata

  • Download URL: minit_cli-0.2.0.tar.gz
  • Upload date:
  • Size: 15.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for minit_cli-0.2.0.tar.gz
Algorithm Hash digest
SHA256 65f1db57a17beebabf9a6c966d774f4be0db52b81c1f01d721d6d42432bd3bdf
MD5 0f54be0d5bca7b9a16b0429b269c30ef
BLAKE2b-256 0d69d25c47550542f6f4db1a51003909e9a93f5ddba70705d4f33f0181ab8cfd

See more details on using hashes here.

Provenance

The following attestation bundles were made for minit_cli-0.2.0.tar.gz:

Publisher: publish.yml on vamsi-ehc/minit-cli

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file minit_cli-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: minit_cli-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 15.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for minit_cli-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 071798a2c2e8c4c7b41a6d16d4324a1c7b21df1b25297ce698ac552c1d27c411
MD5 6d83827605b6bf59a84bd67570b4f5dd
BLAKE2b-256 052a4033e30f53ef8f24281a05721b1c6cf08b8b60f70dcfb41dde8d5457afea

See more details on using hashes here.

Provenance

The following attestation bundles were made for minit_cli-0.2.0-py3-none-any.whl:

Publisher: publish.yml on vamsi-ehc/minit-cli

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page