Skip to main content

usm

Tests PyPI Downloads Python License Docs

One CLI for the boxes you SSH into.

33 tools for what you actually do on a remote machine — open a tunnel, find a free GPU, mount a blob container, serve a directory, kill whatever is holding port 8080 — behind a single command that installs in one line.

curl -fsSL https://raw.githubusercontent.com/HSPK/usm/main/scripts/install.sh | bash

Then, on any machine:

$ usm search proxy
2 match(es) for 'proxy'

     name           version   description
 ──────────────────────────────────────────────────────────────────────────
 ●   openai-proxy   v1.4.1    Local OpenAI + Anthropic compatible proxy fo…
 ○   proxy          v1.0.1    HTTP/SOCKS/Shadowsocks proxy server or simpl…

● cached  ○ not yet downloaded · 1/2 cached · usm <name> --help for details

Why

Every one of these started as a script pasted between machines until it rotted. usm is the version that stopped rotting: one install, one help system, and one set of conventions everywhere you work.

  • Nothing to set up per machine. Scripts download on first use and are cached under ~/.cache/usm/scripts, pinned by SHA-256.
  • No dependency roulette. Each script declares its own requirements and gets its own venv, so usm gpu never breaks because usm openai-proxy wanted a different httpx — and nothing lands in your system Python.
  • Long-running things stay running. Tunnels, proxies, syncs, and mounts install as systemd/launchd units with enable, status, and logs.
  • Consistent by design. Same verbs (ls, status, logs, enable), same output vocabulary, same --json where it matters. See the design system.

The package installs as usmo; the command is usm.

Commands

usm list                 # everything
usm list --cached        # just what's downloaded
usm search blob          # match names and descriptions
usm <command> --help     # help for one command

Network & remote

Command What it does
host SSH inventory in a fenced ~/.ssh/config block, plus fan-out exec
ssh ssh with auto-reconnect and terminal repair
tunnel SSH tunnels (local/remote/SOCKS) with state + autostart
proxy Turn a box into an HTTP/SOCKS/Shadowsocks proxy, or a Clash client
clash ClashX-style manager for mihomo: subs, TUN, nodes, latency
net Inspect, diagnose, and monitor host networking
port Show what holds a port; free it
wait Block until host:port / TCP / HTTP answers
session Inspect and manage logged-in user sessions

Files & storage

Command What it does
share Serve a file/dir over HTTP, optionally tunneled out
serve Full file server via miniserve (uploads, range, zip, auth)
rsync rsync with sensible defaults + auto-excludes
cp Copy across local and blobfuse paths, delegating to azcopy
azsync Watch a directory and keep it mirrored to Azure Blob
blobmount Mount blob containers, keeping the SAS fresh
dl Resumable, checksum-verified downloads with mirrors
space Find what's eating the disk and reclaim it safely
clip Clipboard from stdin; OSC52 fallback over SSH

Machine & hardware

Command What it does
doctor One-pass health check: disk, memory, GPU, mounts, services
init Bootstrap a machine with modern dev tools (cross-platform)
gpu GPU inventory, free-picker, watch, and kill
disk Inspect, partition, format, and mount disks
bench Benchmark CPU / memory / disk / network / GPU
cu122 Install NVIDIA driver + CUDA 12.2
sysinfo System / GPU / CUDA environment summary
check_py Show the active Python/pip versions

Dev workflow

Command What it does
svc Run any command as a supervised service, with boot integration
watch Re-run a command whenever files change, debounced
secret Encrypted local env store; inject secrets into processes
git-auth Select Git identities and SSH keys by directory
notify Ping ntfy.sh / Telegram / webhook when a command exits
openai-proxy Local OpenAI + Anthropic compatible proxy for Microsoft TRAPI
inject-alias Manage a marker-fenced alias block in your shell rc

Full reference: https://hspk.github.io/usm/commands/.

Examples

