Skip to content

CLI Reference

This page lists every command of the pam binary and its options. It is generated from the CLI’s own command catalog (pam catalog --json), its focused help (pam help <command>) and the argument parsers in the PAM source, and was checked against PAM 2.2.27.

Two commands are always the fastest way to explore from a terminal:

Terminal window
pam --help
pam help start

For a guided tour of the CLI, read The PAM CLI. Commands that a Composer package adds to your project (for example pam desktop, pam mobile, pam run or pam sign) are listed by pam commands inside that project.

pam <command> [options]
pam --json-errors <command> [options]
pam <script.php> [arguments...]
pam -r <code> [arguments...]
Form Description
pam In an interactive terminal, opens the launcher; otherwise prints the usage
pam --help, pam -h Print the command overview
pam help <command> Focused help and examples for one command
pam --version, pam -V Print the installed version (pam 2.2.27)
pam script.php [args...] Run a PHP script, like php script.php
pam exec script.php [args...] Run a PHP script explicitly (for names that collide with commands)
pam -r 'code' [args...] Run inline PHP code
pam -f script.php Run a script (PHP CLI style)
pam - Read the script from standard input (up to 64 MiB)
pam -d name=value ... Set an INI directive (repeatable; also --define and -dname=value)
pam -c path/php.ini ... Use another php.ini (PHPRC)
pam -n ... Skip php.ini discovery, like php -n
pam --json-errors <command> Print failures as a JSON envelope (same as PAM_ERROR_FORMAT=json)
Terminal window
pam -d memory_limit=512M -r 'echo ini_get("memory_limit"), PHP_EOL;'

Errors print a stable code, a fix and a verification command; see Error Codes. Color is automatic in terminals; NO_COLOR=1 or PAM_COLOR=never disables it.

pam dev [script.php] [arguments...]

Start the contextual development session: watches files and reloads the application. The script defaults to index.php. In a PAM Desktop or PAM Native project, pam dev starts that platform’s development session instead. Generated development artifacts are kept under a size budget (PAM_DEV_ARTIFACT_BUDGET_BYTES, default 8 GiB).

pam start [script.php] [options] [-- script arguments...]

Run a supervised multi-worker cluster in the foreground. See Clustering.

Option Default Description
--workers N available CPUs Worker processes (maximum 256)
--max-requests N 10000000 Recycle a worker after N requests
--task-workers N|auto 0 Background workers for tasks and ticks (maximum 64)
--php-extension NAME — Repeatable isolated PHP extension allowlist
--isolate-php-extensions off Isolate even when the allowlist is empty
--admin-address IP:PORT off Expose the health and metrics control plane
--graceful-timeout MS 15000 Worker shutdown deadline
--startup-timeout MS 30000 Worker readiness deadline
--restart-backoff MS 100 Initial crash restart delay
--watchdog-grace MS 250 Hard request-deadline grace period
--ingress-address IP:PORT — Pool ingress address (required with --pool)
--pool NAME=N@PREFIX[,PREFIX] — Dedicated worker pool by path prefix (repeatable)
--state-file PATH — Write the master state JSON

PAM_ADMIN_TOKEN or PAM_ADMIN_TOKEN_FILE is required for a non-loopback --admin-address.

Terminal window
pam start index.php --workers 8 --admin-address 127.0.0.1:3010
pam exec <script.php> [arguments...]

Execute a PHP script explicitly.

pam composer [composer arguments...]

Run the embedded Composer toolchain with PAM’s PHP. Use it instead of a system composer:

Terminal window
pam composer require pushinbr/nimbus
pam composer install --no-dev --classmap-authoritative
pam composer audit --locked

PAM_COMPOSER points PAM at another composer.phar.

pam extensions [path] [--no-dev] [--json | --toml]

Derive an explainable PHP extension profile from the locked Composer requirements.

Option Description
--no-dev Exclude root and locked development requirements
--json Emit a versioned, explainable profile
--toml Emit a copy-ready pinned pam.toml profile
pam test [path] [options] [runner arguments...]

Run Pest or PHPUnit inside PAM. Runner arguments are passed through.

Option Description
--pest Force the Pest runner
--phpunit Force the PHPUnit runner
Terminal window
pam test --pest --filter RuntimeTest
pam up [script.php] [options] [-- application arguments...]

Start and detach a managed, health-supervised application. See Process Management for every option: --name, --workers, --max-requests, --task-workers, --php-extension, --isolate-php-extensions, --env-file, --attach, --json, --shutdown-timeout-ms, --health-check-url, --health-check-interval-ms, --health-check-timeout-ms, --health-check-start-period-ms, --health-check-failures, --no-autorestart, --restart-delay-ms, --restart-backoff-max-ms, --max-unstable-restarts, --min-uptime-ms, --log-max-bytes, --log-retain, --memory-warning-bytes, --task-warning-count, --memory-max-bytes, --task-max-count.

