Interactive command-line interface for generating lifelike speech using the Google Gemini API.
Powered by the gemini-2.5-flash-preview-tts model.
├── src/
│ ├── cli/
│ │ ├── commands/
│ │ │ ├── interactive.ts
│ │ │ └── advanced.ts
│ │ └── index.ts
│ └── api/
│ └── server.ts
├── test/
│ ├── unit.test.ts
│ ├── e2e.test.ts
│ └── cli-e2e.test.ts
├── docs/
├── scripts/
│ └── main.ts
├── .gitignore
├── package.json
├── tsconfig.json
└── .eslintrc.json
# Copy the example npmrc and set your GitHub PAT
cp .npmrc.example .npmrc
# Edit .npmrc and replace YOUR_GITHUB_PAT_HERE with your token
npm install @bniladridas/ttsnpm install @google/genai mime chalk dotenv
npm install -D @types/node tsxCreate .env in the root:
GEMINI_API_KEY=your_google_genai_api_key_herenpm run ttsnpm run cli:interactive
npm run clinpm run dev
npm startnpm start— production servernpm run dev— development servernpm run cli— CLI interfacenpm run cli:interactive— interactive CLInpm run cli:advanced— advanced CLInpm test— all testsnpm run test:e2e— e2e tests onlynpm run lint— lint codenpm run typecheck— type checknpm run format— format codenpm run build— build TypeScript
- Type text interactively to synthesize speech
- Choose voice:
1(Zephyr) or2(Puck) - Optional style:
"warm","calm","excited" - Output saved as
output_audio.wav - Type
exitto quit
GitHub Actions workflows:
tts.yml: Runs tests, linting, type checking, and build on push/PR to main/master.tts-release.yml: Automates versioning, changelog, and GitHub releases on push to main using semantic-release.tts-security.yml: Performs security code scanning with CodeQL on push/PR and weekly.
This project uses semantic-release for automated versioning and releases. Commits must follow Conventional Commits format:
feat:for new features (minor version bump)fix:for bug fixes (patch version bump)BREAKING CHANGE:for breaking changes (major version bump)
Releases are triggered on pushes to main branch. The latest release is automatically published to GitHub with generated changelogs.
- Commit messages start with lowercase type:
feat:,fix:,chore: - Entire message lowercase
- First line ≤ 50 characters
Husky manages Git hooks automatically. Hooks are set up in .husky/:
pre-commit: Checks code formatting.commit-msg: Validates commit message format (lowercase, <=50 chars, starts with type:).