speed-docs
v0.0.30
Published
A CLI tool to create and validate FumaDocs content structure
Downloads
45
Maintainers
Readme
speed-docs
A powerful CLI tool to quickly create and deploy online documentation from your content directory using FumaDocs.
Installation
npm install -g speed-docsUsage
Prepare your content directory
Your content directory should have this structure:
content/
├── config.json # Documentation configuration
└── docs/ # Your documentation content
├── index.mdx
├── getting-started/
│ ├── meta.json
│ └── content.mdx
└── api/
├── meta.json
└── reference.mdxThe config.json file should contain your documentation configuration:
{
"nav": {
"title": "My Documentation",
"image": "/logo.png"
}
}Put the images in the root of content directory. In the example above, put the images in content directory.
Initialize Docs Directory
speed-docs init [--dir <path>]This command downloads the docs directory template from GitHub and initializes it in the specified directory (or current working directory if not specified). The CNAME file is automatically removed.
# Initialize in current directory
speed-docs init
# Initialize in a specific directory
speed-docs init --dir ./my-docsBasic Usage
speed-docs <origin-directory>Development Mode (with file watching)
speed-docs <origin-directory> --devCustom Template
speed-docs <origin-directory> --template <template-url>Custom Download Directory
speed-docs <origin-directory> --download-dir <path>Examples
# Initialize a new docs directory
speed-docs init
speed-docs init --dir ./my-docs
# Build static documentation
speed-docs ./my-content
# Run in development mode with live reload
speed-docs ./my-content --dev
# Use a custom template
speed-docs ./my-content --template https://github.com/user/custom-template/archive/main.tar.gz
# Use a custom download/cache directory
speed-docs ./my-content --download-dir /path/to/custom/cache
# Combine multiple options
speed-docs ./my-content --dev --download-dir /tmp/my-cache --forceWhat it does
Speed-docs automates the entire documentation creation process:
1. Template Management
- Downloads a pre-configured FumaDocs template from GitHub
- Supports custom template URLs
- Automatically extracts and sets up the template
- Caches templates in
~/.speed-docs/cacheby default - Supports custom download/cache directories via
--download-dir
2. Content Validation
- Validates your origin directory structure:
- Ensures
config.jsonexists and contains valid JSON - Ensures
docsdirectory exists - Validates all JSON files in the docs directory and subdirectories
- Ensures
- Provides detailed error messages for invalid content
3. Content Processing
- Copies all content files to the template's
contentdirectory - Automatically moves image files (png, jpg, jpeg, gif, svg, webp, ico) to the
publicdirectory - Maintains directory structure and file organization
4. Development Mode (--dev)
- Starts a development server with live reload
- Watches your origin directory for changes
- Automatically updates the documentation when files change
- Provides real-time feedback on file modifications
5. Production Build
- Installs all necessary dependencies
- Builds optimized static documentation
- Outputs the built documentation to a
docs-outputdirectory - Ready for deployment to any static hosting service
Commands
init
Initialize a docs directory from the template.
| Option | Description |
| -------------- | ------------------------------------------------------------------- |
| --dir <path> | Target directory to initialize docs (defaults to current directory) |
Main Command
Build documentation from a content directory.
| Option | Description |
| ----------------------- | ------------------------------------------------------- |
| <origin-directory> | Path to your content directory (required) |
| --dev | Run in development mode with file watching |
| --template <url> | Override the default template repository URL |
| --force | Force redownload and reinstall template (ignores cache) |
| --download-dir <path> | Override the default download/cache directory |
| --base-path <path> | Override the default base path |
| --include-hidden | Include hidden files and directories |
Features
- ✅ Zero Configuration: Works out of the box with sensible defaults
- ✅ Live Development: File watching and hot reload in dev mode
- ✅ Content Validation: Comprehensive validation of your content structure
- ✅ Image Handling: Automatic image optimization and placement
- ✅ Template Flexibility: Support for custom templates
- ✅ Custom Cache Directory: Override default download/cache location
- ✅ Production Ready: Optimized builds for deployment
- ✅ Cross Platform: Works on Windows, macOS, and Linux
Requirements
- Node.js 18.0.0 or higher
- Valid content directory with
config.jsonanddocs/folder - Internet connection for template download
License
MIT
