Skip to content

acwilan/voicecli

Repository files navigation

voicecli

macOS native voice CLI — transcribe audio to text and synthesize speech.

Commands

Transcribe audio to text

voicecli transcribe /path/to/audio.m4a

Text to speech (play via speaker)

voicecli speak "Hello world"

Text to speech (save to file)

voicecli speak "Hello world" --output /path/to/output.aiff

Text to speech from file

voicecli speak /path/to/response.md --output /path/to/output.aiff

Text to speech from stdin

echo "Hello world" | voicecli speak -
cat response.md | voicecli speak - --output response.aiff

List available voices

voicecli voices

Options for speak

  • --output <path> — Save audio to file instead of playing
  • --voice <voice-id> — Use specific voice (see voicecli voices)
  • --rate <0.0-1.0> — Speech rate (default: 0.5)

Speak Input Detection

The speak command auto-detects input type:

  • Plain text: voicecli speak "Hello world"
  • File path: If the argument is a readable file, it reads the file content
  • Stdin (-): Read from standard input for piping

Permissions

First run of transcribe will prompt for Speech Recognition permission. Check System Settings → Privacy & Security → Speech Recognition if denied.

Building

swift build
swift build -c release  # For release build

Installation

Homebrew (recommended)

brew tap acwilan/voicecli
brew install voicecli

Download Binary

Download the latest release from GitHub Releases:

curl -L https://github.com/acwilan/voicecli/releases/latest/download/voicecli-macos.tar.gz | tar xz
mv voicecli ~/.local/bin/  # or /usr/local/bin/

Build from Source

git clone https://github.com/acwilan/voicecli.git
cd voicecli
swift build -c release
cp .build/release/voicecli ~/.local/bin/

About

macOS native voice CLI — transcribe audio to text and synthesize speech.

Resources

License

Contributing

Stars

Watchers

Forks

Packages