sun-cli
Command-line client for the Sun audio generation API. Generate audio from a prompt, poll for completion (or stream episodes as they finish), and download the manifest plus per-episode MP3 + image files — all from one binary.
Install
pip install sun-cli
Or with uv:
uv tool install sun-cli
Verify:
sun --help
sun --version # prints "sun-cli <version>"
Python 3.10+ is required. macOS and Linux are first-class.
Quickstart
# 1. Log in (email + password).
sun login
# 2. Mint a personal API token — secret is printed once.
sun tokens create laptop
# 3. Generate audio and wait for it to finish.
sun audio create \
--prompt "A 30-minute course on the French Revolution" \
--duration-minutes 30 \
--wait
# 4. Download the manifest + per-episode MP3 + image files.
sun audio get <JOB_ID> --out ./french-revolution
ls ./french-revolution
# overview.json
# cover.png
# episodes/001-causes.mp3
# episodes/001-causes.png
# episodes/002-...mp3
# ...
For streaming (download each episode the moment its audio is ready), pair
--partial with a polling loop or register a webhook with --callback-url:
sun audio create --prompt "..." --callback-url https://your.handler/hook --json
# or, polling:
sun audio get <JOB> --partial --out ./out # safe before SUCCESS; skips episodes still generating
Commands
sun --version
sun --help
sun login [--email EMAIL] [--password PASSWORD]
sun logout
sun whoami
sun tokens create NAME [--no-save]
sun tokens list [--json]
sun tokens revoke NAME|ID
sun audio create [--prompt TEXT] [--input PATH] [--duration-minutes N]
[--voice-id ID] [--callback-url URL] [--wait] [--json]
sun audio status JOB_ID [--json]
sun audio get JOB_ID [--partial] [--json] [--out DIR]
sun courses ... still works as a hidden alias for backwards compatibility —
it prints a one-line deprecation warning on stderr and runs the same command.
Prefer sun audio in new scripts.
Authentication
The CLI uses two distinct auth modes:
- Token management (
sun tokens *) — uses the Supabase JWT persisted bysun login. A leaked API token cannot mint replacements. - Everything else (
sun audio *,sun whoami) — uses a personal API token of the formsk_live_....
The Supabase URL and anon key are auto-discovered from the Sun API's public
/v1/public/auth-config endpoint, so end users only need an email and
password.
Credentials are stored at ~/.config/sun/credentials.json with mode 0600.
Configuration
| Variable | Purpose |
|---|---|
SUN_API_BASE_URL |
Override the default API base URL (e.g. for staging or local dev). |
SUN_TOKEN |
Use this API token instead of the credentials file. CI mode. |
SUPABASE_URL, SUPABASE_ANON_KEY |
Optional override for sun login only. The CLI auto-discovers these otherwise. |
Rate limits
Default: 3 successful-or-in-flight generations per rolling 24h per user (configurable per user). Failed generations don't count against the quota.
The server returns 429 with Retry-After and X-RateLimit-* headers when
the limit is hit.
License
See LICENSE in the source repository.
Metadata
Release files for sun-cli 0.2.1
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 |
|---|---|---|---|---|
| sun_cli-0.2.1.tar.gz | 20.3 kB | Without provenance | Details for sun_cli-0.2.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| sun_cli-0.2.1-py3-none-any.whl | Python 3 | none | any | Details for sun_cli-0.2.1-py3-none-any.whl |
Total release size: 41.3 kB
Release files / sun_cli-0.2.1.tar.gz
| Download URL | sun_cli-0.2.1.tar.gz |
|---|---|
| Size | 20.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
781b38aa2743cbaf854b2d7a2fe6a0fb66d30cdcee1447e5192bded7273f929b
|
|
BLAKE2b-256 checksum How to use checksums |
8e723a52534d3ad2a3d699eb0a2dfb380a86fa878cb078b5683352edef3baa2c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.0
|
Release files / sun_cli-0.2.1-py3-none-any.whl
| Download URL | sun_cli-0.2.1-py3-none-any.whl |
|---|---|
| Size | 21.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
170e82e72e3cd8235166c5c40bde7d30c16dd8e84172152236d4861491885834
|
|
BLAKE2b-256 checksum How to use checksums |
f768d922dfb83a5a80206c1e353915a8355d129638f65b57667bde3a23ac0001
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.0
|
Security for sun-cli 0.2.1
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.