Skip to main content

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 by sun login. A leaked API token cannot mint replacements.
  • Everything else (sun courses *, sun whoami) — uses a personal API token of the form sk_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


Download files

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

Source Distribution

sun_cli-0.2.0.tar.gz (18.7 kB view details)

Uploaded Source

Built Distribution

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

sun_cli-0.2.0-py3-none-any.whl (19.3 kB view details)

Uploaded Python 3

File details

Details for the file sun_cli-0.2.0.tar.gz.

File metadata

  • Download URL: sun_cli-0.2.0.tar.gz
  • Upload date:
  • Size: 18.7 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

Hashes for sun_cli-0.2.0.tar.gz
Algorithm Hash digest
SHA256 da80c64d8081e5d57b30d8df3951abe9b5528df86f117d9b9cd3e78cc64dee84
MD5 fd864c250c60f84a57f01fddf72efdd9
BLAKE2b-256 ac54eb9a7c69212703b0317d8f3984facc05d4924aefeccde1cd891699202c12

See more details on using hashes here.

File details

Details for the file sun_cli-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: sun_cli-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 19.3 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

Hashes for sun_cli-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c5fa4a451c171f9c1ae5a5d1dd7bd3a951da03d5c77bc3f925c3e69732b3a2f6
MD5 7a34838d299c80268d059a995785d72d
BLAKE2b-256 5796a9eee0f1480d4411e726df7b6296a7fe6271fed4d6e43abb7af88fedd2da

See more details on using hashes here.

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