usm init                                          # bootstrap a fresh machine
usm tunnel local 8080:db:5432 user@bastion        # forward a port, keep it up
usm port kill 8080                                # evict whatever squats there
usm blobmount mount /mnt/data acct container      # mount blob, refresh the SAS
usm notify -- python train.py                     # ping your phone when it exits
usm share ./build --tunnel user@bastion           # hand someone a file, from anywhere
usm doctor                                        # is this machine healthy?
usm svc add api -- ./serve.sh                     # keep it running, and at boot
usm watch src -- pytest -q                        # re-run tests on every save

CUDA_VISIBLE_DEVICES=$(usm gpu free 2) python train.py   # grab the 2 idlest GPUs

Install any script as a short command on your PATH:

usm install clash cx     # `cx ...` now runs `usm clash ...`
usm uninstall cx

Updating

usm update               # refresh the catalog
usm update --all         # re-download every cached script
usm update tunnel        # refresh a single script

Scripts self-heal: if cached files stop matching the catalog's recorded hash, usm refreshes the manifest before building the environment, so a stale catalog can never pair old requirements with new code.

How it works

The CLI (src/usmo/cli/) is a thin frontend over the usmo.core SDK; the command manifest lives in scripts/_config.json. Adding a command means adding a script and an entry — no Python changes.

  • Shell scripts run under bash; Python scripts run under the current interpreter, or in a persistent per-script venv when they declare requirements.
  • Scripts are fetched from this repository and cached, pinned by content hash.
  • --upgrade forces a fresh download; --debug runs the local file in scripts/ instead, so iterating feels like editing any other repo file.

See Architecture for the full picture, and Development to contribute a script.

Notes

  • Some scripts target Ubuntu; init, clip, and tunnel are cross-platform.
  • blobmount, azsync, and cp expect Azure CLI / azcopy / blobfuse2.

License

MIT © Hangxing Wei

Download files

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

Source Distribution

usmo-0.12.0.tar.gz (483.9 kB view details)

Uploaded Source

Built Distribution

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

usmo-0.12.0-py3-none-any.whl (37.2 kB view details)

Uploaded Python 3

File details

Details for the file usmo-0.12.0.tar.gz.

File metadata

  • Download URL: usmo-0.12.0.tar.gz
  • Upload date:
  • Size: 483.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for usmo-0.12.0.tar.gz
Algorithm Hash digest
SHA256 ab343b415eea110021fea03b26cbe6640506dc36a73d94636e897bac176b8c4f
MD5 8af954d0bac015ce23e9793fbc3cf752
BLAKE2b-256 6b515f8ac46171bb9146fe303926a81634aec9b7454f0fbee9f72db4d4979da0

See more details on using hashes here.

Provenance

The following attestation bundles were made for usmo-0.12.0.tar.gz:

Publisher: release.yml on HSPK/usm

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

File details

Details for the file usmo-0.12.0-py3-none-any.whl.

File metadata

  • Download URL: usmo-0.12.0-py3-none-any.whl
  • Upload date:
  • Size: 37.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for usmo-0.12.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5805c9eed2df3f8260ea1bb421ae2119da693c6dbb4577b85370d11de99d8871
MD5 e71ddd5d6657e64b25a7ab6479793f1b
BLAKE2b-256 4fcd15d395f6a209fd5709e54f451ec4b0113a50c9be0258671ceb24bb7a7942

See more details on using hashes here.

Provenance

The following attestation bundles were made for usmo-0.12.0-py3-none-any.whl:

Publisher: release.yml on HSPK/usm

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

Release history Release notifications | RSS feed

0.12.1

2 files

This release

0.12.0 This release

2 files

0.11.2

2 files

0.11.1

2 files

0.11.0

2 files

0.10.0

2 files

0.9.3

2 files

0.9.2

2 files

0.9.1

2 files

0.9.0

2 files

0.8.4

2 files

0.8.3

2 files

0.8.2

2 files

0.8.1

2 files

0.8.0

2 files

0.7.0

2 files

0.6.3

2 files

0.6.2

2 files

0.6.1

2 files

0.6.0

2 files

0.5.0

2 files

0.4.3

2 files

0.4.2

2 files

0.4.1

2 files

0.4.0

2 files

0.3.0

2 files

0.2.0

2 files

0.1.8

2 files

0.1.5

2 files

0.1.2

2 files

0.1.1

2 files

0.1.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page