feat: add terminal-tts demo - #29
Open
luke-speechify wants to merge 2 commits into
Open
Conversation
A terminal-styled web playground for Speechify text-to-speech: type a 'speechify say' command, hit enter, and the browser posts it to a Node route that holds the API key and returns audio. Ships the real, dependency-free cli/say.mjs so the same thing runs in a genuine shell. Registers the demo as a Vercel Service and workspace package.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
luke-speechify
commented
Aug 23, 2026
luke-speechify
left a comment
Contributor
Author
There was a problem hiding this comment.
Demo queue review — terminal-tts:
- CLI matches the DRG-374 thesis: dependency-free
cli/say.mjscallingPOST https://api.speechify.ai/v1/audio/speechwith modelsimba-3.2, key viaSPEECHIFY_API_KEY. Endpoint, voice and model defaults match the other TypeScript demos and the docs. - Key stays server-side: the Next.js playground proxies through route handlers; the CLI reads
.envlocally. No client key exposure. demo.json(order 205) +pnpm-workspace.yaml+vercel.json+ regenerated README/index are all in this PR — hosted signal and generated outputs in sync.
Not approved (leaving approval to Luke per merge policy). One note: this is the canonical CLI demo for the Text-to-speech from your terminal post; a duplicate cli-tts PR was opened and withdrawn.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pairs with the upcoming speechify.ai post "Text-to-speech from your terminal: a CLI demo with the Speechify API".
What this demo does
A terminal-styled web playground for Speechify text-to-speech. The page renders a monospace "terminal" where you type a command like:
Hitting enter parses the quoted text and
--voice/--modelflags client-side, POSTs{ text, voiceId, model }to a server route, plays the returned audio, and prints shell-style output. Also supportsvoices,help,clear, and Up/Down command history.The original idea — reading text aloud straight from the command line — can't be hosted as a shared page, so this is a hostable adaptation. The real CLI ships alongside it in
cli/say.mjs: a standalone, dependency-free Node script (nativefetch+node:fs) that callsPOST https://api.speechify.ai/v1/audio/speechwith your env key and writes an MP3 (or pipes to a player). Documented in the README under "Run it as a real CLI".Key handling and gating
app/api/say/route.ts(Node runtime,client.audio.speech, returns base64 MP3).SPEECHIFY_API_KEYnever reaches the browser;@speechify/apiis marked server-external.x-turnstile-tokenheader. Fails open locally whenTURNSTILE_SECRET_KEYis unset.cli/say.mjsscript reads the key from your own shell environment — it runs on your machine, not in a browser.Hosting registration
vercel.json— added aterminal-ttsservice + a/terminal-tts/:path*rewrite (before the/and catch-all rewrites).pnpm-workspace.yaml— addeddemos/terminal-tts.pnpm generate— regenerated the README table and site manifest.Verification
pnpm --filter terminal-tts buildsucceeds (build + typecheck ✅).cli/say.mjsagainst the real endpoint with the defaultgeffen_32/simba-3.2; got a valid 44 KB MP3 back (the web route sends the identical request body via the SDK).