Reference & Help

CLI Guide

Run Sona's offline batch transcription from the terminal, manage preset models, generate shell completions, and start the headless API server.

Ask AI

This deployment has not enabled protected guide Q&A.

sona exposes offline transcription commands through the main desktop executable. Packaged installs do not add sona to your shell PATH, so run the installed app binary with CLI subcommands. Source builds can run the same commands with Cargo.

The CLI is intentionally narrow: single-file and directory offline transcription, preset model listing/download/deletion, and headless HTTP API server startup. It does not include live recording, LLM polish, or LLM translation.

Run It

  • Windows: run Sona.exe transcribe ... from the installation directory
  • macOS: run /Applications/Sona.app/Contents/MacOS/Sona transcribe ...
  • Linux packages: run the packaged Sona binary with CLI subcommands from the install location
  • AppImage: run the mounted AppImage executable with CLI subcommands
  • Source: cargo run --manifest-path src-tauri/Cargo.toml -- transcribe ./sample.mp4 --config ./sona-cli.toml

Common Commands

Transcribe a file

sona transcribe ./sample.mp4 \
  --config ./sona-cli.toml \
  --output ./sample.srt

Without --output, transcription writes JSON to stdout. With --output, the format is inferred from the file extension unless --format is provided. Existing output files are protected by default; pass --force only when you intend to overwrite them.

Transcribe a directory

sona transcribe \
  --input-dir ./media \
  --output-dir ./transcripts \
  --format srt \
  --recursive \
  --jobs 1 \
  --config ./sona-cli.toml

Directory mode writes one transcript per supported media file into --output-dir. By default it scans only direct children; add --recursive to include subdirectories. Transcript content goes to files, while a JSON success/failure summary is written to stdout.

You can also pass multiple input files or glob patterns. These use the same batch output planning as directory mode and require --output-dir:

