@hyperse/hps
v0.1.2
Published
Next-generation CLI for the Hyperse (HPS) ecosystem. It orchestrates plugins for development, build, deployment, updates, and diagnostics with a consistent developer experience.
Readme
HPS CLI
Next-generation CLI for the Hyperse (HPS) ecosystem. It orchestrates plugins for development, build, deployment, updates, and diagnostics with a consistent developer experience.
Features
- Plugin Architecture: Modular commands via first-party plugins
- Zero-Config Defaults: Sensible defaults with override capability
- Typed Config: Strongly-typed config via
defineConfig - Multi-Environment: Works across development and production
- Helpful Output: Clear logs, errors, and timing info
Installation
# npm
npm install @hyperse/hps
# yarn
yarn add @hyperse/hps
# pnpm
pnpm add @hyperse/hpsQuick Start
import { cli, defineConfig } from '@hyperse/hps';
export default defineConfig((env) => ({
projectCwd: process.cwd(),
devServer: {
port: 3000,
},
}));
// run in terminal
// npx hps --helpCommands
The CLI bundles these commands via plugins:
hps info— Show banner, CLI, system, and Hyperse dependency versionshps serve evolve— Start dev server (Rspack), with mocks supporthps build evolve— Build for production (Rspack)hps mock— Run standalone mock serverhps deploy— Deploy static assets to supported providershps update— Update workspace package dependencies
Use hps --help or <command> --help for detailed usage.
Configuration
HPS reads hps.config.ts (or .js) and provides a typed defineConfig helper.
import { defineConfig } from '@hyperse/hps';
export default defineConfig((env) => ({
projectCwd: process.cwd(),
resolve: env.resolve,
devServer: {
https: true,
mockOptions: {
mockFilters: ['.*'],
},
},
}));Type-Safe Context
The defineConfig helper infers the CLI command contexts so IDEs can provide autocomplete and type checking.
Built-in Plugins
HPS integrates first-party plugins out of the box:
@hyperse/hps-plugin-info@hyperse/hps-plugin-serve@hyperse/hps-plugin-build@hyperse/hps-plugin-mock@hyperse/hps-plugin-deploy@hyperse/hps-plugin-update
Plus helpful middleware:
@hyperse/wizard-plugin-help@hyperse/wizard-plugin-version@hyperse/wizard-plugin-error@hyperse/wizard-plugin-loader(auto-load community plugins by patternhps-plugin-*)
Programmatic Usage
import { cli } from '@hyperse/hps';
// start the CLI
cli.parse(process.argv);Node Requirements
- Node.js >= 20
License
This project is licensed under the GPLv3 LICENSE.
