CLI
CLI reference
The scop binary — encode PHP projects, inspect licenses, and check loader availability from the terminal or CI.
Pre-release surface. The commands below are the provisional pre-1.0
scopCLI — shape is stable, flag names may still change before v1.0. Pin the version you build against and check the changelog for breaking notes.
The scop CLI ships alongside the native desktop encoder. Same
encoder core, headless interface — built for CI/CD pipelines and release
automation where a GUI doesn’t fit.
Four commands cover the surface:
scop encode <path> -o <out> [options]
scop license inspect <file>
scop doctor
scop version
scop encode
Encode a PHP project into a protected, non-readable build. The workhorse of the CLI — equivalent to clicking Encode in the desktop app.
scop encode ./src -o ./dist \
--php 8.3 \
--domain acme.example.com \
--expires 2027-06-04 \
--machine 4b1c-9f2e-aa17 \
--exclude 'vendor/**'
| Flag | Default | What it does |
|---|---|---|
| (positional) | — | Path to the PHP project to encode. |
-o, --out | — | Output directory for the protected build. Must not exist or must be empty. |
--php | host version | Target PHP version (e.g. 8.2, 8.3). Encodes for that runtime. |
--domain | — | Lock the protected build to a hostname. Multiple --domain flags allowed. |
--expires | — | License expiry date (YYYY-MM-DD). License stops working after that. |
--machine | — | Hardware fingerprint to lock to a specific server. |
--exclude | — | Glob pattern of files to leave untouched. Repeatable. |
The protected build is written to --out along with the license file. Both
travel together to the customer’s server.
scop license inspect
Read a license file and print its bindings — domain, expiry, machine, signing key fingerprint. Useful when a customer reports “the license isn’t working” and you need to see what was actually issued.
scop license inspect ./dist/license.lic
Output is human-readable by default; pass --format json for tooling.
scop doctor
Check whether the SourceCop loader is available on the current host, what version it is, and whether the PHP build can run protected code at all. Run this on a customer’s server when diagnosing a deployment.
scop doctor
Reports: PHP version, loader presence + version, supported encode targets, and any host-specific issues (missing extension, mismatched ABI, etc.).
scop version
Print the scop binary version and the encoder core version it bundles.
scop version
Pin this in CI when reproducibility matters — release artifacts produced with different encoder versions are not byte-identical.
Last updated 2026-06-04.