@phx/create-phx-frontend-plugin (0.1.0)
Published 2026-06-11 13:16:16 +02:00 by marcel.reichelt
Installation
@phx:registry=npm install @phx/create-phx-frontend-plugin@0.1.0"@phx/create-phx-frontend-plugin": "0.1.0"About this package
create-phx-frontend-plugin
Scaffold a new PHX ERP frontend plugin — an Angular web component project based on the official PHX plugin template.
Prerequisites
- Node.js 18+
- Yarn Berry (recommended) or npm
- Access to the PHX npm registry (
@phxscope)
Configure your PHX npm token in ~/.yarnrc.yml (or .npmrc for npm):
npmScopes:
phx:
npmRegistryServer: "https://gitea.phx-erp.de/api/packages/PHXGMBH/npm/"
npmAuthToken: "<your-token>"
The CLI can also write a project-local .yarnrc.yml during scaffolding when prompted.
Quick start
# Yarn Berry — one-shot, no global install
yarn dlx @phx/create-phx-frontend-plugin my-orders-plugin
# Same create-* convention as npm
yarn create @phx/phx-frontend-plugin my-orders-plugin
# npm
npm create @phx/phx-frontend-plugin@latest
npx @phx/create-phx-frontend-plugin@latest my-orders-plugin
This creates a new directory (by default named after your project) with a ready-to-customize plugin project.
Non-interactive
yarn dlx @phx/create-phx-frontend-plugin my-orders-plugin --yes --install
yarn dlx @phx/create-phx-frontend-plugin \
-p acme-orders-plugin -t acme-orders \
--api-url http://localhost:3000/admin-api \
--ui-url https://localhost:4200 \
--api-key your-api-key
# npm equivalent
npx @phx/create-phx-frontend-plugin@latest my-orders-plugin --yes --install
Options
| Flag | Description |
|---|---|
-p, --project |
Project name (kebab-case) |
-t, --tag |
Custom element tag (must contain a hyphen) |
--api-url |
PHX API base URL (default: http://localhost:3000/admin-api) |
--ui-url |
PHX UI URL for deep links (default: https://localhost:4200) |
--api-key |
PHX user API key for environment.development.ts |
--install |
Run yarn install after scaffolding |
-y, --yes |
Skip prompts, use defaults |
-h, --help |
Show help |
Positional arguments: [project-name] [target-dir]
What it does
- Copies the official plugin template into the target directory
- Replaces placeholders (
__PROJECT_NAME__,__TAG_NAME__,__PHX_UI_URL__, etc.) - Creates
src/environments/environment.development.tsfrom the example - Optionally writes
.yarnrc.ymlwith your PHX npm token - Optionally runs
yarn install
After scaffolding, open the new project and follow its README to configure API keys and start development.
Dependencies
Dependencies
| ID | Version |
|---|---|
| @inquirer/prompts | ^7.5.0 |
| picocolors | ^1.1.1 |
Keywords
phx
phoenix
angular
plugin
scaffold
create-phx-frontend-plugin