init
Initialize a specs.config.yaml file with production-ready defaults.
Usage
specs init [options]Purpose
The init command scaffolds a fully-populated configuration file with:
- Sensible defaults for dataDirectory (
./data) and outputDirectory (./specs) - All processing, format, and include options with production-ready values
- Inline documentation with links to the full configuration reference
- Empty sources object ready for your Figma file keys
This is the recommended way to get started with Specs in a new project.
What Gets Created
The init command creates a specs.config.yaml file with the following structure:
# Specs CLI Configuration (production-ready defaults)## This file configures how Specs fetches and processes Figma component data.# See: https://directededges.github.io/specs/config/ for complete documentation.
# Where fetch writes payloads, and where generate reads from.# See: https://docs.specs.dev/config/data-sourcesdataDirectory: ./data
# Default location for generated spec files (can override with -o flag).# See: https://docs.specs.dev/config/data-sourcesoutputDirectory: ./specs
# Figma file sources to fetch and process.# See: https://docs.specs.dev/config/data-sourcessources: {}
# Processing and output configuration.# See: https://docs.specs.dev/config/config: processing: subcomponents: # scope: NESTED match: - '{C} / _ / {S}' # exclude: # - '{C} / Examples / {S}' # glyphNamePattern: 'DS Icon Glyph /' variantDepth: 9999 details: LAYERED format: output: JSON keys: SAFE layout: LAYOUT tokens: TOKEN include: invalidVariants: false invalidCombinations: trueEach section includes inline comments with references to the full documentation.
Options
--force / -f
Overwrite existing config file without prompting.
By default, if specs.config.yaml exists, init prompts before overwriting. Use --force to skip the prompt.
# Prompt before overwrite (default)specs init
# Overwrite without promptingspecs init --force--config <path> / -c <path>
Custom path for the config file (default: specs.config.yaml).
# Create config in a custom locationspecs init --config ./configs/dev.yaml
# Create multiple configs for different environmentsspecs init --config ./configs/dev.yaml --forcespecs init --config ./configs/prod.yaml --forceExamples
Example 1: Basic Initialization
cd my-design-systemspecs init
# Output:# ✓ Created specs.config.yaml# 📚 Next steps:# 1. Edit the config file to add your Figma file keys# 2. Run: specs fetch# 3. Run: specs scan# 4. Run: specs generate## 📖 Documentation: https://directededges.github.io/specs/config/Example 2: Environment-Specific Configs
# Development configspecs init --config .specs.dev.yaml --force
# Production configspecs init --config .specs.prod.yaml --force
# Use with --config flag on other commandsspecs fetch --config .specs.dev.yamlspecs generate data/library.file.json -c "Button" --config .specs.prod.yamlExample 3: Force Overwrite
# If you accidentally delete your config, recreate itspecs init --forceSee Also:
- Configuration Reference - Config file options
- Getting Started - Quick start guide