This is a minimal POSIX bash rewrite of the OpenSpec CLI tool, designed to run in environments without Node.js. It provides the core functionality for spec-driven development while maintaining compatibility across Unix-like systems.
openspec init [path]- Initialize OpenSpec in a projectopenspec list [--specs]- List changes or specificationsopenspec validate <name>- Validate change or spec structureopenspec archive <name>- Archive completed changes and merge specs
- Directory structure creation
- Basic file validation
- Change archiving with spec merging
- Project context templates
- Simple change proposal templates
- No interactive prompts or wizards
- No syntax highlighting or spinners
- Basic validation (no complex schema checking)
- No AI tool integration or slash command generation
- Manual spec merging (no delta tracking)
- No concurrent processing
# Copy to your path
sudo cp openspec.sh /usr/local/bin/openspec
sudo chmod +x /usr/local/bin/openspec
# Or use directly
./openspec.sh init# Initialize project
openspec init my-project
# Create change manually
mkdir -p my-project/openspec/changes/add-feature
echo "# Proposal\nAdd new feature" > my-project/openspec/changes/add-feature/proposal.md
# List changes
openspec list
# Validate change
openspec validate add-feature
# Archive change
openspec archive add-featureopenspec/
├── specs/ # Current specifications (source of truth)
├── changes/ # Change proposals
│ ├── [change-name]/
│ │ ├── proposal.md
│ │ ├── tasks.md
│ │ └── specs/ # Spec updates
│ └── archive/ # Archived changes
└── project.md # Project context
- Dependencies: Eliminated all npm dependencies, using only POSIX utilities
- Error Handling: Simple exit codes instead of complex error objects
- User Interface: Basic stdout instead of interactive TTY interfaces
- File Operations: Shell commands instead of Node.js fs module
- Validation: Basic existence checks instead of Zod schema validation
- Uses only POSIX shell features (
/bin/shcompatible) - Standard utilities:
find,mkdir,grep,sed,cat,echo - No bash-specific extensions
- Cross-platform: Linux, macOS, BSD, WSL
# Test basic functionality
./openspec.sh init /tmp/test-project
./openspec.sh list /tmp/test-project
./openspec.sh validate --help
# Validate syntax
shellcheck openspec.shFor teams that need the full OpenSpec experience:
- Start with POSIX version for basic spec management
- Install Node.js when more features are needed
- Migrate to full version with existing
openspec/directory
This minimal implementation focuses on core spec management. Extending it should maintain POSIX compatibility and avoid external dependencies beyond standard Unix utilities.