pam ps [--json]
pam status <name> [--json]
pam describe <name> [--json]

List managed applications, print one application’s state, or print its full JSON record.

pam logs <name> [options]
Option Default Description
--lines N 100 Lines to show
--errors — Standard error instead of standard output
--both — Both streams
--follow, -f — Keep streaming
--query TEXT — Filter lines (1 to 256 characters)
--include-rotated — Search rotated files too
--json — Structured entries
pam reload <name> [--json]
pam restart <name> [--json]
pam stop <name> [--json]
pam delete <name> [--json]

Reload without downtime (SIGHUP), restart, stop gracefully, or forget a stopped application.

pam scale <name> <workers> [--json]

Change a managed application’s worker count (1 to 256) and restart it.

pam save [--json]
pam resurrect [--json]

Save the list of managed applications and their desired state; restore the saved list.

pam startup [--print | --install]

Print (default) or install ~/.config/systemd/user/pamd.service, which runs the process manager at login or boot.

pam daemon start|status|stop

Manage the per-user pamd supervisor. status exits with 1 when the daemon is stopped.

pam plan [pam.toml] [--json]
pam apply [pam.toml] [--json]
pam config:check [pam.toml] [--json]

Preview, reconcile or validate the applications declared in pam.toml. See Declarative Deploys.

pam deploy <name> <release-directory> [--json]
pam deploy:history <name> [--json]
pam rollback <name> [--steps N] [--json]

Activate a readiness-gated release, inspect the last 50 release events, or roll back N releases (default 1).

pam deploy:remote [user@host] [options]

Ship the application to a server over ssh and rsync and activate it.

Option Default Description
--init — Create shared/.env and install pam-NAME.service
--path DIR pam-apps/NAME Release root on the server
--name NAME pam.json name Process-manager name
--workers N — Workers of the first pam up
--health-check-url URL — Readiness URL of the first pam up
--keep N 5 Releases kept on the server
--pam PATH pam The pam executable on the server
--dry-run — Print the ssh and rsync commands only
pam traffic:start <name> --listen IP:PORT --stable IP:PORT [--candidate IP:PORT] [--weight-bps N]
[--deadline-seconds N] [--tls-cert FILE --tls-key FILE] [--json]
pam traffic:set <name> [--candidate IP:PORT] [--weight-bps N] [--deadline-seconds N] [--json]
pam traffic:evaluate <name> --min-candidate-requests N --max-candidate-error-bps N [--json]
pam traffic:status <name> [--json]
pam traffic:promote <name> [--json]
pam traffic:abort <name> [--json]
pam traffic:stop <name> [--json]

Run a weighted release ingress between a stable and a candidate address. Weights and error rates are basis points (0 to 10000). --deadline-seconds is 1 to 604800 (default 300).

pam cache:purge [--tag=TAG[,TAG]]... [--url=URL]... [--all] [--log=PATH]

Purge the edge page cache of a running application by tag, URL (a trailing * purges a prefix) or everything. The invalidation log defaults to $PAM_CACHE_INVALIDATION_LOG.

pam doctor [path] [options]

Validate PHP, Composer and runtime compatibility, or repair the active project.

Option Description
--fix Apply safe repairs (create pam.json, install locked dependencies)
--ci Disable interactive and color output
--json Emit a stable structured diagnostic envelope (not with --fix)
--schema Print the embedded JSON Schema of the report
--validate FILE Validate a saved report offline
pam info [--json]

Describe the current project and the active toolchain.

pam inspect [index.php]
pam routes [index.php]

Print runtime capabilities, or the registered routes, as JSON.

pam diagnostics, heap, fibers, connections

Section titled “pam diagnostics, heap, fibers, connections”
pam diagnostics [index.php]
pam heap [index.php]
pam fibers [index.php]
pam connections [index.php]

Boot the application with diagnostics enabled and print the complete runtime snapshot, or only its memory, Fiber or connection section.

pam profile [index.php]
pam trace [index.php]

Capture profiling data (PAM_PROFILE=1) or trace diagnostics (PAM_TRACE=1).

pam timeline <snapshot.json|-> [--output PATH]

Export a bounded performance timeline from a diagnostics snapshot:

Terminal window
pam diagnostics index.php > snapshot.json
pam timeline snapshot.json --output timeline.json
pam top [admin-url] [options]

