create-specment
v0.4.1
Published
Interactive CLI tool for creating Docusaurus-based specification documentation projects
Maintainers
Readme
create-specment
Demo: https://plenarc.github.io/specment/
- 'specification' + 'document' => Specment
- A site generation tool specializing in creating specification documents based on Docusaurus
Overview
create-specment is a CLI tool that easily generates Docusaurus projects specialized for specification documentation. It provides Storybook-like ease of use and create-better-t-stack-like interactive setup, integrating all the features needed for specification documentation creation.
Features
- 🚀 Interactive Setup: Generate projects by simply answering questions
- 📋 5 Specialized Templates: Choose optimal templates based on your use case
- 🔧 Feature Selection: Select PlantUML, Redoc, search, multilingual support, and more
- 📝 Variable Substitution: Automatically replace project names and author information
- 🎨 Docusaurus Compatible: Fully compatible with the existing Docusaurus ecosystem
Installation Guide
Prerequisites
The following software must be installed:
WSL (for Windows environments)
- For Windows environments, we strongly recommend using Windows Subsystem for Linux (WSL)
- Ubuntu 22.04 LTS or higher is recommended
# Install WSL (run in Windows PowerShell with administrator privileges) wsl --installmise (development environment management tool)
- Linux/macOS/WSL
curl https://mise.run | sh # Update shell configuration echo 'eval "$(mise activate bash)"' >> ~/.bashrc source ~/.bashrc - brew
brew install mise - Version check
mise --version
- Linux/macOS/WSL
Node.js (LTS or higher recommended, installation via mise recommended)
# Install Node.js using mise mise install node@lts mise use node@lts # Check version node --versionni (package manager unification tool)
# Install ni using mise mise use npm:@antfu/ni@latest # Check version ni --version
Installation Methods
- For details on each option, see Option Details
Method 1: Using ni (Recommended)
# Create project using ni (interactive setup will start)
nlx create-specment@latestAfter execution, the following options will be displayed, so select the necessary documents and features:
◆ Please select display language / 表示言語を選択してください:
│ ● English
│ ○ 日本語
└
┌ 🚀 Welcome to create-specment!
Creating a new Docusaurus-based specification documentation project...
│
◆ Enter folder name (project name):
│ _
└
◆ Which templates would you like to use? (Multiple selection)
│ ◻ Project Analysis
│ ◻ Requirements Specification
│ ◻ External Design
│ ◻ Internal Design
│ ◻ API (Using Redocusaurus)
└
◆ Which additional features would you like to include?
│ ◻ PlantUML
│ ◻ Mermaid
└Once creation is complete, change to the folder and start in development mode after installation:
cd <folder-name> && ni && nr startMethod 2: Using npx
# Start setup
npx create-specment@latest- For option details, see Method 1
Interactive Setup
When you run create-specment, the following options will be displayed sequentially:
1. Display Language Selection
◆ Please select display language / 表示言語を選択してください:
│ ● English
│ ○ 日本語- Select the display language for the interface
- Subsequent questions will be displayed in the selected language
2. Project Name Input
◆ Enter folder name (project name):
│ _- Enter the folder name for the project to be created
- This name will become the project directory name
3. Template Selection (Multiple selection possible)
◆ Which templates would you like to use? (Multiple selection)
│ ◻ Project Analysis (Provides structure for understanding project overview)
│ ◻ Requirements Specification
│ ◻ External Design
│ ◻ Internal Design
│ ◻ API (Using Redocusaurus)- Multiple templates can be selected simultaneously
- Each template is generated as an independent section
- At least one template must be selected
Project Analysis
Project overview and analysis template. Provides structure for understanding the overall picture of the project.
Use Cases:
- Project proposals
- Current state analysis reports
- SWOT analysis documents
Requirements Specification
Requirements specification template. Allows systematic organization of functional and non-functional requirements.
Use Cases:
- System requirements specifications
- Functional specifications
- EARS format requirement descriptions
External Design
External design specification template. Specialized for interface design with external systems.
Use Cases:
- System architecture design documents
- API design documents
- UI/UX design documents
Internal Design
Internal design specification template. Specialized for detailed internal system design and algorithms.
Use Cases:
- Detailed design documents
- Database design documents
- Algorithm specifications
API
- Using Redocusaurus, you can display YAML format files written in OpenAPI specifications
4. Additional Feature Selection
◆ Which additional features would you like to include?
│ ◻ PlantUML (PlantUML diagram integration (UML diagrams and flowcharts))
│ ◻ Mermaid- PlantUML: Adds functionality to create UML diagrams and flowcharts
- Mermaid: Adds functionality to create diagrams within Markdown
- Both can be selected
PlantUML
- You can use PlantUML for UML diagrams and sequence diagrams
- Uses the Docusaurus theme create-specment
- ※ Please refer to the README at the link for usage and precautions
Mermaid
- Uses the Docusaurus theme theme-mermaid
Multilingual Support
TBD: Plans to support document creation in multiple languages (if requested)
Command Line Options
create-specment [project-name] [options]
Arguments:
project-name Folder name for the project to be created (optional)
When specified: Skip folder name input
Options:
-t, --template <template> Template to use (project-analysis|requirements|external-design|internal-design|api-spec)
--skip-install Skip dependency installation
--verbose Show detailed logs
-h, --help Show help
-V, --version Show versionUsage Examples
# Complete interactive setup (all options will be displayed)
create-specment
# Specify folder name and interactive setup (skip folder name input)
create-specment my-docs
# Completely non-interactive (skip folder name and template selection)
create-specment my-docs --template requirements
# Specify template only (folder name input will be displayed)
create-specment --template api-specTroubleshooting
Common Issues
1. Node.js Version Error
Error: Node.js version 20.0 or higher is requiredSolution:
# Check Node.js version
node --version
# Update Node.js using mise
mise install node@latest
mise use node@latest2. Package Installation Error
Error: Failed to install dependenciesSolution:
# Clear cache
ni clean
# Or manually clear
npm cache clean --force
# Reinstall
ni3. Port Conflict Error
Error: Port 3000 is already in useSolution:
# Specify a different port
nr start -- --port 3001Notes for Windows Environment
- Strongly recommend using WSL
- For Windows environments, we strongly recommend using WSL (Windows Subsystem for Linux)
- Operation in PowerShell or Command Prompt is not guaranteed
- Ubuntu 22.04 LTS or higher is recommended
- Unified Development Environment
- The combination of mise + ni minimizes environment differences
- Running as a Linux environment within WSL provides an experience equivalent to macOS/Linux
License
MIT License - See the LICENSE file for details.
Contributing
We welcome contributions to the project! See CONTRIBUTING.md for details.
Support
- 🐛 Bug Reports: GitHub Issues
- 💡 Feature Requests: GitHub Discussions
- 📖 Documentation: Official Documentation
関連プロジェクト
- Docusaurus - Static site generator
- mise - Development environment management tool
- ni - Package manager unification tool
- PlantUML - UML diagram creation tool
- Redoc - OpenAPI specification display tool
