doom new
Generate scaffolding from predefined templates to quickly start new documentation projects.Usage
Arguments
Scaffolding template name in format:
[name][:type]name- Template name (e.g.,product-doc)type- Optional scaffolding type within template
product-doc and prompts for type selection.Options
Force fetch latest template from remote, ignoring local cache.Example:
Available Templates
product-doc
Template for product documentation with best practices and common structures. Repository:alauda-public/product-doc-guide
Location: templates/scaffolding.yaml
Behavior
Template Resolution
The command:- Resolves the template repository
- Clones or updates the template (uses cache unless
--force) - Reads the scaffolding configuration
- Prompts for parameters
- Generates files based on layout configuration
Interactive Prompts
The command prompts you for:- Scaffolding type (if not specified in template argument)
- Parameters defined in the template (project name, description, etc.)
File Generation
Templates support:- File templates - Single file generation
- Folder templates - Directory structure generation
- EJS processing - Dynamic content with parameters
- Conditional generation - Files generated based on conditions
Examples
Generate with default template
Generate specific template type
Force update template
Generate with force flag
Template Structure
Templates are defined inscaffolding.yaml:
Layout Types
File Layout:Conditional Generation
Parameter Types
Supported parameter types (from@inquirer/prompts):
input- Text inputconfirm- Yes/no confirmationselect- Single choice from listcheckbox- Multiple choicespassword- Hidden text inputeditor- Multi-line text editor
Output
Successful generation:Troubleshooting
Template not found
Ensure the template name is correct. Available templates:product-doc
--force:
Scaffolding type not found
List available types by running without the type:Cache issues
Remove local cache and retry:Connection errors
If you can’t reach the template repository, check:- Network connectivity
- Repository URL is accessible
- Firewall/proxy settings
Creating Custom Templates
To create your own template:- Create a repository with
templates/scaffolding.yaml - Define scaffolding structure
- Add template files
- Configure in Doom (requires code modification)
Related Commands
- doom dev - Start development after scaffolding
- doom build - Build the generated project