hailsham-cli
v0.2.6
Published
CLI tool for installing Hailsham registry blocks
Maintainers
Readme
Hailsham CLI
Command-line tool for installing Hailsham registry blocks.
Installation
npm install -g hailsham-cliOr use directly with npx:
npx hailsham-cli install shared-utilsUsage
List available blocks
hailsham list
# or
hailsham ls
# Show detailed information
hailsham list --detailsInstall a block
hailsham install shared-utils
# Install to a specific directory
hailsham install lists-block --target ./my-project
# Dry run to see what would be installed
hailsham install calendar-block --dry-run
# Force overwrite existing files
hailsham install widgets-block --force
# Skip dependency installation
hailsham install games-block --skip-depsValidate block manifests
# Validate all blocks
hailsham validate
# Validate specific block
hailsham validate shared-utilsHow it works
- Manifest Loading: Reads the block's
index.jsonmanifest - Dependency Resolution: Resolves registry dependencies recursively
- File Copying: Copies files to appropriate target directories
- Import Rewriting: Updates relative imports to absolute paths
- Validation: Ensures all files are copied correctly
Target Directory Structure
Files are installed to different locations based on their type:
components/→<target>/components/<block-name>/lib/→<target>/lib/<block-name>/hooks/→<target>/hooks/<block-name>/api/→<target>/app/api/<block-name>/models/→<target>/models/<block-name>/types/→<target>/types/<block-name>/
Development
# Run in development mode
npm run dev
# Build for production
npm run build
# Run tests (when implemented)
npm testPhase 3 Implementation Status
- [x] Basic CLI structure
- [x] Command framework (install, list, validate)
- [x] Manifest loading and validation
- [x] Basic file copying
- [x] Dependency resolution
- [x] Import rewriting (basic)
- [ ] Advanced import rewriting
- [ ] API bridge generation
- [ ] Conflict resolution
- [ ] Progress reporting
- [ ] Test suite
- [ ] npm package publishing
