Prisma PHP CLI

A complete reference for scaffolding projects, managing dependencies, generating framework classes, and updating Prisma PHP safely across local, CI, and AI-driven workflows.

Create Project

Scaffold a new application using the interactive wizard or pass flags for a custom setup.

Terminal
npx create-prisma-php-app@latest my-app

Installation Flags

Flag Description
--tailwindcss Installs Tailwind CSS v4, PostCSS, and configures the globals.css entry point.
--typescript Adds TypeScript support with Vite, including tsconfig.json and type definitions.
--docker Generates a production-ready Dockerfile and docker-compose.yml.
--websocket Scaffolds a Ratchet WebSocket server located at src/Lib/Websocket.
--mcp Initializes a Model Context Protocol server for building AI agents and automation workflows.
--backend-only Skips all frontend assets (CSS and JS) and view layouts. Ideal for pure APIs.
--swagger-docs Sets up Swagger UI and OpenAPI specification generation tools.

Starter Kits

Instead of manually selecting flags, use a Starter Kit to pre-configure your environment for specific use cases.

Full-Stack (Default)

Includes Tailwind, Prisma, and frontend assets.

npx create-prisma-php-app my-app --starter-kit=fullstack
REST API

Docker + Swagger. No frontend.

npx create-prisma-php-app my-api --starter-kit=api
Real-Time

WebSockets + MCP + Tailwind.

npx create-prisma-php-app my-chat --starter-kit=realtime
Custom Source

Install from any Git repository.

npx create-prisma-php-app my-tool --starter-kit=custom --starter-kit-source=...

Generate Classes

Automatically generate strict PHP classes based on your prisma/schema.prisma definition.

Terminal
npx ppo generate

Update Project

Use the update command to refresh your Prisma PHP project with the latest core files, templates, and framework-managed project structure. This is the recommended command when you want to sync your application with upstream Prisma PHP changes after enabling or adjusting features in prisma-php.json.

Warning: File Overwrites

Executing npx pp update project downloads the latest framework core and applies project updates. By default, this can overwrite framework-managed files such as config files, templates, and entry points.

To preserve your custom work, configure the excludeFiles array in prisma-php.json before running the update.

Interactive Update

Runs the standard update flow. Use this when you want the CLI to ask for confirmation before applying changes. This is useful during manual local development when you want to review the update process step by step.

Terminal
npx pp update project

Best for

Manual upgrades, reviewing changes locally, and cases where you want CLI confirmation prompts before overwriting managed files.

Non-Interactive Update

Use the -y flag to update the project without prompts. This runs the command in non-interactive mode, automatically accepting the update flow instead of waiting for confirmation dialogs.

Terminal
npx pp update project -y

What -y does

  • Skips confirmation prompts during the update process.
  • Makes the command suitable for scripted workflows where no manual input is available.
  • Helps AI agents, CI pipelines, deployment scripts, and automation tools run updates reliably.

When to use npx pp update project -y

The non-interactive mode is especially useful in environments where prompts would block execution. For example, if you are running Prisma PHP updates inside an automated setup script, a remote provisioning flow, a container build step, or an AI-managed coding workflow, the -y flag ensures the command continues without waiting for user input.

This is also the recommended option for AI agents and automation because those environments usually expect deterministic command execution. Instead of pausing for confirmations, the CLI applies the update immediately using the current project configuration.

Recommended workflow before updating

1. Review prisma-php.json

Enable or disable framework-managed features first so the update command knows which project files to apply.

2. Protect custom files

Add files you do not want overwritten to excludeFiles before running the update.

3. Choose the correct mode

Use the standard command for manual confirmation, or use -y for non-interactive execution.

4. Review your changes

After updating, inspect the modified files and commit the result so your upgrade path stays traceable and safe.

Update command reference

Command Behavior Recommended use case
npx pp update project Standard interactive update flow with confirmation prompts. Local development and manual upgrades.
npx pp update project -y Non-interactive update that skips prompts and proceeds automatically. CI, deployment scripts, AI agents, and automation pipelines.

Configuration

The prisma-php.json file controls how the CLI interacts with your project.

prisma-php.json
{
  "projectName": "my-app",
  "version": "1.0.0",
  "tailwindcss": true,
  "excludeFiles": [
    ".env",
    "./prisma/schema.prisma",
    "./prisma/seed.ts",
    "./src/app/globals.css",
    "./src/app/index.php",
    "./src/app/layout.php",
    ".gitignore"
  ]
}

excludeFiles Strategy

The example above protects your environment variables, database schema, and primary UI entry points from being reset during a framework update. Remove a line only if you intentionally want that file to be replaced by the framework default.

Note: excluding a file prevents it from being overwritten, but it also means you will not automatically receive future core changes for that file. To apply upstream fixes later, remove it from excludeFiles and run the update again, or merge the changes manually.