@oinone/cli
v7.2.9
Published
CLI tool to generate Oinone Frontend Template
Readme
Oinone Frontend CLI
CLI scaffolding tool to generate Oinone frontend projects.
- Package:
@oinone/cli - Binary:
oinone-frontend - 中文文档: README_zh-CN.md
Features
- Interactive project scaffolding with sensible defaults
- Non-interactive (CI-friendly) mode via CLI options
- Optional enterprise registry credential file generation
- Static resource cache management via
cache - Environment check via
doctor
Requirements
- Node.js to run the CLI
- pnpm (default) or npm for installing dependencies in the generated project
- Pre-flight requirements for Oinone 7.2+ projects: Node >= 22, lerna 9.0.3, rimraf 6.1.2, pnpm 9 (when building with pnpm) — the CLI offers auto-fix or manual installation when versions mismatch
Installation
npm install -g @oinone/cliOr run with npx:
npx @oinone/cli create my-projectUsage
Quick create (recommended)
oinone-frontend create my-project --oinone-version 7.2.0 --edition communityoinone-frontend create my-project-enterprise --oinone-version 7.2.0 --edition enterprise --auth-token <token> --write-project-credentialMore examples
Create project (interactive):
oinone-frontend createCreate project (non-interactive):
oinone-frontend create my-project --oinone-version 7.2.0 --edition communityCreate project with --company-name / --project-name:
oinone-frontend create --company-name ss --project-name oms --oinone-version 7.2.0 --edition communityChoose the build tool (default pnpm):
oinone-frontend create my-project --oinone-version 7.2.0 --edition community --build-tool npmDry-run (no files written):
oinone-frontend create my-project --oinone-version 7.2.0 --edition community --dry-runCreate project (Oinone 6.4.*):
oinone-frontend create my-project-64 --oinone-version 6.4.0 --edition communityCheck environment
oinone-frontend doctor --oinone-version 7.2.0Command reference
Global options
| Option | Description |
| --- | --- |
| -l, --lang <lang> | Language (zh-CN or en-US) |
| -v, --version | Print version |
| -h, --help | Show help |
oinone-frontend create [projectName]
| Option | Description |
| --- | --- |
| --company-name <name> | Company/organization name (silent mode) |
| --project-name <name> | Project name (silent mode) |
| --download-static-resource <boolean> | Download static resources (true/false) |
| --build-tool <tool> | Build tool for the generated project (pnpm/npm, default pnpm; Oinone 6.4.* supports pnpm only) |
| -o, --oinone-version <version> | Oinone version (e.g. 7.2.0, 6.4.0) |
| -e, --edition <edition> | Edition (community, enterprise) |
| --auth-token <token> | Enterprise registry auth token (optional) |
| --write-project-credential | Write .npmrc into the project and auto-add to .gitignore |
| -f, --force | Overwrite/merge into existing directory |
| -d, --dry-run | Dry-run (no files written) |
oinone-frontend doctor
| Option | Description |
| --- | --- |
| -o, --oinone-version <version> | Oinone version to validate against (6.4.* or 7.2+) |
oinone-frontend cache
| Command | Description |
| --- | --- |
| cache info | Print cache directory information |
| cache clean | Clean cached static resources |
Enterprise credentials
When --write-project-credential is enabled for enterprise edition, the CLI writes .npmrc into the project directory and appends it to .gitignore.
Template mapping
6.4.*→template-6.4.07.2+→template-7.2.0
Unsupported versions fail fast.
Notes
Uninstalling the CLI does not remove cached static resources. To clean the cache:
oinone-frontend cache cleanDevelopment
npm test