CLI for the Sun audio course generation API.
Project description
sun-cli
Command-line client for the Sun audio course generation API. Generate audio courses from a prompt, poll for completion, and download per-lecture MP3 files — all from one binary.
Install
pip install sun-cli
Or with uv:
uv tool install sun-cli
Verify:
sun --help
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 a course and wait for it to finish.
sun courses create \
--prompt "A 30-minute course on the French Revolution" \
--duration-minutes 30 \
--wait
# 4. Download the manifest + per-lecture MP3 files.
sun courses get <JOB_ID> --out ./french-revolution
ls ./french-revolution
# course.json
# lectures/001-causes.mp3
# lectures/002-...mp3
Commands
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 courses create [--prompt TEXT] [--input PATH] [--duration-minutes N]
[--voice-id ID] [--wait] [--json]
sun courses status JOB_ID [--json]
sun courses get JOB_ID [--json] [--out DIR]
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 courses *,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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file sun_cli-0.1.0.tar.gz.
File metadata
- Download URL: sun_cli-0.1.0.tar.gz
- Upload date:
- Size: 14.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.22 {"installer":{"name":"uv","version":"0.9.22","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f5d6da8a9ab2896a10d27547d1dfdd4062e7c37c7d79b5215334069e2f2a2804
|
|
| MD5 |
e5940c9eaf3d308c46d594c8f686bd45
|
|
| BLAKE2b-256 |
b67936de5e388e25b7611d32d4b7a1a4db5a87dbea13fd0eccb886f935c807b4
|
File details
Details for the file sun_cli-0.1.0-py3-none-any.whl.
File metadata
- Download URL: sun_cli-0.1.0-py3-none-any.whl
- Upload date:
- Size: 14.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.22 {"installer":{"name":"uv","version":"0.9.22","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
95b743456399a4fd0af749e0942f91d6779e2f81ff87a59f9b5c4e7610c830ac
|
|
| MD5 |
648b3757327d5af8beaf6fe1f66aa914
|
|
| BLAKE2b-256 |
9ae4923a57dfd4a41611bb69b14419df28a03d89ff3ef49c295aea5caf11399d
|