sona-cli is Sona's standalone, stateless command-line speech-to-text host backed by sona-core. It transcribes audio files, directories, live microphone input, and standard input streams with local preset ASR models or online cloud providers. It does not open or manage the Sona SQLite application database, project database, history storage, sync state, or Online LLM tasks. Transcripts are written to stdout or to an explicitly supplied output file.
The standalone CLI ships these primary commands:
live(or aliastranscribe-live): real-time streaming speech recognition from mic or stdintranscribe: batch file or directory transcription with local or cloud modelsmodels: list, download, inspect, verify, search, and delete preset ASR modelsexport: convert transcript segment JSON files into SRT, VTT, TXT, MD, etc. (supports aliasexport transcript)config: inspect and manage configuration TOML files (init,check,show,get,set,unset,edit,path)doctor: run host health diagnostics, inspect hardware acceleration (CUDA, Metal, AVX2, NEON), and verify pathsdevices: enumerate available audio input and output devicesproviders: inspect configured online cloud ASR providers and capabilitiesupdate: check and install safe package and binary updates with Minisign verificationcompletion: generate shell auto-completion scripts (bash, zsh, fish, powershell, elvish)serve: local REST API server and WebSocket streaming (/v1/streaming)diagnostics: build a host diagnostics snapshot contract
Run it
- Packaged builds: use the
sona-clibinary bundled with the same-platform installer output. - Source builds:
cargo run -p sona-cli -- <command> ...
Examples:
sona-cli doctor
sona-cli config init
sona-cli models list
sona-cli models download whisper-turbo
sona-cli transcribe ./sample.wav -m whisper-turbo
sona-cli transcribe ./sample.wav --online-provider groq-whisper
sona-cli live -m sensevoice
sona-cli live --online-provider volcengine-doubao
sona-cli export ./segments.json ./transcript.vtt
sona-cli serve --host 127.0.0.1 --port 14200Stateless boundary
The CLI deliberately excludes SQLite, History, Tag, application backup/recovery, Sync, and Online LLM tasks. It will not create or silently mutate desktop application data directories. Output is emitted to stdout or written to explicitly specified target files. Use export (or export transcript) and stdout/file output to compose the CLI with other tools.
Configuration precedence
Configuration options are resolved in the following priority order:
- Explicit CLI argument:
-c / --config <PATH> - Global environment variable:
SONA_CONFIG - Local configuration file in current working directory:
./sona-cli.toml - User standard configuration file:
sona-cli.toml(Linux:~/.config/sona/sona-cli.toml, macOS:~/Library/Application Support/sona/sona-cli.toml, Windows:%APPDATA%\sona\sona-cli.tomlor%USERPROFILE%\.config\sona\sona-cli.toml) - Built-in defaults: runs with safe defaults if no config file is found
Commands
config
Inspect and manage Sona CLI configuration files:
sona-cli config init: generate a commented TOML starter file (use-F/--forceto overwrite)sona-cli config check: validate configuration syntax and sectionssona-cli config show: display active configuration merged with defaultssona-cli config get <KEY>: retrieve a specific configuration propertysona-cli config set <KEY> <VALUE> [--global]: persist a property value locally or globallysona-cli config unset <KEY> [--global]: remove a property from configurationsona-cli config edit: open configuration file in system default editorsona-cli config path: print resolved configuration path
sona-cli config init
sona-cli config check
sona-cli config set transcribe.model_id whisper-turbo
sona-cli config get transcribe.model_idmodels
Manage preset local ASR models in the selected models directory:
sona-cli models list: list available preset models (--mode live|batch,--installed,--json)sona-cli models download <MODEL>(aliasinstall): download model files with checksum verificationsona-cli models delete <MODEL>(aliasrm): delete downloaded model files (-F/--forceto skip confirmation)sona-cli models info <MODEL>(aliasshow): inspect detailed model specification and companionssona-cli models search <QUERY>: search models by keyword or languagesona-cli models verify <MODEL>: verify file integrity and checksums of installed model filessona-cli models path: print absolute path to active models directory
sona-cli models list --mode batch
sona-cli models search chinese
sona-cli models download whisper-turbo
sona-cli models verify whisper-turbo
sona-cli models delete whisper-turbo --forcetranscribe
Transcribe audio or video files using local preset ASR models or cloud online providers. Without --online-provider, the command uses an installed local Sherpa preset:
sona-cli transcribe ./sample.wav -m whisper-turbo
sona-cli transcribe ./sample.wav -m whisper-turbo -o ./transcript.srt
sona-cli transcribe ./sample.wav --model-id sherpa-onnx-whisper-turboWith --online-provider, the command uploads audio to the selected cloud provider and outputs the result:
export GROQ_API_KEY="..."
sona-cli transcribe ./sample.wav --online-provider groq-whisper --format txt
export SONA_VOLCENGINE_ASR_API_KEY="..."
sona-cli transcribe ./sample.wav --online-provider volcengine-doubao --output ./out.srtSupported batch providers are volcengine-doubao, groq-whisper, and mistral-voxtral:
| Provider | Default environment variable |
|---|---|
volcengine-doubao | SONA_VOLCENGINE_ASR_API_KEY |
groq-whisper | GROQ_API_KEY |
mistral-voxtral | MISTRAL_API_KEY |
Use --api-key-env NAME to select a custom environment variable. --online-config FILE accepts a JSON object for non-secret endpoint/model overrides; it must not contain apiKey or api_key.
Local-only flags such as --model-id, --models-dir, VAD/punctuation options, thread count, GPU mode, and --save-wav are rejected when an online provider is selected. --force is required to replace an existing output file.
transcribe-live
sona-cli live (with compatibility alias sona-cli transcribe-live) performs real-time speech recognition from microphone capture or standard input (--input stdin).
sona-cli live -m sensevoice
sona-cli live --device "Studio Mic" --duration 60 --output ./live.srt
ffmpeg -i sample.wav -f s16le -ac 1 -ar 16000 - | \
sona-cli live --input stdin -m sensevoice --output-format ndjsonOnline streaming currently supports volcengine-doubao:
export SONA_VOLCENGINE_ASR_API_KEY="..."
ffmpeg -i sample.wav -f s16le -ac 1 -ar 16000 - | \
sona-cli live --input stdin \
--online-provider volcengine-doubao --output-format ndjsonMicrophone input uses the default CPAL input device unless --device supplies an exact device name (run sona-cli devices to inspect). --output-format can be text or ndjson; --output writes a final json, txt, srt, vtt, or md snapshot. --format requires --output. Ctrl+C, stdin EOF, and --duration flush and stop the session cleanly before exiting.
The same online credential (--api-key-env) and non-secret config (--online-config) rules as transcribe apply.
export transcript
Export transcript segments into formatted subtitle or text files. The modern command is sona-cli export <INPUT> [OUTPUT], with compatibility aliases sona-cli export transcript and sona-cli convert:
sona-cli export ./segments.json ./transcript.vtt
sona-cli export transcript --input ./segments.json --output ./transcript.vtt
sona-cli export ./segments.json ./transcript.srt --mode bilingualThe output format is inferred from the file extension or specified via --format <srt|vtt|txt|json|tsv|csv|md>. Supported modes are original, translation, and bilingual.
doctor
Run automated diagnostics checks on the local environment, inspecting host platform, CPU architecture, SIMD extensions (AVX2, NEON), GPU/CUDA acceleration, audio input/output devices, installed model integrity, and directory permissions:
sona-cli doctor
sona-cli doctor --strict
sona-cli doctor --jsondevices
List available audio input and output devices detected on the host system:
sona-cli devices
sona-cli devices --jsonproviders
Inspect configured online cloud ASR providers and their connection/capability statuses:
sona-cli providers
sona-cli providers --jsonupdate
Check for and install signed updates for the CLI and desktop binaries with Minisign cryptographic signature verification:
sona-cli update check
sona-cli update applycompletion
Generate shell auto-completion scripts for your preferred shell:
sona-cli completion bash > /etc/bash_completion.d/sona-cli
sona-cli completion zsh > ~/.zfunc/_sona-cli
sona-cli completion fish > ~/.config/fish/completions/sona-cli.fish
sona-cli completion powershell | Out-File -Append -Encoding utf8 $PROFILEdiagnostics
Build a structured host diagnostics snapshot contract JSON object for support or issue reporting without accessing application databases:
sona-cli diagnosticsserve
Run the shared local HTTP API server. Supports local REST transcription and WebSocket streaming (/v1/streaming):
sona-cli serve
sona-cli serve --config ./sona-cli.toml
sona-cli serve --host 127.0.0.1 --port 14200 --api-key local-secretFor the complete REST and WebSocket endpoints specification, see HTTP API Guide.
Exit codes and errors
0: Success1: General failure (e.g.doctor --stricthealth check failure, serialization error)2: Validation or CLI usage error (invalid argument, missing provider, nonexistent input file)3: Model error (missing preset, corrupted download, uninstalled companion)4: Network or online provider error (authentication failure, API timeout)5: Filesystem error (output file already exists without--force, directory write failure)130: Cancelled (interrupted by Ctrl+C signal)