OpenSpec Dependencies: Complete Runtime Requirements Guide

OpenSpec requires 10 core Node.js runtime dependencies—including Commander for CLI parsing, Inquirer for interactive prompts, Zod for schema validation, and YAML libraries—declared in the package.json file of the Fission-AI/OpenSpec repository.

OpenSpec is a Node-based CLI tool that generates code from YAML specifications. To run the compiled binary, you need only the production dependencies listed in package.json, not the development tools used for building the project.

Core Runtime Dependencies

According to the package.json in the Fission-AI/OpenSpec repository, the tool relies on the following production dependencies:

Dependency Purpose
@inquirer/core Core primitives for building interactive command-line prompts
@inquirer/prompts Ready-made prompts (checkboxes, confirm) built on @inquirer/core
chalk Adds color and styling to terminal output
commander Parses CLI arguments and defines commands for the openspec executable
cross-spawn Cross-platform child process spawning for running user scripts
fast-glob Fast file-system globbing for locating spec files and templates
ora Displays spinner animations during long-running operations
posthog-node Sends anonymous usage telemetry for product analytics
yaml Parses and serializes YAML files—the primary OpenSpec format
zod Runtime schema validation ensuring spec files match expected shapes

These dependencies are installed automatically when you run pnpm add -g @fission-ai/openspec or npm install in a cloned repository.

How Dependencies Power the OpenSpec Architecture

The runtime dependencies work together to create an interactive, cross-platform experience. When you invoke the openspec binary from bin/openspec.js, the following flow occurs:

Command Parsing and User Interaction

The commander library reads CLI arguments and routes to appropriate commands (e.g., init, run, dev). For interactive steps, @inquirer/core and @inquirer/prompts render terminal prompts, while chalk colorizes success messages and warnings.

File Discovery and Validation

fast-glob scans the workspace for spec files (*.yaml, *.yml) and templates located in schemas/. The yaml library parses loaded content, and zod validates the structure against schemas defined in src/utils/*.ts.

Process Orchestration and Telemetry

cross-spawn executes user-defined build scripts in a cross-platform manner, while ora provides visual spinner feedback. Throughout execution, posthog-node records anonymized events to improve the tool.

Installation and Usage Examples

Install OpenSpec globally to access all runtime dependencies:


# Using pnpm (recommended)

pnpm add -g @fission-ai/openspec

# Or via npx without global install

npx @fission-ai/openspec@latest init

Run a spec-driven workflow:


# Initialize a new project (uses @inquirer prompts)

openspec init

# Validate and generate from a spec file

openspec run spec.yaml

Use the library programmatically in Node.js:

import { runSpec } from '@fission-ai/openspec';

// Load a YAML spec (yaml and zod handle parsing/validation)
const specContent = await import('fs/promises')
  .then(fs => fs.readFile('spec.yaml', 'utf8'));

runSpec(specContent)
  .then(() => console.log('✅ Spec processed successfully!'))
  .catch(err => console.error('❌ Error:', err));

Note: Programmatic imports require the package to be built with pnpm run build; the entry point lives in dist/index.js.

Key Source Files

These files demonstrate how OpenSpec wires dependencies into the system:

  • bin/openspec.js – Entry point that configures commander, loads commands, and initializes the runtime
  • src/utils/*.ts – Utility modules containing Zod schema definitions and file handling logic
  • schemas/spec-driven/schema.yaml – Canonical YAML schema used for validation via zod
  • package.json – Declares all runtime dependencies, entry points, and build scripts

Summary

  • OpenSpec requires 10 production dependencies declared in package.json to run the compiled CLI
  • Commander handles CLI parsing, while Inquirer libraries manage interactive prompts
  • Zod and yaml work together to validate spec files against schemas in src/utils/*.ts
  • Cross-spawn provides reliable process execution across Windows, macOS, and Linux
  • Development dependencies (TypeScript, ESLint, Vitest) are not required for end-users

Frequently Asked Questions

Do I need to install TypeScript to run OpenSpec?

No. TypeScript is listed as a devDependency and is only required for development and building the source code. End-users running the compiled CLI from npm need only the 10 production dependencies.

Why does OpenSpec use both @inquirer/core and @inquirer/prompts?

@inquirer/core provides the foundational primitives for building custom prompts, while @inquirer/prompts offers ready-made implementations like checkboxes and confirm dialogs. This combination allows OpenSpec to maintain both flexibility and rapid development of the user interface.

Can I run OpenSpec without internet access?

Yes, but with limited functionality. While the core依赖 (dependencies) work offline, the posthog-node library will fail silently or queue telemetry events if it cannot reach PostHog servers. All code generation and spec validation functions operate entirely offline using yaml, zod, and fast-glob.

What Node.js version is required for these dependencies?

While the source code analysis does not specify exact Node.js version constraints, the use of modern ESM imports and modern dependencies like commander v11+ and zod suggests Node.js 18 or higher is recommended. Check the engines field in package.json for definitive version requirements.

Have a question about this repo?

These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:

Share the following with your agent to get started:
curl -s "https://instagit.com/install.md"

Works with
Claude Codex Cursor VS Code OpenClaw Any MCP Client

Maintain an open-source project? Get it listed too →