Skip to content

Commit 9a3ed56

Browse files
jrusso1020claude
andauthored
docs(cli): add tts command to --help groups, CLI docs, and CLAUDE.md checklist (#240)
The tts command was implemented (PR #201) but never added to the root-level help display or documentation. This adds it to: - help.ts GROUPS (AI & Integrations) so it appears in `hyperframes --help` - docs/packages/cli.mdx with usage examples and flag reference - CLAUDE.md "Adding CLI Commands" checklist: new steps 4-5 require adding commands to help.ts groups and docs, preventing future omissions Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 078ed7d commit 9a3ed56

3 files changed

Lines changed: 40 additions & 1 deletion

File tree

CLAUDE.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,9 @@ When adding a new CLI command:
7272
1. Define the command in `packages/cli/src/commands/<name>.ts` using `defineCommand` from citty
7373
2. **Export `examples`** in the same file — `export const examples: Example[] = [...]` (import `Example` from `./_examples.js`). These are displayed by `--help`.
7474
3. Register it in `packages/cli/src/cli.ts` under `subCommands` (lazy-loaded)
75-
4. Validate by running `npx tsx packages/cli/src/cli.ts <name> --help` and verifying the examples section appears
75+
4. **Add to help groups** in `packages/cli/src/help.ts` — add the command name and description to the appropriate `GROUPS` entry. Without this, the command won't appear in `hyperframes --help` even though it works.
76+
5. **Document it** in `docs/packages/cli.mdx` — add a section with usage examples and flags.
77+
6. Validate by running `npx tsx packages/cli/src/cli.ts --help` (command appears in the list) and `npx tsx packages/cli/src/cli.ts <name> --help` (examples appear).
7678

7779
## Key Concepts
7880

docs/packages/cli.mdx

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,42 @@ This is suppressed in CI environments, non-TTY shells, and when `HYPERFRAMES_NO_
226226
<Tip>
227227
For music or noisy audio, use `--model medium.en` for better accuracy. For the best results with production content, transcribe via the OpenAI or Groq Whisper API and import the JSON.
228228
</Tip>
229+
230+
### `tts`
231+
232+
Generate speech audio from text using a local AI model (Kokoro-82M). No API key required — runs entirely on-device.
233+
234+
```bash
235+
# Generate speech from text
236+
npx hyperframes tts "Welcome to HyperFrames"
237+
238+
# Choose a voice
239+
npx hyperframes tts "Hello world" --voice am_adam
240+
241+
# Save to a specific file
242+
npx hyperframes tts "Intro" --voice bf_emma --output narration.wav
243+
244+
# Adjust speech speed
245+
npx hyperframes tts "Slow and clear" --speed 0.8
246+
247+
# Read text from a file
248+
npx hyperframes tts script.txt
249+
250+
# List available voices
251+
npx hyperframes tts --list
252+
```
253+
254+
| Flag | Description |
255+
|------|-------------|
256+
| `--output, -o` | Output file path (default: `speech.wav` in current directory) |
257+
| `--voice, -v` | Voice ID (run `--list` to see options) |
258+
| `--speed, -s` | Speech speed multiplier (default: 1.0) |
259+
| `--list` | List available voices and exit |
260+
| `--json` | Output result as JSON |
261+
262+
<Tip>
263+
Combine `tts` with `transcribe` to generate narration and word-level timestamps for captions in a single workflow: generate the audio with `tts`, then transcribe the output with `transcribe` to get word-level timing.
264+
</Tip>
229265
</Tab>
230266
<Tab title="Preview">
231267
### `preview`

packages/cli/src/help.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ const GROUPS: Group[] = [
5353
"transcribe",
5454
"Transcribe audio/video to word-level timestamps, or import an existing transcript",
5555
],
56+
["tts", "Generate speech audio from text using a local AI model (Kokoro-82M)"],
5657
],
5758
},
5859
{

0 commit comments

Comments
 (0)