decibri-cli is a cross-platform command-line tool for audio capture, playback, and device enumeration. Single statically-linked binary, no runtime dependencies to install on Windows and macOS, built on the same Rust audio backend as the decibri Python and Node.js packages (the browser package shares the same API through a JavaScript implementation). This page covers installation and first commands, then the full command-line reference.
decibri-cli is a single binary. Pick the method that suits your platform.
brew tap decibri/decibri
brew install decibri-cli
brew tap decibri/decibri
brew install decibri-cli
# Only if Scoop is not already installed
irm get.scoop.sh | iex
scoop bucket add decibri https://github.com/decibri/scoop-decibri
scoop install decibri-cli
Homebrew covers macOS on Intel and Apple Silicon, and Linux on x86_64 and arm64. The formula downloads the pre-built release archive and installs the decibri binary, so nothing is compiled.
Scoop is Windows, 64-bit only. The first command installs Scoop itself, once, in PowerShell, and needs no administrator rights.
libasound.so.2, which Homebrew does not provide. Install it with your distribution's package manager: sudo apt install libasound2 on Debian/Ubuntu, sudo dnf install alsa-lib on Fedora, or sudo pacman -S alsa-lib on Arch. This is the runtime library, which is a different package from the libasound2-dev development headers needed to build from source under Cargo.
Downloads the platform-specific binary from GitHub Releases, verifies its SHA256, and adds it to your PATH. No Node.js runtime is required after installation, because npm is used only as a delivery channel.
Builds from source. Requires Rust stable. On Linux, you'll also need the ALSA development headers: sudo apt install libasound2-dev on Debian/Ubuntu, or sudo dnf install alsa-lib-devel on Fedora.
Direct download. Pre-built archives for every supported platform are available on the releases page, along with SHA256SUMS and SLSA provenance attestations for supply-chain verification.
decibri version
Prints the CLI version, the decibri library version it was built against, the audio backend for your platform, the Rust target triple, and the Rust compiler version:
decibri-cli <version>
decibri <version>
Audio backend: WASAPI
Platform: x86_64-pc-windows-msvc
Rust: <rust-version>
For machine-readable output, add --json:
decibri version --json
{
"decibri_cli": "<version>",
"decibri": "<version>",
"audio_backend": "WASAPI",
"target": "x86_64-pc-windows-msvc",
"rust_version": "<rust-version>"
}
version --json schema is stable and will only change across a major version bump. JSON schemas for other commands are not yet stable.
decibri devices
Prints a human-readable table of all input and output devices on the system. Use --input or --output to filter, and --json for machine-readable output.
decibri devices --input
decibri devices --output
decibri devices --input --json
decibri capture -o recording.wav -d 10
Records 10 seconds of audio from your default input device to recording.wav. The default format is 16-bit PCM at 16 kHz mono, which is the format expected by most speech recognition engines. Press Ctrl+C at any time to stop early; decibri-cli writes a valid (truncated) WAV file, never a corrupted one.
decibri capture always writes 16-bit PCM WAV. Change the sample rate with -r and channel count with -c, but the encoding is fixed.
decibri play recording.wav
Plays the file through your default output device. Supports 16-bit PCM integer and 32-bit float WAV inputs. Other WAV formats (24-bit, 8-bit, non-PCM codecs) produce a clear error rather than garbled output. Ctrl+C stops playback cleanly with exit code 0.
decibri devices --input
decibri capture -o out.wav -d 10 --device "Blue Yeti"
--device accepts either a case-insensitive name substring or a numeric device index from the devices listing. Name substrings are usually the more stable choice across runs.
decibri capture -o song.wav -d 60 -r 44100 -c 2
CD-quality 44.1 kHz stereo, 60 seconds. The encoding remains 16-bit PCM WAV. 24-bit and float output formats are not supported.
decibri capture -o test.wav -d 5 && decibri play test.wav
Useful for verifying that input and output devices both work end-to-end. A simple audio loopback test for CI or new machine setup.
decibri capture -o /tmp/ci-test.wav -d 2 --quiet --json
--quiet suppresses progress bars and status messages. Combined with --json, this is the pattern for shell scripts and CI pipelines. Exit code 0 on success, with a JSON summary on stdout describing the output file.
See Exit codes and Platform support in the API reference below.
decibri-cli exposes four subcommands: version, devices, capture, and play. All commands support --json for machine-readable output and --quiet to suppress progress indicators. Exit codes are stable and documented below.
| Flag | Type | Description |
|---|---|---|
--json |
boolean |
Emit machine-readable JSON instead of human output. Only the version --json schema is stable; other command schemas are not yet stable. |
-q, --quiet |
boolean |
Suppress progress bars and status messages. Errors still print to stderr. |
-V, --version |
boolean |
Print decibri-cli <version> and exit. Equivalent to decibri version for basic info. |
-h, --help |
boolean |
Print help for the current command and exit. |
decibri versionDisplays version information and build metadata for decibri-cli and its underlying library.
decibri version [--json]
decibri-cli <version>
decibri <version>
Audio backend: WASAPI
Platform: x86_64-pc-windows-msvc
Rust: <rust-version>
{
"decibri_cli": "<version>",
"decibri": "<version>",
"audio_backend": "WASAPI",
"target": "x86_64-pc-windows-msvc",
"rust_version": "<rust-version>"
}
| Key | Type | Description |
|---|---|---|
decibri_cli |
string |
Semver version of the CLI binary |
decibri |
string |
Semver version of the decibri library the CLI was built against |
audio_backend |
string |
WASAPI (Windows), CoreAudio (macOS), or ALSA (Linux) |
target |
string |
Rust target triple the binary was compiled for |
rust_version |
string |
Rust compiler version used at build time |
version --json schema is stable and will not change without a major version bump.
decibri devicesLists audio input and output devices available on the system.
decibri devices [--input] [--output] [--json]
| Flag | Type | Description |
|---|---|---|
--input |
boolean |
List only input devices |
--output |
boolean |
List only output devices |
--json |
boolean |
Emit JSON instead of the human-readable table |
Default behavior (no --input/--output flag) lists both inputs and outputs.
INPUT DEVICES
# Name Channels Sample rate Default
0 MacBook Pro Microphone 1 48000 yes
1 Blue Yeti 2 48000
OUTPUT DEVICES
# Name Channels Sample rate Default
0 MacBook Pro Speakers 2 48000 yes
1 External Headphones 2 48000
{
"input_devices": [
{ "index": 0, "name": "MacBook Pro Microphone", "kind": "input", "default": true, "channels": 1, "sample_rate": 48000 },
{ "index": 1, "name": "Blue Yeti", "kind": "input", "default": false, "channels": 2, "sample_rate": 48000 }
],
"output_devices": [
{ "index": 0, "name": "MacBook Pro Speakers", "kind": "output", "default": true, "channels": 2, "sample_rate": 48000 }
]
}
devices --json field names and shape are not yet stable. Only version --json is stable.
decibri captureRecords audio from an input device to a 16-bit PCM WAV file.
decibri capture -o <FILE> [-d <DURATION>] [-r <RATE>] [-c <CHANNELS>] [--device <NAME_OR_INDEX>] [--json] [--quiet]
| Flag | Alias | Type | Default | Description |
|---|---|---|---|---|
--output |
-o |
path |
required | Output WAV file path. Overwrites without prompting. |
--duration |
-d |
duration |
(until Ctrl+C) | Recording length. Accepts bare seconds (10, 5.5) or suffixed strings (10s, 1m30s). |
--rate |
-r |
integer |
16000 |
Sample rate in Hz. |
--channels |
-c |
integer |
1 |
Channel count (mono=1, stereo=2). |
--device |
string | int |
system default | Input device by case-insensitive name substring or numeric index. | |
--json |
boolean |
false |
Emit JSON summary on completion. | |
--quiet |
-q |
boolean |
false |
Suppress progress bar and status messages. |
--duration is omitted, capture runs until Ctrl+C.# ASR-ready recording (16 kHz mono, 30 seconds)
decibri capture -o speech.wav -d 30
# Stereo music recording at CD quality
decibri capture -o song.wav -d 60 -r 44100 -c 2
# Record from a specific microphone by name substring
decibri capture -o out.wav -d 10 --device "Yeti"
# Record until Ctrl+C, JSON summary on exit
decibri capture -o clip.wav --json
{
"file": "speech.wav",
"duration_seconds": 30.0,
"sample_rate": 16000,
"channels": 1,
"samples": 480000,
"bytes": 960000,
"device": "MacBook Pro Microphone",
"dropped_chunks": 0
}
If the recording was stopped by Ctrl+C, the truncated WAV is finalised normally and the JSON summary is emitted with duration_seconds reflecting the actual recorded length. If a watchdog trip or IO error occurs mid-capture, the partial WAV is preserved on disk but the CLI exits with code 4 and emits no JSON summary, so the JSON output is success-only.
decibri playPlays a WAV file through an output device.
decibri play <FILE> [--device <NAME_OR_INDEX>] [--json] [--quiet]
| Flag | Type | Default | Description |
|---|---|---|---|
<FILE> |
path |
required | Path to a WAV file. |
--device |
string | int |
system default | Output device by case-insensitive name substring or numeric index. |
--json |
boolean |
false |
Emit JSON summary on completion. |
--quiet |
boolean |
false |
Suppress progress bar. |
| Format | Supported |
|---|---|
| 16-bit signed integer PCM WAV | Yes |
| 32-bit float PCM WAV | Yes |
| 24-bit PCM WAV | No (clear error on load) |
| 8-bit PCM WAV | No |
| Non-PCM (μ-law, A-law, ADPCM, compressed codecs) | No |
Convert unsupported files to 16-bit PCM WAV before playback.
--json mode, an interrupted playback reports "interrupted": true.decibri play recording.wav
decibri play recording.wav --device "External Headphones"
| Code | Meaning |
|---|---|
0 |
Success. |
1 |
Generic error. Audio subsystem failure, unsupported WAV format, corrupt input file, or disk stall. |
2 |
Invalid arguments, caught by the argument parser (unknown flag, missing required value, bad duration format). |
3 |
Device not found. The --device value did not match any available device name or index. |
4 |
IO error. File not found, permission denied, disk full, or device lost mid-capture. |
Exit codes are stable and will not change without a major version bump.
| Platform | Target | Audio backend | Distribution |
|---|---|---|---|
| Windows 11 | x86_64-pc-windows-msvc |
WASAPI | Scoop, npm, crates.io, direct download |
| macOS | universal2 (Intel + Apple Silicon) |
CoreAudio | Homebrew, npm, direct download |
| Linux | x86_64-unknown-linux-gnu |
ALSA | Homebrew, npm, crates.io, direct download |
| Linux | aarch64-unknown-linux-gnu |
ALSA | Homebrew, npm, crates.io, direct download |
Verify the device name with decibri devices first. The --device value is matched case-insensitively against the device name substring, or parsed as a numeric index. Name substrings are generally more stable across runs than indices, which can shift if devices are plugged in or unplugged.
Binaries are unsigned. If you installed via npm, you shouldn't see the prompt because the binary is fetched to your user directory rather than executed from an untrusted download location. Direct downloads from GitHub Releases may trigger the warning; verify the SHA256 against SHA256SUMS on the release page and run it anyway if it matches.
Unquarantine the file manually:
xattr -d com.apple.quarantine /path/to/decibri
Or use npm install -g decibri-cli / cargo install decibri-cli, which avoid the issue entirely.
Which ALSA package you need depends on how you installed decibri-cli. A pre-built binary (Homebrew, npm, or direct download) needs the ALSA runtime library:
sudo apt install libasound2 # Debian / Ubuntu
sudo dnf install alsa-lib # Fedora
sudo pacman -S alsa-lib # Arch
Building from source with cargo install needs the ALSA development headers instead:
sudo apt install libasound2-dev # Debian / Ubuntu
sudo dnf install alsa-lib-devel # Fedora
decibri playOnly 16-bit PCM integer and 32-bit float WAV are supported. Convert the file to 16-bit PCM WAV (16 kHz mono is the common target for speech pipelines), then play the converted file.