Skip to main content
The .speakignore file lets you exclude specific files or directories from TTS audio generation. It uses gitignore syntax for pattern matching.

Creating .speakignore

Create a .speakignore file in your documentation directory:

Syntax

.speakignore uses the same pattern syntax as .gitignore:
  • # for comments
  • * matches any sequence of characters
  • ** matches nested directories
  • ! negates a pattern (include instead of exclude)
  • / at the end matches directories only

Common Patterns

Exclude Directories

.speakignore

Exclude Specific Files

.speakignore

Exclude by Pattern

.speakignore

Example .speakignore

Here’s a complete example:
.speakignore
Use .speakignore to skip auto-generated API reference pages, code snippets, or internal documentation that doesn’t need audio narration.

How It Works

When you run speak-mintlify generate, the tool:
  1. Searches for MDX files using the --pattern glob (default: **/*.mdx)
  2. Filters out files matching .speakignore patterns
  3. Only generates TTS audio for remaining files
Excluded files are completely skipped - no API calls, no S3 uploads, no MDX modifications.

Testing Your Patterns

Use the --dry-run flag to preview which files will be processed:
This shows:
  • Files that will be processed
  • Files that will be skipped
  • Reason for skipping (e.g., “matched .speakignore pattern”)

Advanced Patterns

Include Exceptions

Exclude a directory but include specific files:
.speakignore

Multiple Patterns

Combine multiple exclusion rules:
.speakignore

Exclude by Depth

Exclude files at specific directory depths:
.speakignore

Use Cases

API reference pages are often auto-generated and may not need narration:
.speakignore
Exclude reusable snippets that aren’t standalone pages:
.speakignore
Exclude work-in-progress documentation:
.speakignore
Exclude docs meant only for internal team use:
.speakignore

Pattern Matching Priority

Patterns are evaluated in order from top to bottom:
.speakignore
The file guides/getting-started.mdx will be included because the ! pattern comes after the exclusion.

Debugging

If files aren’t being excluded as expected:
1

Check pattern syntax

Ensure you’re using correct gitignore syntax:
  • dir/** excludes all files in dir/
  • dir/* only excludes direct children
  • *.mdx matches at any level
2

Use --verbose flag

Run with verbose output to see which files are skipped:
3

Test with --dry-run

Preview without making changes:

Performance Benefits

Using .speakignore effectively can:
  • Reduce API calls to Fish Audio
  • Lower S3 storage costs
  • Speed up generation time
  • Keep your docs cleaner (no audio on pages that don’t need it)
Start with a restrictive .speakignore and gradually include more sections as needed. It’s easier to add than remove.

Next Steps

Speaker Config

Configure voices and components

CLI Reference

View all CLI commands and options