Initializing OpenSpec
Purpose
Standardizes the initialization of OpenSpec in a project to ensure proper configuration and tool integration.
1. Safety & Verification
Before initialization:
- •Check Help: Run
cd docs && npx @fission-ai/openspec@latest init --helpto verify the latest initialization options. - •Verify Context: Ensure you are in the intended project root.
2. Common Workflows
Workflow: Basic Initialization
- •Run
cd docs && npx @fission-ai/openspec@latest init. - •Follow interactive prompts (if applicable) or provide flags for non-interactive use.
Workflow: Non-Interactive Tool Setup
- •Specify AI tools and target directory so OpenSpec lives under docs:
npx @fission-ai/openspec@latest init ./docs --tools cursor,claude - •Use
--forceto auto-cleanup legacy files if necessary.
3. Error Handling
- •If
command not foundoccurs: Ensure Node.js is installed and usenpx. - •If permission errors occur: Check file system permissions in the target directory.
4. Examples
Example: Initialize with Cursor and Claude
Command: npx @fission-ai/openspec@latest init ./docs --tools cursor,claude
Expected Output: OpenSpec structure at docs/openspec/ and tool config. Run other OpenSpec CLI commands from the docs/ directory (or use pnpm openspec -- from repo root).