@leeforge/schema-cli
v0.0.2
Published
CLI to install and manage Leeforge schema skills and rules
Readme
@leeforge/schema-cli
Command-line tool to install and manage Leeforge schema skills and rules for AI coding assistants
🚀 Quick Start
Installation
# Global installation (recommended)
npm install -g @leeforge/schema-cli
# Or use with npx
npx @leeforge/schema-cli installBasic Usage
# Interactive installation
schema-cli install
# List available resources
schema-cli list
# Update installed resources
schema-cli update📖 Commands
install
Install skills and/or rules to your AI assistant with an interactive interface.
schema-cli install [options]
Options:
--ai <type> AI assistant type (claude, cursor, windsurf, cline, all)
--type <type> Resource type to install (skill, rule, both)
--skills <names> Comma-separated list of specific skills
--rules <names> Comma-separated list of specific rules
--force Overwrite existing filesInteractive Mode (Recommended)
Run without options for a fully interactive experience:
schema-cli installInteractive prompts:
- Multi-select AI assistants (auto-detects installed ones)
- Multi-select resource types (skills/rules)
- Multi-select skills (all selected by default)
- Multi-select rules (all selected by default)
- Confirm force overwrite (No by default)
- Review summary and confirm installation
Example flow:
? Select AI assistants to install for:
◉ Claude Code (detected)
◯ Cursor
◉ Windsurf (detected)
◯ Cline
? What would you like to install:
◉ Skills
◉ Rules
? Select skills to install:
◉ schema
◉ code-detector
◯ form-developer
...
📋 Installation Summary:
AI Assistants: Claude Code, Windsurf
Skills: schema, code-detector
Rules: schema-rules
Force: No
? Proceed with installation? YesCommand Line Examples
# Interactive mode (recommended)
schema-cli install
# Install for specific AI
schema-cli install --ai claude
# Install only skills
schema-cli install --type skill
# Install specific skills
schema-cli install --skills schema,form-developer
# Install for all AI assistants
schema-cli install --ai all
# Force reinstall
schema-cli install --force
# Combine options
schema-cli install --ai cursor --skills schema --rules schema-ruleslist
List all available skills and rules.
schema-cli listupdate
Update installed skills and rules to the latest version.
schema-cli update [options]
Options:
--ai <type> AI assistant type to update
--type <type> Resource type to update (skill, rule, both)Examples:
# Update all resources
schema-cli update
# Update only for Claude
schema-cli update --ai claude
# Update only skills
schema-cli update --type skilldebug
Show debug information about repository paths (useful for troubleshooting).
schema-cli debugOutput:
🔍 Leeforge CLI Debug Information
Repository Paths:
Root: /path/to/leeforge_schema
Skills: /path/to/leeforge_schema/skills
Rules: /path/to/leeforge_schema/.claude/rules
Path Existence:
✓ Root directory exists
✓ Skills directory exists
✓ Rules directory exists
Current Working Directory:
/current/working/directory
CLI Location:
/path/to/cli/dist
✨ All paths are valid!🎯 Supported AI Assistants
| AI Assistant | Directory | Status |
|--------------|-----------|--------|
| Claude Code | .claude | ✅ Supported |
| Cursor | .cursor | ✅ Supported |
| Windsurf | .windsurf | ✅ Supported |
| Cline | .cline | ✅ Supported |
📦 Available Resources
Skills
| Skill | Description | |-------|-------------| | schema | Design, create, and validate entity schemas | | code-detector | Detect code patterns and issues | | form-developer | Develop forms based on schema | | table-developer | Create tables from schema | | backend-developer | Generate backend code |
Rules
| Rule | Description | |------|-------------| | schema-rules | Schema development workflow rules |
🏗️ Development
Setup
# Clone the repository
git clone https://github.com/leeforge/schema.git
cd schema/cli
# Install dependencies
npm install
# Build
npm run build
# Run tests
npm test
# Watch mode
npm run devProject Structure
cli/
├── src/
│ ├── commands/ # CLI commands
│ │ ├── install.ts
│ │ ├── list.ts
│ │ └── update.ts
│ ├── utils/ # Utility functions
│ │ ├── detect.ts # AI type detection
│ │ └── copy.ts # File operations
│ ├── types/ # TypeScript types
│ │ └── index.ts
│ └── index.ts # Entry point
├── tests/ # Unit tests
├── package.json
├── tsconfig.json
├── tsdown.config.ts # Build configuration
└── vitest.config.ts # Test configurationTesting
# Run all tests
npm test
# Run tests in watch mode
npm run test:watch
# Generate coverage report
npm run test:coverageBuild
This project uses tsdown for building.
# Build once
npm run build
# Build and watch
npm run dev
# Type check
npm run typecheck📝 How It Works
Detection: Automatically detects AI assistants in your project by looking for marker directories (
.claude,.cursor, etc.)Installation: Copies skills and rules from the repository to the appropriate directories in your project
Directory Structure:
your-project/ ├── .claude/ │ ├── skills/ │ │ ├── schema/ │ │ ├── form-developer/ │ │ └── ... │ └── rules/ │ └── skill-creator-rules/ ├── .cursor/ │ └── ... └── ...Force Mode: Use
--forceto overwrite existing files (useful for updates)
🔧 Configuration
The CLI requires no configuration. It automatically:
- Detects your AI assistant
- Creates necessary directories
- Copies resources from the repository
🤝 Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
📄 License
MIT © Leeforge Team
🔗 Links
Made with ❤️ by Leeforge Team
