GeminiTtsCli 0.5.1

There is a newer version of this package available.
See the version list below for details.
dotnet tool install --global GeminiTtsCli --version 0.5.1
                    
This package contains a .NET tool you can call from the shell/command line.
dotnet new tool-manifest
                    
if you are setting up this repo
dotnet tool install --local GeminiTtsCli --version 0.5.1
                    
This package contains a .NET tool you can call from the shell/command line.
#tool dotnet:?package=GeminiTtsCli&version=0.5.1
                    
nuke :add-package GeminiTtsCli --version 0.5.1
                    

Gemini TTS CLI

A command-line interface tool for text-to-speech conversion using Google's Gemini TTS API.

Features

  • Convert text to speech using Google Gemini TTS API
  • Multiple voice options (male and female voices)
  • Support for custom instructions
  • Output to WAV format
  • Merge multiple WAV files into one with glob pattern support
  • Cross-platform support (Windows, Linux, macOS)

Installation

dotnet tool install -g GeminiTtsCli

Manual Installation

Download the appropriate binary for your platform from the releases page.

Prerequisites

  1. Google AI Studio API Key: You need to obtain an API key from Google AI Studio
  2. Environment Variable: Set the GEMINI_API_KEY environment variable with your API key

Setting up the API Key

Windows (PowerShell)
$env:GEMINI_API_KEY = "your-api-key-here"
Windows (Command Prompt)
set GEMINI_API_KEY=your-api-key-here
Linux/macOS
export GEMINI_API_KEY="your-api-key-here"

To make it permanent, add the export line to your shell profile (.bashrc, .zshrc, etc.).

Usage

gemini-tts -t "Text to convert" [-i "Your instructions"] [-s <voice-name>] [-o output.wav]

Parameters

  • -t, --text (required): Text to convert to speech
  • -i, --instructions (optional): Instructions for the TTS conversion (default: "Read aloud in a warm, professional and friendly tone")
  • -s, --speaker1 (optional): Voice name for the speaker (default: random selection from available voices)
  • -o, --outputfile (optional): Output WAV filename (default: output.wav)

Available Voices

Female Voices
  • achernar, aoede, autonoe, callirrhoe, despina, erinome, gacrux, kore
  • laomedeia, leda, sulafat, zephyr, pulcherrima, vindemiatrix
Male Voices
  • achird, algenib, algieba, alnilam, charon, enceladus, fenrir, iapetus
  • orus, puck, rasalgethi, sadachbia, sadaltager, schedar, umbriel, zubenelgenubi

Examples

With custom instructions and specific voice:

gemini-tts -i "Read aloud in a warm, professional and friendly tone" -s achird -t "大家好,我是 Will 保哥。" -o my-name-is-will.wav

With minimal required parameters (uses defaults):

gemini-tts -t "Hello, this is a test of the Gemini TTS system"

With specific voice but default instructions:

gemini-tts -s zephyr -t "Hello, this is a test of the Gemini TTS system" -o greeting.wav

Merge Command

The merge command allows you to merge multiple WAV files into a single WAV file.

Usage

gemini-tts merge <glob-pattern> [-o <output-file>]

Parameters

  • <glob-pattern> (required): Pattern to match WAV files (e.g., *.wav, trial03-*.wav, **/*.wav)
  • -o, --outputfile (optional): Output WAV filename

Examples

Merge all WAV files in current directory:

gemini-tts merge '*.wav'
# Creates: merged.wav

Merge specific pattern with custom output:

gemini-tts merge 'trial03-*.wav' -o trial03-merged.wav
# Creates: trial03-merged.wav

Merge all WAV files recursively:

gemini-tts merge '**/*.wav' -o all-merged.wav
# Creates: all-merged.wav

Notes

  • All input files must have .wav extension
  • Files with different audio formats will be converted to match the first file's format
  • The pattern must include *.wav to ensure only WAV files are processed
  • Recursive patterns (**/*.wav) will search subdirectories

Development

Building from Source

  1. Clone the repository
  2. Restore dependencies: dotnet restore
  3. Build: dotnet build
  4. Run: dotnet run -- --text "Hello world"

Publishing

The project supports two types of builds:

1. Global Tool (for NuGet distribution)
dotnet pack --configuration Release

This creates a .NET global tool package that can be installed via dotnet tool install -g GeminiTtsCli.

2. Self-Contained Executables (for standalone distribution)

For Windows x64:

dotnet publish --configuration Release --self-contained true --runtime win-x64 -p:PublishSelfContained=true

For Linux x64:

dotnet publish --configuration Release --self-contained true --runtime linux-x64 -p:PublishSelfContained=true

For macOS x64:

dotnet publish --configuration Release --self-contained true --runtime osx-x64 -p:PublishSelfContained=true

For macOS ARM64:

dotnet publish --configuration Release --self-contained true --runtime osx-arm64 -p:PublishSelfContained=true

The project includes automated GitHub Actions workflows for:

  • Building cross-platform binaries
  • Publishing to NuGet Gallery
  • Creating GitHub releases

To trigger a release, create and push a git tag:

git tag v0.4.0
git push origin v0.4.0

License

MIT License - see LICENSE file for details.

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests if applicable
  5. Submit a pull request

Support

If you encounter any issues or have questions, please open an issue on GitHub.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

Version Downloads Last Updated
0.7.2 163 7/16/2025
0.7.1 139 7/16/2025
0.7.0 140 7/16/2025
0.6.0 165 6/14/2025
0.5.1 149 6/14/2025
0.5.0 156 6/14/2025
0.4.0 293 6/12/2025
0.3.0 279 6/9/2025
0.2.0 104 6/6/2025
0.1.0 116 6/6/2025