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>
This commit is contained in:
James Russo
2026-04-10 09:12:56 -07:00
committed by GitHub
co-authored by Claude Opus 4.6
parent 078ed7d5cd
commit 9a3ed569a0
3 changed files with 40 additions and 1 deletions
+3 -1
View File
@@ -72,7 +72,9 @@ When adding a new CLI command:
1. Define the command in `packages/cli/src/commands/<name>.ts` using `defineCommand` from citty
2. **Export `examples`** in the same file — `export const examples: Example[] = [...]` (import `Example` from `./_examples.js`). These are displayed by `--help`.
3. Register it in `packages/cli/src/cli.ts` under `subCommands` (lazy-loaded)
4. Validate by running `npx tsx packages/cli/src/cli.ts <name> --help` and verifying the examples section appears
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.
5. **Document it** in `docs/packages/cli.mdx` — add a section with usage examples and flags.
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).
## Key Concepts
+36
View File
@@ -226,6 +226,42 @@ This is suppressed in CI environments, non-TTY shells, and when `HYPERFRAMES_NO_
<Tip>
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.
</Tip>
### `tts`
Generate speech audio from text using a local AI model (Kokoro-82M). No API key required — runs entirely on-device.
```bash
# Generate speech from text
npx hyperframes tts "Welcome to HyperFrames"
# Choose a voice
npx hyperframes tts "Hello world" --voice am_adam
# Save to a specific file
npx hyperframes tts "Intro" --voice bf_emma --output narration.wav
# Adjust speech speed
npx hyperframes tts "Slow and clear" --speed 0.8
# Read text from a file
npx hyperframes tts script.txt
# List available voices
npx hyperframes tts --list
```
| Flag | Description |
|------|-------------|
| `--output, -o` | Output file path (default: `speech.wav` in current directory) |
| `--voice, -v` | Voice ID (run `--list` to see options) |
| `--speed, -s` | Speech speed multiplier (default: 1.0) |
| `--list` | List available voices and exit |
| `--json` | Output result as JSON |
<Tip>
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.
</Tip>
</Tab>
<Tab title="Preview">
### `preview`
+1
View File
@@ -53,6 +53,7 @@ const GROUPS: Group[] = [
"transcribe",
"Transcribe audio/video to word-level timestamps, or import an existing transcript",
],
["tts", "Generate speech audio from text using a local AI model (Kokoro-82M)"],
],
},
{