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 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

Publishing to PyPI

Prerequisites

pip install build twine

1. Bump the version

Edit pyproject.toml and update the version field:

[project]
version = "0.2.0"   # increment as needed

2. Build the distribution

python -m build

This produces dist/minit_cli-<version>-py3-none-any.whl and dist/minit_cli-<version>.tar.gz.

3. Upload to PyPI

# Upload to the real PyPI index
twine upload dist/*

You will be prompted for your PyPI username and password (or an API token — recommended). To use an API token, set your credentials once:

# ~/.pypirc  (create if it doesn't exist)
[pypi]
  username = __token__
  password = pypi-<your-api-token>

Or pass the token inline:

twine upload -u __token__ -p pypi-<your-api-token> dist/*

4. Test on TestPyPI first (optional but recommended)

twine upload --repository testpypi dist/*
pip install --index-url https://test.pypi.org/simple/ minit-cli

5. Verify the published package

pip install minit-cli          # install from PyPI
minit --help
minit dashboard

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.1.0.tar.gz (13.7 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.1.0-py3-none-any.whl (13.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: minit_cli-0.1.0.tar.gz
  • Upload date:
  • Size: 13.7 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.1.0.tar.gz
Algorithm Hash digest
SHA256 ac1dc233e27a5838815718a2ad621d4a42f4596bad8a57b549ceaefffd967186
MD5 7d39186d771a81f30fdbb450f22a2289
BLAKE2b-256 980f8a1890990cd009e5532ed2402ed348fe0377111c7b7345ab8cab97454f2a

See more details on using hashes here.

Provenance

The following attestation bundles were made for minit_cli-0.1.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.1.0-py3-none-any.whl.

File metadata

  • Download URL: minit_cli-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 13.3 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.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c26dcf80f4df2f2e4caefbab9665bcef61fcaca5a56e70430e0666a62c1295f4
MD5 77487838315465338568bdaf71e69958
BLAKE2b-256 f1aa63b429454cf6b2ba32fba8d4427dd13f9c8559c855ba6ecc97ac6264e1cd

See more details on using hashes here.

Provenance

The following attestation bundles were made for minit_cli-0.1.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