Stream live metrics from a control plane (default http://127.0.0.1:3010).

Option Default Description
--iterations N 10 Number of samples
--interval-ms N 1000 Delay between samples
--lag-warn-ms N 10 Highlight worker lag at or above N (1 to 60000)
--json — One versioned NDJSON object per sample
pam monit [--json]
pam monit:history [name] [--limit N] [--record] [--json]

Show managed process health and capacity, or the bounded resource history (up to 120 samples).

pam dashboard [output.html | --output FILE.html]
pam dashboard:start --token-file FILE [--listen 127.0.0.1:PORT] [--json]
pam dashboard:status [--json]
pam dashboard:stop [--json]

Write a private HTML health dashboard (default pam-dashboard.html), or operate the authenticated local live dashboard (default 127.0.0.1:9615, loopback only).

pam support [path] [options]

Create a bounded, redacted support report.

Option Description
--output FILE.json Write once, with private permissions, instead of standard output
--manager Include process-manager state
pam benchmark <url> [--requests N] [--concurrency N]

Measure throughput and latency. Defaults: 100 requests, concurrency 10.

pam new
pam init [directory] [options]

Create a project interactively (new) or from a preset (init).

Option Description
--template PRESET raw, api, web, laravel, desktop, native, native-ui or product
--socket Add PAM Socket support
--name NAME Human-readable mobile application name
--application-id ID Mobile bundle or application identifier
--starter PRESET blank, tabs, auth, ecommerce, chat or showcase
--platform TARGET android, ios, android-tv, all, or a comma list
--no-install Create files without installing packages
--no-interaction Use api when no preset is supplied
Terminal window
pam init my-api --template api
pam packages [--json]
pam add <capability>
pam remove <capability>
pam add target <android|ios|android-tv|tizen|webos>
pam remove target <name>
pam outdated [--all]

Explore official capabilities and the project’s direct Composer requirements, add or remove a capability (legacy aliases for pam composer require/remove), change the targets of a PAM Native app, or list available dependency updates (--all includes transitive ones).

pam make:<generator> <Name>

Generate project-native source files. In an API (Nimbus) project: make:model, make:controller, make:request, make:resource, make:service, make:repository, make:factory, make:seeder, make:job, make:test, make:admin, make:migration and make:view. Other project types get their generators from their packages.

Terminal window
pam make:controller ProductController
pam format [paths...] [--check]
pam lint
pam views:check [views directory] [component namespace]

Format project source (default path src; --check only reports), run the formatting and static-analysis gates, or compile every Nimbus view and report file:line errors.

pam commands [--json | --names]

List application and package commands registered in the current project.

pam editor:install [vscode|neovim|helix] [--force]

Install or print PAM language-editor integration. --force replaces an existing VS Code extension.

pam clean [path] [--dry-run] [--all] [--json]

Remove bounded development artifacts. --dry-run measures without deleting; --all also removes generated hosts and the Cargo target.

pam build [directory] [--entry FILE] [--output DIR]

Build a self-contained production bundle. --entry defaults to index.php, --output to dist. See Security & Bundle Integrity.

pam package [--entry FILE] [--output DIR]

Create a versioned tar.gz and .sha256 for a server project (default output dist). Product workspaces build a cross-surface release manifest; Native and Desktop projects use their packages’ packagers.

pam release [--check]
pam release:verify [manifest]

Run every local release gate (doctor --ci, lint, test, sign for Native, then package); --check stops before packaging. release:verify verifies a Product release manifest offline (default dist/product-release.json).

pam production certify [options]

Run the product-specific production certification suite. Requires a project that provides a production:certify command (installed by pushinbr/pam-native).

pam distribution:verify <manifest.json> [--json]
pam distribution:sign <draft.json> --key <private-key> --output <manifest.json>
pam distribution:desktop-report [options]

Verify signed clean-host evidence offline, sign a validated draft with an Ed25519 seed, or bind native Desktop trust proofs to an installer.

Provided by the PAM Desktop and PAM Native packages once installed in the project. See PAM Desktop and PAM Native.

pam self-update [vMAJOR.MINOR.PATCH] [--check] [--allow-downgrade]

Install the latest (or a specific) cryptographically authorized release. --check verifies and reports a newer release; --allow-downgrade authorizes one explicit older version.

pam catalog --json
pam catalog --schema
pam catalog --compat-schema
pam catalog --validate FILE [--json]
pam catalog --compat BASELINE CANDIDATE [--json]

Discover the versioned, machine-readable CLI contract, its JSON Schemas, validate a saved catalog, or reject breaking catalog changes between two versions.

pam completion bash|zsh|fish|powershell

Print a shell completion script. It includes the project’s own commands:

Terminal window
pam completion bash > ~/.local/share/bash-completion/completions/pam
pam docs:generate [path] [--check]

Write the Markdown command list (default docs/cli-reference.md); --check fails when the file is out of date.

Inside a PAM project, pam <name> also runs commands registered by the project in pam.json (commands) and by installed packages. List them with pam commands; see Package Commands.