@kouovo/ph-cli
v0.1.46
Published
A command-line interface tool for generating Pug resources manifests and locale files.
Readme
@kouovo/ph-cli
A command-line interface tool for generating Pug resources manifests and locale files.
Overview
The @kouovo/ph-cli package provides an interactive CLI tool that helps developers generate Pug template resources and locale files for their projects. It uses the @clack/prompts library for an intuitive interactive experience.
Installation
npm install -g @kouovo/ph-cli
# or
pnpm add -g @kouovo/ph-cli
# or
yarn global add @kouovo/ph-cliUsage
Run the CLI tool using the binary name:
ovoThe tool will interactively prompt you for:
- Resources path - Where your resources are located (default:
./src/assets) - Locales path - Where your locale files are located (default:
./locales) - Resources output path - Where to generate the Pug resources manifest (default:
./src/_gen.pug) - Locales output path - Where to generate the locale files (default:
./src/locales)
Features
- Interactive prompts with validation
- Path validation using built-in heuristics
- Parallel generation of resources and locales
- Progress indicators and success/error feedback
- Graceful error handling and cancellation
Path Validation
The CLI includes intelligent path validation that:
- Detects various path formats (Unix, Windows, relative)
- Validates common path separators (
/,\) - Recognizes relative path indicators (
./,../) - Handles Windows drive letters (
C:\,D:/) - Filters out URLs and invalid strings
Dependencies
@clack/prompts- Interactive command-line prompts@kouovo/ph-shared- Shared utilities for resource and locale generation
Scripts
cli- Run the CLI toolbuild- Build the TypeScript sourcetypecheck- Run TypeScript type checkingbumpp- Bump version numbersrelease- Publish the package
License
MIT
