Command-line interface for PostXL code generation framework
npm install @postxl/cliSmall command line tool that helps with the development of PXL projects.
Currently, the CLI provides the following commands:
- pxl generate: Generate code for a PXL project
- pxl create-project (alias: pxl new): Create a new PostXL project
pxl generateThe pxl generate command generates code for a PXL project.
In the project root, ensure that a project-schema.json and a generate.ts file exist. See the template project for an example.
``bash`
cd /projects/my-project
pxl generate
See pxl generate --help for more information.
/ pxl newThe pxl create-project command creates a new PostXL project with a selected schema template. It scaffolds the project structure, installs dependencies, runs the initial code generation, and generates the Prisma client.
Run the command from the PostXL repository root:
`bash`
pxl create-projector
pxl new
The CLI will interactively prompt you for:
1. Project name: The display name for your project
2. Project slug: A URL-friendly identifier (auto-suggested from the name)
3. Schema template: Choose from available starter schemas
4. Project location: Either a standalone project (outside the workspace) or a workspace project (in the projects/ folder)
| Option | Description |
| --------------------------- | ------------------------------------------- |
| -n, --name | Project name (skip interactive prompt) |-s, --slug
| | Project slug (skip interactive prompt) |--schema
| | Schema template to use |-p, --project-path
| | Custom path for the generated project |--skip-git
| | Skip initializing a git repository |--skip-generate
| | Skip running the initial project generation |
`bashInteractive mode
pxl new
See
pxl create-project --help` for more information.