Skip to main content
@phosra/cli is the fastest path to a green setup check. It wires automatically to the production sandbox — the stable, partner-facing testing endpoint with 16 seeded trust-list entries, a pre-seeded child policy, and zero new backend required. No config needed out of the box.

Install

Verify installation:

Step 1 — phosra init

Scaffold a .phosra.env in your current directory. Pass --role provider for a parental-controls integration or --role platform for a content-app integration.
Output:
The written .phosra.env is wired to the production sandbox — the stable testing endpoint — with the shared did:ocss:household-acme parent persona (a deterministic test key, safe for sandbox use). Add .phosra.env to your .gitignore — it contains a test seed. Config keys written: https://phosra-api-sandbox-production.up.railway.app is the one canonical sandbox host — the stable, partner-facing testing endpoint every Phosra doc, example, and SDK default points at (why one host). Phosra runs a separate internal pre-release census for its own integration testing; it is not a partner surface and is deliberately never named in these docs. Point at the canonical host and stay there. To override for the live accredited network (real production traffic), replace PHOSRA_CENSUS_URL, PHOSRA_TRUST_ROOT_X, PHOSRA_HOUSEHOLD_SEED, and set PHOSRA_TEST_KEYS=0. Two different credentials, two different paths — don’t conflate them:
  • Your phosra_ management/API key is fully self-serve — sign up and mint it yourself, including phosra_live_ keys, with no email to anyone. See Create your account & get keys.
  • Live accredited census access (the real PHOSRA_CENSUS_URL + PHOSRA_TRUST_ROOT_X for production enforcement traffic, plus a production Trust List entry) is gated on OCSS accreditation, an external governance step — apply here. The sandbox above needs neither.

Step 2 — phosra doctor

Verify the full setup end-to-end. Runs five checks in order, exits 0 if all pass.
Sample output (all green):

What each check does

Machine-readable output (for CI)

Returns a JSON object:
Exits 1 on any "status": "fail". "warn" is non-fatal (e.g. caps doc not yet published on the target census).

Step 3 — phosra caps

Fetch, verify, and pretty-print the capabilities document — the self-describing 123-rule catalog that the census publishes and signs.
Sample output:
phosra caps --json outputs the full structured document for downstream tooling.

Additional commands

phosra register (cold-party self-registration — sandbox)

The quickstart above uses the shared did:ocss:household-acme test persona. To onboard your own identity, phosra register generates a fresh Ed25519 DID, self-registers it on the sandbox census as a provisional Trust List entry, and proves a green verifiable round-trip — no pre-existing credential, no email. This is the CLI form of the self-register documented in the Provider quickstart (POST /api/v1/advisors/self-register).
Sandbox only — the census rejects self-registration in production; the production Trust List is populated through OCSS accreditation. Writes PHOSRA_DID + your seed into .phosra.env (add it to .gitignore). Write a signed rule directive via @phosra/link. Requires PHOSRA_DATABASE_URL for the grant store and an active grant ID from the connect ceremony.

phosra gatekeeper check (platform)

Refresh the enforcement profile and run isAllowed() for a rule category. Requires PHOSRA_ENDPOINT_ID.
--confirm applied|degraded|refused emits a §8.3.8 enforcement-confirmation receipt.

Config priority

Config resolves in this order — higher priority wins:
  1. Environment variables (e.g. PHOSRA_CENSUS_URL=...)
  2. .phosra.env file in the current working directory
  3. Baked-in production sandbox defaults (the values phosra init writes)
Override any single value without touching the file — e.g. run phosra doctor against an explicit census URL (still the canonical sandbox host; shown here only to demonstrate the override precedence):

Troubleshooting


Next