duhub-cli
Command-line client for DUhub: transcribe audio, synthesize speech, translate text, and diarize meetings — all billed to your API key.
duhub stt rec.wav -o transcript.json
duhub tts "Muraho neza nshuti yanjye." -o out.wav
duhub mt "Muraho" --src rw --tgt en
duhub diarize meeting.wav --format srt -o speakers.srt
Installation
Requires Python 3.11+.
pipx install duhub-cli
duhub --version
Alternatives:
pipx install git+https://github.com/Digital-Umuganda/duhub-cli.git
pip install git+https://github.com/Digital-Umuganda/duhub-cli.git # plain pip
python -m du_cli.main --help # without installing
The installed command is
duhubonly, so it does not shadow the Unixdu(disk usage). You can also invokepython -m du_cli.mainwithout installing.
Quickstart
- Create an account on the Dashboard and copy an API key from API Keys (shown once — treat it like a password).
- Save it:
duhub configure --api-key du_live_xxxxxxxxxxxxxxxx
- Check connectivity:
duhub health duhub health --detailed
- Transcribe something:
duhub stt rec.wav
Configuration
duhub configure stores settings in ~/.config/du/config.toml:
| Source | Priority | Example |
|---|---|---|
| Environment | Highest (always wins) | DU_API_KEY, DU_BASE_URL |
| Config file | Middle | duhub configure --api-key … --base-url … |
| Built-in default | Lowest | base https://du-api.dev.umuganda.digital |
duhub configure # show current state
duhub configure --api-key du_live_xxx # set key
duhub configure --base-url http://localhost:8080 # point at local gateway
duhub configure --reset # delete the file
export DU_API_KEY=du_live_xxx DU_BASE_URL=https://du-api.dev.umuganda.digital
Prefer
DU_API_KEYenv var over--api-key— flags land in shell history.
Commands
Every command exits 0 on success, 1 on failure (2 on CLI usage
errors) and prints a summary line (units, cache, request-id). The
API commands (health, stt, tts, mt, diarize) accept --json
for a single machine-readable object on stdout
({"data", "units", "cache", "request_id"}). -o writes the raw
payload to a file instead of stdout.
Every billed command (stt, tts, mt, diarize) accepts
--idempotency-key, so a retry after a timeout or connection drop is
deduplicated by the gateway instead of being billed twice.
duhub health
Liveness (/health) or full readiness (--detailed, checks STT/TTS/MT
backends — the one to try first when calls fail).
duhub stt — speech to text
Upload audio (WAV/FLAC/OGG, ≤ 30 MB), get {"text": "…"}.
Billed per audio second.
duhub stt rec.wav -o transcript.json
duhub stt rec.wav --idempotency-key run-42 -o transcript.json
duhub tts — text to speech
Synthesize Kinyarwanda speech to a 24 kHz mono WAV (-o is required —
audio never goes to stdout). Billed per word. --text-file
overrides TEXT when both are given.
duhub tts "Muraho neza nshuti yanjye." -o out.wav
duhub tts "Muraho neza nshuti yanjye." -o out.wav --idempotency-key run-42
duhub mt — translation
Translate between Kinyarwanda (rw) and English (en).
Billed per input word.
duhub mt "Muraho" --src rw --tgt en
duhub diarize — who spoke when
Upload audio, get speaker-labelled segments. --format renders the same
result as json (default), txt, or srt. Billed per audio second.
duhub diarize meeting.wav --format srt -o speakers.srt
A
404here usually means the configured gateway predates the/diarizeroute. Checkduhub health --detailedand your--base-url.
Scripting
--json prints exactly one JSON object — pipe-safe:
TEXT=$(duhub stt rec.wav --json | jq -r .data.text)
for f in clips/*.wav; do
duhub stt "$f" -o "${f%.wav}.json" || echo "FAILED: $f" >&2
done
Errors
API, input-file, and output-file failures are reported as error +
hint — no tracebacks:
| You see | Cause | Fix |
|---|---|---|
invalid key (401) |
Missing/unknown/revoked key | Copy a fresh key from dashboard API Keys |
insufficient balance (402) |
Wallet empty | Top-up via dashboard Wallet |
organization pending review (403) |
Org not approved yet | Contact your org admin |
file exceeds 30 MB |
Upload guard | Compress or split the audio |
server busy (saturated) (503) |
GPU at concurrency cap | Wait Retry-After seconds, retry |
backend unreachable (502) |
Model container down | duhub health --detailed to see which |
cannot reach server |
Wrong --base-url, offline, timeout |
Check URL and connectivity |
Development
uv sync # or: python -m venv .venv && .venv/bin/pip install -e .
uv run pytest
uv run duhub --help
Metadata
Release files for duhub-cli 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| duhub_cli-0.1.0.tar.gz | 15.2 kB | Without provenance | Details for duhub_cli-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| duhub_cli-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for duhub_cli-0.1.0-py3-none-any.whl |
Total release size: 26.6 kB
Release files / duhub_cli-0.1.0.tar.gz
| Download URL | duhub_cli-0.1.0.tar.gz |
|---|---|
| Size | 15.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
be3ea325fe01243db662517aa89d807da9e86a38674a20a1d27e8a51c67b1d2e
|
|
BLAKE2b-256 checksum How to use checksums |
e768bb755002b64ffbcef1d32a54a1fa7fcb91e9df358b772e2611c3cbec47d0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.13.7 {"installer":{"name":"uv","version":"0.13.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Omarchy","version":"4.5.0","id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / duhub_cli-0.1.0-py3-none-any.whl
| Download URL | duhub_cli-0.1.0-py3-none-any.whl |
|---|---|
| Size | 11.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e7d5ed22a603f7165aa1c953ff8e33d60926f806aa66e3c5fc939ba48e24ac3f
|
|
BLAKE2b-256 checksum How to use checksums |
7e2ce9f3973d8d41c86d9544d72446d5d33acb90bb40de5a7d35e59b5c396fd0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.13.7 {"installer":{"name":"uv","version":"0.13.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Omarchy","version":"4.5.0","id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Security for duhub-cli 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.