Home / Docs / CLI Reference

CLI Reference

Complete reference for the ppe command-line tool. All commands, options, and usage examples.

Global Options

These options are available for all commands:

Option Description
--help, -h Display help for the command
--version, -V Display version information
--quiet, -q Suppress non-essential output
--verbose, -v Increase output verbosity

license:generate

Generate a new license file for encrypting PHP applications.

license:generate

Creates a cryptographically signed license file with specified constraints.

ppe license:generate [options]

Options

--licensee=NAME Required. Name of the license holder (customer name, company, etc.)
--output=FILE Output file path. Defaults to license.ppe
--hostname=HOST Bind license to a specific hostname
--ip=ADDRESS Bind license to a specific IP address
--mac=ADDRESS Bind license to a specific MAC address (format: XX:XX:XX:XX:XX:XX)
--expires=DATE License expiration date. Accepts absolute (YYYY-MM-DD) or relative (+30d, +1y) formats
--not-before=DATE License is not valid before this date (YYYY-MM-DD)
--validate-url=URL URL for online license validation
--validate-grace=DURATION Grace period if validation server is unreachable (e.g., 24h, 7d)
--meta=KEY:VALUE Add custom metadata (can be used multiple times)
--id=IDENTIFIER Custom license identifier (auto-generated if not provided)

Examples

bash
# Basic development license
ppe license:generate --licensee="Dev Team"

# Production license with hardware binding
ppe license:generate \
    --licensee="Acme Corp" \
    --hostname=app.acme.com \
    --expires=+1y \
    --output=acme-prod.ppe

# Trial license
ppe license:generate \
    --licensee="Trial User" \
    --expires=+14d \
    --meta="trial:true" \
    --output=trial.ppe

# Enterprise license with online validation
ppe license:generate \
    --licensee="Enterprise Inc" \
    --hostname=ent.example.com \
    --validate-url=https://licenses.myapp.com/validate \
    --validate-grace=24h \
    --meta="plan:enterprise" \
    --meta="seats:100" \
    --output=enterprise.ppe

encrypt

Encrypt PHP files using a license file.

encrypt

Encrypts all PHP files in the source directory and outputs to the destination directory.

ppe encrypt [options] <source> <destination>

Arguments

source Required. Source directory containing PHP files to encrypt
destination Required. Output directory for encrypted files

Options

--license=FILE Required. Path to the license file
--exclude=PATTERN Exclude files matching pattern (glob syntax, can be used multiple times)
--include-vendor Also encrypt files in the vendor directory (excluded by default)
--compress Compress files before encryption (reduces size but slightly slower)
--no-runtime Don't copy the runtime to the destination (use if already present)
--runtime-path=PATH Custom path for the runtime file relative to encrypted files
--clean Remove destination directory before encrypting
--dry-run Show what would be encrypted without actually encrypting

Examples

bash
# Basic encryption
ppe encrypt --license=prod.ppe src/ dist/

# Exclude test files and config
ppe encrypt \
    --license=prod.ppe \
    --exclude="tests/*" \
    --exclude="config/*.php" \
    src/ \
    dist/

# Encrypt with compression
ppe encrypt \
    --license=prod.ppe \
    --compress \
    --clean \
    src/ \
    dist/

# Preview without encrypting
ppe encrypt \
    --license=prod.ppe \
    --dry-run \
    src/ \
    dist/

verify

Verify a license file or encrypted files.

verify

Validates license signatures, checks constraints, and optionally tests encrypted files.

ppe verify [options] <path>

Arguments

path Path to a license file (.ppe) or directory of encrypted files

Options

--license=FILE License file to use when verifying encrypted files
--test-decrypt Actually decrypt files to verify they work (requires license)
--show-meta Display license metadata
--json Output results in JSON format

Examples

bash
# Verify a license file
ppe verify customer.ppe

# Verify with metadata display
ppe verify --show-meta customer.ppe

# Verify encrypted files with a license
ppe verify --license=customer.ppe --test-decrypt dist/

# Get JSON output for scripting
ppe verify --json customer.ppe

Output

text
$ ppe verify --show-meta customer.ppe

License: customer.ppe
Status: VALID

Details:
  ID:         lic_abc123def456
  Licensee:   Acme Corp
  Created:    2025-01-15 10:30:00 UTC
  Expires:    2026-01-15 00:00:00 UTC

Constraints:
  Hostname:   app.acme.com
  IP:         (not set)
  MAC:        (not set)

Metadata:
  plan:       professional
  max_users:  50

Signature: VALID (ECDSA P-256)

license:info

Display detailed information about a license file.

license:info

Shows all license details without performing validation.

ppe license:info <license-file>

license:revoke

Generate a revocation record for online validation systems.

license:revoke

Creates a revocation entry that your validation server can use to reject a license.

ppe license:revoke [options] <license-file>

Options

--reason=TEXT Reason for revocation
--output=FILE Output file for revocation record (JSON format)

Exit Codes

The CLI uses standard exit codes:

Code Meaning
0 Success
1 General error
2 Invalid arguments or options
3 License validation failed
4 Encryption/decryption error
5 File not found