@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
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.
.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, includingphosra_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_Xfor 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.
What each check does
Machine-readable output (for CI)
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.
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).
PHOSRA_DID + your seed into .phosra.env (add it to .gitignore).
phosra link write (provider)
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:- Environment variables (e.g.
PHOSRA_CENSUS_URL=...) .phosra.envfile in the current working directory- Baked-in production sandbox defaults (the values
phosra initwrites)
phosra doctor against an
explicit census URL (still the canonical sandbox host; shown here only to demonstrate the
override precedence):
Troubleshooting
Next
- Provider quickstart —
@phosra/linkconnect ceremony and rule writes - Platform quickstart —
@phosra/gatekeeperprofile read and local enforcement - Billing — what triggers an invoice