Skip to main content

doom new

Generate scaffolding from predefined templates to quickly start new documentation projects.

Usage

doom new [template] [options]

Arguments

template
string
Scaffolding template name in format: [name][:type]
  • name - Template name (e.g., product-doc)
  • type - Optional scaffolding type within template
If omitted, defaults to product-doc and prompts for type selection.

Options

-f, --force
boolean
default:"false"
Force fetch latest template from remote, ignoring local cache.Example:
doom new --force
See Global Options for additional options.

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:
  1. Resolves the template repository
  2. Clones or updates the template (uses cache unless --force)
  3. Reads the scaffolding configuration
  4. Prompts for parameters
  5. 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

doom new
This prompts for scaffolding type and parameters.

Generate specific template type

doom new product-doc:api

Force update template

doom new --force
This fetches the latest template, ignoring local cache.

Generate with force flag

doom new product-doc:guide --force

Template Structure

Templates are defined in scaffolding.yaml:
scaffolding:
  - name: api
    description: API documentation structure
    parameters:
      - name: projectName
        type: input
        options:
          message: Project name
      - name: includeExamples
        type: confirm
        options:
          message: Include example files?
          default: true
    layout:
      - source: templates/api
        target: <%= parameters.projectName %>
        type: folder

Layout Types

File Layout:
- type: file
  source: templates/config.ejs
  target: doom.config.yaml
  processors:
    - type: ejsTemplate
      data: {}
Folder Layout:
- type: folder
  source: templates/docs
  target: docs
  matchers:
    - match: ['**/*.ejs']
      processors:
        - type: ejsTemplate
  writeMode: write  # or 'append'

Conditional Generation

layout:
  - source: templates/advanced.md
    target: docs/advanced.md
    type: file
    when: <%= parameters.includeAdvanced %>

Parameter Types

Supported parameter types (from @inquirer/prompts):
  • input - Text input
  • confirm - Yes/no confirmation
  • select - Single choice from list
  • checkbox - Multiple choices
  • password - Hidden text input
  • editor - Multi-line text editor

Output

Successful generation:
info  Generating scaffolding...
ready Scaffolding generated successfully!

Troubleshooting

Template not found

Ensure the template name is correct. Available templates:
  • product-doc
If the template should exist, try with --force:
doom new --force

Scaffolding type not found

List available types by running without the type:
doom new product-doc
You’ll be prompted with available scaffolding types.

Cache issues

Remove local cache and retry:
# Cache typically stored in system temp directory
doom new --force

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:
  1. Create a repository with templates/scaffolding.yaml
  2. Define scaffolding structure
  3. Add template files
  4. Configure in Doom (requires code modification)

Build docs developers (and LLMs) love