Skip to content

CLI & project console

PAM is the only global executable an application needs. It discovers the nearest pam.json and routes the same short command to the active target, much like Artisan is the console for a Laravel application.

Terminal window
pam doctor --fix
pam dev
pam make:component ProfileCard
pam format
pam lint
pam test
pam build
pam package

Run pam without arguments for the guided launcher. Every command also has a stable non-interactive form for scripts and CI.

Group Commands
Project new, init, info, doctor
Develop dev, run, logs, devices, devtools, console, commands
Generate make:screen, make:component, make:native-view, Laravel make:*
Ecosystem packages, add, remove, outdated, composer, artisan
Quality format, lint, test, benchmark, profile
Ship build, sign, package, release
Runtime start, exec, inspect, routes, diagnostics, top
Tooling completion, editor:install, self-update, docs:generate

Explicit namespaces such as pam mobile ... and pam desktop ... expose the same operations for cross-project automation.

Command API Laravel PAM Native Desktop
pam dev PHP hot reload Laravel host device hot reload desktop host
pam console app command Tinker app command app command
pam make:* extension command Artisan generator screen/component/view extension command
pam format installed PHP formatter Pint .pam formatter installed PHP formatter
pam build production bundle production bundle APK desktop build
pam package archive + SHA-256 archive + SHA-256 signed APK/AAB platform package

Composer and Artisan keep their normal arguments, streams, and exit codes:

Terminal window
pam composer require vendor/package
pam artisan migrate
pam make:model Post --migration

Applications and Composer packages can register their own bounded commands. Inspect the resolved surface with pam commands; built-in names cannot be shadowed.

Terminal window
pam info --json
pam doctor --json
pam packages --json
pam commands --json

Automation must use the exit code and reject a JSON schema it does not understand. Generate shell completion with pam completion bash, zsh, fish, or powershell.

The contextual project console above may add generators and package commands. The core executable always provides these runtime operations:

Command Purpose
pam dev [script.php] Watch PHP, Composer, and environment files and restart on change.
pam start [script.php] Run a supervised multi-worker cluster with zero-downtime reloads.
pam exec <script.php> Execute one PHP script explicitly through PAM’s Embed SAPI.
pam artisan [args...] Run Laravel console work inside the Embed SAPI.
pam composer [args...] Run the embedded Composer toolchain.
pam test [path] Resolve and run Pest or PHPUnit inside PAM.
pam <script.php> [args...] Execute a PHP entry directly; if it registers a server, start serving it.
Terminal window
pam start public/index.php \
--workers 8 \
--max-requests 10000 \
--admin-address 127.0.0.1:3010 \
--admin-token-env PAM_ADMIN_TOKEN \
--graceful-timeout 30000 \
--startup-timeout 10000

Additional restart controls are --restart-backoff and --watchdog-grace, in milliseconds. Put script arguments after -- so they cannot be parsed as PAM options.

Command Output or action
pam doctor [path] Validate PHP, Composer, extension, and runtime compatibility.
pam inspect [index.php] Print resolved runtime capabilities as JSON.
pam routes [index.php] Print registered routes as JSON.
pam diagnostics [index.php] Print the complete bounded runtime snapshot.
pam heap Inspect heap and memory diagnostics.
pam fibers Inspect active fiber diagnostics.
pam connections Inspect runtime connection diagnostics.
pam profile Capture a runtime profiling report.
pam trace Capture trace diagnostics.
pam top [admin-url] Stream live metrics from the admin endpoint.
pam benchmark <url> Measure throughput and latency.

Examples:

Terminal window
pam diagnostics public/index.php
pam top http://127.0.0.1:3010

The focused diagnostics commands select one section of the same bounded snapshot. profile and trace enable their capture mode before booting the selected application entry.

Core Laravel commands run through pam artisan. The optional pushinbr/pam-laravel package registers its production commands with Artisan:

Terminal window
pam artisan pam:check-production
pam artisan pam:process status
pam artisan pam:health
pam artisan pam:deploy production

See the Laravel command reference. PAM 1.0 does not create unnamespaced aliases such as pam health or pam deploy; scripts must use the explicit pam artisan pam:* form.

Terminal window
pam init hello-api --template api
pam build --entry public/index.php --output dist
pam release --check
pam package --entry public/index.php --output artifacts
Command Contract
pam init [directory] Create raw, api, laravel, desktop, mobile, or mobile-ui.
pam build [directory] Produce a new self-contained bundle plus integrity manifest.
pam package Create the target-specific distributable and checksum.
pam release [--check] Run doctor, lint and tests; package unless check-only.
pam sign Validate Native release-signing configuration.
pam desktop <command> Route development, diagnosis, plugins, and packaging to Desktop.
pam mobile <command> Route prepare/dev/run/build/profile/plugins/runtime operations to Native.

pam build defaults to the current project and dist; it never needs a trailing .. Use a directory argument only for another project.

Terminal window
pam help start
pam help build
pam help package
pam --version

Focused help prints accepted options and runnable examples for the installed version. Scripts should prefer stable flags and exit codes over parsing the human-oriented root launcher.