sona transcribe ./media/*.wav ./media/interview.mp4 --output-dir ./transcripts --format srt

List, download, or delete models

sona models list --mode offline --type whisper
sona models list --language zh --installed
sona models list --json
sona models download sherpa-onnx-whisper-turbo
sona models delete sherpa-onnx-whisper-turbo

models list prints a readable table by default. Use --json when scripts need the full machine-readable shape, including install_path. models download automatically downloads required companion models, such as silero-vad or the default punctuation model, when the selected preset needs them. models delete removes only the specified model. It does not delete companion models automatically.

Start the API server

sona serve --host 127.0.0.1 --port 14200 --api-key your_secure_key

For HTTP API endpoints and request examples, continue to the HTTP API Guide.

Config File

Pass a TOML file with --config. Command-line flags override config file values.

Minimal transcribe example:

models_dir = "C:/Users/you/AppData/Local/com.asoda.sona/models"
model_id = "sherpa-onnx-whisper-turbo"
vad_model_id = "silero-vad"
language = "auto"
threads = 4
enable_itn = false
vad_buffer_size = 5.0
gpu_acceleration = "auto"
hotwords = "Sona,offline ASR"
format = "srt"
quiet = false
jobs = 1

transcribe config keys

Parameter / config keyRequiredRangeDefaultNotes
models_dirOptionalFilesystem pathDesktop app models directory, when inferablePass explicitly if the CLI cannot find desktop models.
model_idRequired unless --model-id is passedOffline preset model idNoneUse sona models list --mode offline to find ids.
vad_model_idOptionalPreset model idsilero-vad when requiredUsed when the selected model requires VAD; overrides the default.
punctuation_model_idOptionalPreset model idsherpa-onnx-punct-ct-transformer-zh-en-vocab272727-2024-04-12-int8 when requiredUsed when the selected model requires punctuation; overrides the default.
languageOptionalauto or a model language code, such as zh, en, jaautoOverrides automatic language detection.
threadsOptionalInteger greater than 04Recognizer thread count.
enable_itnOptionaltrue or falsefalseEnables inverse text normalization.
hotwordsOptionalComma-separated wordsNoneCustom ASR hotwords; currently supported by Transducer and Qwen3 models.
quietOptionaltrue or falsefalseHides transcription progress when set. CLI --quiet also enables this.
jobsOptionalInteger greater than 01Maximum concurrent file jobs for directory, multiple-input, or glob mode. CLI --jobs overrides this.
vad_buffer_sizeOptionalNumber greater than 05.0VAD buffer size in seconds.
gpu_accelerationOptionalauto, cpu, cuda, coreml, directmlautoUse cpu to disable GPU acceleration.
formatOptionaljson, txt, srt, vtt, mdjson on stdout or in directory mode, otherwise inferred from --outputOverrides output extension inference.

serve config keys

Parameter / config keyRequiredRangeDefaultNotes
hostOptionalBind address0.0.0.0Use 127.0.0.1 for local-only access.
portOptionalTCP port 0 to 6553514200API server port.
api_keyOptionalStringEmptyEmpty means requests are not protected by Bearer auth.
models_dirOptionalFilesystem pathDesktop app models directory, when inferableUsed to resolve installed models.
ip_whitelistOptionalComma-separated ruleslocalhostSupports localhost, exact IPs, CIDR, *, and IPv4 wildcards like 192.168.*.
max_streamingOptionalNon-negative integer2Maximum concurrent streaming WebSocket connections.
max_concurrentOptionalNon-negative integer2Maximum concurrent batch jobs.
max_queue_sizeOptionalNon-negative integer1000 means the queue is effectively unlimited.
max_upload_size_mbOptionalNon-negative integer500 disables the upload size limit.
job_ttl_minutesOptionalNon-negative integer600 disables completed/failed job cleanup.
gpu_accelerationOptionalauto, cpu, cuda, coreml, directmlautoServer-level default for local batch and streaming jobs.
vad_model_idOptionalPreset model idsilero-vadDefault companion model for API server jobs.
punctuation_model_idOptionalPreset model idsherpa-onnx-punct-ct-transformer-zh-en-vocab272727-2024-04-12-int8Default punctuation companion for API server jobs.

Parameters

Global

sona
  -V, --version
  -v, --verbose
  -h, --help
  help

Use -V or --version to print the Sona version. Use -v or --verbose before a subcommand to enable detailed diagnostic logs. Use -h, --help, or help to print command help:

sona --version
sona -V
sona -v models list
sona --verbose transcribe ./sample.mp4 --config ./sona-cli.toml
sona transcribe --help

Verbose diagnostics are written to stderr. Command output, including table or JSON output from models list and transcribe without --output, remains on stdout so it can still be piped to other tools.

Advanced wrappers and tests can set SONA_FORCE_CLI=1 to force CLI mode even when the executable is launched without a recognized CLI subcommand.

Generate shell completion scripts with sona completions <shell>. Supported shells are bash, zsh, fish, powershell, and elvish; the script is printed to stdout.

transcribe

Parameter / config keyRequiredRangeDefaultNotes
<input>...Required unless --input-dir is passedLocal audio/video file paths or glob patternsNoneOne input keeps single-file mode. Multiple inputs or glob patterns use batch mode and require --output-dir.
--input-dir <dir>Required for directory modeDirectory pathNoneTranscribes supported media files in the directory.
--config <path>OptionalTOML file pathNoneLoads defaults from config.
--output <path>OptionalFilesystem pathstdoutOutput file path for single-file mode only. Errors if the file exists unless --force is passed.
--output-dir <dir>Required with --input-dir, multiple inputs, or glob patternsDirectory pathNoneWrites one transcript per input file. Existing planned outputs error unless --force is passed.
--recursiveOptionalFlagOffScans subdirectories and preserves relative output paths.
--jobs <n>OptionalInteger greater than 0jobs config or 1Maximum concurrent file jobs in batch mode.
--format <format>Optionaljson, txt, srt, vtt, mdjson on stdout or in directory mode, otherwise inferred from --outputOverrides config and output extension inference.
--language <code>Optionalauto or a model language codeautoOverrides config.
--model-id <id>Required unless model_id is configuredOffline preset model idNoneMain transcription model.
--models-dir <path>OptionalFilesystem pathDesktop app models directory, when inferableOverrides config.
--vad-model-id <id>OptionalPreset model idsilero-vad when requiredOverrides the default VAD companion.
--punctuation-model-id <id>OptionalPreset model idsherpa-onnx-punct-ct-transformer-zh-en-vocab272727-2024-04-12-int8 when requiredOverrides the default punctuation companion.
--threads <n>OptionalInteger greater than 04Overrides config.
--enable-itnOptionalFlagfalseConflicts with --disable-itn.
--disable-itnOptionalFlagfalseOverrides enable_itn = true; conflicts with --enable-itn.
--hotwords <words>OptionalComma-separated wordsNoneOverrides hotwords; currently supported by Transducer and Qwen3 models.
--gpu-acceleration <provider>Optionalauto, cpu, cuda, coreml, directmlautoOverrides config.
--vad-buffer <seconds>OptionalNumber greater than 05.0CLI name for vad_buffer_size.
--save-wav <path>OptionalFilesystem pathNoneCLI-only; saves the intermediate resampled WAV. Not supported with --input-dir.
--quietOptionalFlagOffHides transcription progress and overrides quiet = false.
--forceOptionalFlagOffAllows overwriting existing output files. Duplicate planned batch outputs still fail.

models list

Parameter / config keyRequiredRangeDefaultNotes
--models-dir <path>OptionalFilesystem pathDesktop app models directory, when inferableUsed to detect installed presets.
--mode <mode>Optionalstreaming, offlineAll modesFilters by supported mode.
--type <type>OptionalPreset model type, such as whisper, vad, punctuationAll typesFilters by model type.
--language <code>OptionalLanguage token, such as zh, en, ja, yueAll languagesFilters by supported language token.
--installedOptionalFlagOffShows only models present in models_dir.
--jsonOptionalFlagOffPrints machine-readable JSON instead of the default table.
OutputAlwaysTable or JSONTablePrinted to stdout.

models download

Parameter / config keyRequiredRangeDefaultNotes
<model_id>RequiredKnown preset model idNoneMain model to download.
--models-dir <path>OptionalFilesystem pathDesktop app models directory, when inferableTarget models directory.
--quietOptionalFlagOffHides per-download progress.
Companion downloadsAutomaticRequired VAD and punctuation presetsAutomaticDownloading a main model also downloads required companions.

models delete

Parameter / config keyRequiredRangeDefaultNotes
<model_id>RequiredKnown preset model idNoneModel to delete.
--models-dir <path>OptionalFilesystem pathDesktop app models directory, when inferableTarget models directory.
--yesOptionalFlagOffSkips the interactive confirmation prompt.
Missing install pathNoKnown but not installed presetSuccessful no-opPrints a notice to stderr and exits with status 0.
Companion deletionNoRequired VAD and punctuation presetsNot deletedDelete companion models explicitly if you no longer need them.

serve

Parameter / config keyRequiredRangeDefaultNotes
--config <path>OptionalTOML file pathNoneLoads defaults from config.
--host <ip>OptionalBind address0.0.0.0Overrides config.
--port <port>OptionalTCP port 0 to 6553514200Overrides config.
--api-key <key>OptionalStringEmptyEmpty means no Bearer auth.
--models-dir <path>OptionalFilesystem pathDesktop app models directory, when inferableOverrides config.
--ip-whitelist <rules>OptionalComma-separated ruleslocalhostSupports localhost, exact IPs, CIDR, *, and IPv4 wildcards like 192.168.*.
--max-streaming <n>OptionalNon-negative integer2Maximum concurrent streaming connections.
--max-concurrent <n>OptionalNon-negative integer2Maximum concurrent batch jobs.
--max-queue-size <n>OptionalNon-negative integer1000 means the queue is effectively unlimited.
--max-upload-size-mb <n>OptionalNon-negative integer500 disables the upload size limit.
--job-ttl-minutes <n>OptionalNon-negative integer600 disables completed/failed job cleanup.
--gpu-acceleration <provider>Optionalauto, cpu, cuda, coreml, directmlautoHTTP API requests do not accept a per-request GPU override.
--vad-model-id <id>OptionalPreset model idsilero-vadDefault VAD companion for API server jobs.
--punctuation-model-id <id>OptionalPreset model idsherpa-onnx-punct-ct-transformer-zh-en-vocab272727-2024-04-12-int8Default punctuation companion for API server jobs.

Run sona <command> --help for the full clap-generated help text.

Previous

Vocabulary & Advanced

Next

HTTP API