Skip to content

The PAM CLI

pam is the only global executable a PAM application needs. It runs PHP scripts, starts servers and clusters, runs Composer and your test suite, generates code, builds bundles and operates applications in production. If you know Laravel, think of it as Artisan, PHP’s CLI and a process manager in one binary.

This page is a tour. Every command, option and output format is listed in the CLI Reference, and the installed binary is always the final authority:

Terminal window
pam --help # the grouped command overview
pam help start # focused help with options and examples
pam --version # pam 2.2.27

Because PAM does not put a php executable on your PATH, you run PHP through pam. The flags you know from PHP’s CLI work the same way:

Terminal window
pam script.php arg1 arg2 # run a script; if it calls listen(), serve it
pam exec script.php # run a script explicitly
pam -r 'echo PHP_VERSION, PHP_EOL;' # run inline code
pam -d memory_limit=256M script.php # set a php.ini directive
pam -c config/php.ini script.php # use another php.ini
pam -n script.php # ignore php.ini and conf.d

Inside a project, pam -r and scripts see the project’s vendor/autoload.php, so pam -r 'var_dump(class_exists(Nimbus\App::class));' prints bool(true).

pam --help groups commands by what you are doing:

Group Commands Use them to
Runtime dev, start, exec, composer, extensions, test, up, plan, apply, ps, logs, monit Run applications in development and production.
Observe doctor, inspect, routes, diagnostics, support, heap, fibers, connections, profile, trace, top, dashboard, monit:history, benchmark Look inside a running or booting application.
Project new, init, info, packages, add, remove, make:*, format, lint, outdated, commands, editor:install Create and maintain a project.
Ship build, package, sign, release, production certify, distribution:verify, distribution:sign, desktop, mobile Produce and verify release artifacts.

The machine-readable catalog (pam catalog --json) also lists the process-manager and release commands that the overview folds together, such as status, describe, reload, restart, stop, delete, scale, deploy, deploy:remote, rollback and the traffic:* family.

Terminal window
pam dev index.php # one process, restarts on PHP, composer.json, composer.lock or .env changes
pam test # PHPUnit or Pest, inside PAM's PHP
pam test --filter GreetingTest # runner arguments pass through
pam routes index.php # registered routes as JSON
Terminal window
pam start index.php --workers 8 --admin-address 127.0.0.1:3010 # supervised cluster in the foreground
pam up index.php --name api --workers 8 # detached, managed by pamd
pam ps # list managed applications
pam logs api --follow # follow their logs
pam reload api # zero-downtime reload

See Clustering and Process Management.

pam composer runs a verified Composer PHAR inside PAM’s embedded PHP. Arguments, output and exit codes are Composer’s own:

Terminal window
pam composer require pushinbr/nimbus
pam composer install --no-dev --optimize-autoloader
pam composer test

pam packages lists the project’s direct requirements, and pam outdated shows available updates. See Composer Integration.

PAM looks for the nearest pam.json from the current directory. That file tells it what kind of project you are in, and the same short command does the right thing for each kind. You never need to pass the current directory: pam build, pam doctor and pam test all default to it. Pass a path only to target another project.

pam info describes the active project:

Terminal window
pam info
PAM / PROJECT
────────────────────────────────────────────────────────────
Type API
Root /home/alice/hello-api
Manifest pam.json
PAM 2.2.27
Name hello-api
Version 0.1.0
DEVELOPMENT
Artifacts 205 B across 2 files
Dev budget 8.0 GiB · state code 1
NEXT
pam doctor
pam dev
pam test
pam build
Command API / web Laravel PAM Native PAM Desktop
pam dev Hot-reloading server Laravel host Device hot reload Desktop host
pam make:* Built-in API generators Registered commands Screens, components, native views Registered commands
pam build Production bundle Production bundle Native build Desktop build

In API and web projects, make:* commands create source files from templates and never overwrite existing ones:

Terminal window
pam make:controller ProductController # app/Controllers/ProductController.php
pam make:request StoreProductRequest # app/Requests/StoreProductRequest.php
pam make:resource ProductResource # app/Resources/ProductResource.php
pam make:model Product # app/Models/Product.php
pam make:migration CreateProducts # database/migrations/<timestamp>_0_0_default_create_products.php
pam make:factory ProductFactory # database/factories/ProductFactory.php
pam make:seeder ProductSeeder # database/seeders/ProductSeeder.php
pam make:service ProductService # app/Services/ProductService.php
pam make:repository ProductRepository # app/Repositories/ProductRepository.php
pam make:job SendInvoice # app/Jobs/SendInvoice.php
pam make:test ProductTest # tests/ProductTest.php
pam make:admin Product # app/Admin/ProductAdmin.php
pam make:view products.index # resources/views/products/index.nim.php

Names must start with an uppercase letter and use only ASCII letters and digits. In other project kinds, make:* runs a command registered in pam.json, or a package-provided one; PAM Native generators come from pushinbr/pam-native.

List the commands your application and its packages add with pam commands. You can declare your own in pam.json:

pam.json
{
"commands": {
"greet": {
"script": "scripts/greet.php",
"description": "Print a greeting"
}
}
}
Terminal window
pam commands
pam greet Alice
greet Print a greeting
Hello from a project command: Alice

Package Commands explains the rules, including how Composer packages register commands and which names they cannot shadow.

pam format runs the formatter the project has installed: pam-native-format, Laravel Pint, PHP-CS-Fixer or PHPCBF, in that order. pam lint runs the formatter in check mode, composer validate --strict, and PHPStan when vendor/bin/phpstan exists.

Terminal window
pam format app routes.php tests # format these paths
pam format --check app routes.php tests # report without changing files
pam lint

Most inspection commands accept --json and emit a versioned document with a schema or schemaVersion field:

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

Put --json-errors before the command to receive failures as a JSON document on standard output instead of the colored message:

Terminal window
pam --json-errors deploi
{
"errorCode": 1,
"exitCode": 66,
"message": "cannot open deploi: No such file or directory (os error 2)",
"remediation": "check that the path exists and points to the intended file",
"schema": 1,
"verificationCommand": "pam doctor"
}

Human-readable errors carry a stable code, a fix and a verification command:

× ERROR [PAM-E005] completion requires bash, zsh, fish, or powershell
Fix: run `pam --help` or `pam help <command>` for valid usage
Verify: pam --help

Automation should rely on exit codes and reject a schema version it does not understand. The Error Codes reference lists every PAM-E### code. Disable colors with NO_COLOR=1 or PAM_COLOR=never.

Terminal window
pam completion bash > ~/.local/share/bash-completion/completions/pam
pam completion zsh
pam completion fish
pam completion powershell

Completions include your project commands, because they call pam commands --names at completion time.

pam editor:install vscode, neovim or helix installs or prints PAM language support for your editor.

Terminal window
pam self-update --check
pam self-update

See Installation for signed updates and downgrades.