Skip to content
Phylax
Tools & interfaces

Phylax CLI

Use the command line to verify artifacts, inspect attestations, and automate trust checks.

  1. Install

    Terminal window
    npm install -g @phyi/cli
    Terminal window
    phylax --version
  2. Authenticate

    Verification needs a token on a paid plan. The token is written to ~/.config/phylax/config.json with owner-only permissions, and PHYLAX_API_TOKEN overrides it, which is what CI should use.

    Terminal window
    phylax auth login
    phylax whoami
  3. Common commands

    CommandDescriptionExample
    verifyVerify an artifact and inspect the result.phylax verify pkg:npm/express@4.18.2
    attestationsList attestations for an artifact.phylax attestations pkg:npm/express@4.18.2
    searchSearch the registry for artifacts.phylax search express
    policy evaluateEvaluate an artifact against a policy.phylax policy evaluate prod-policy pkg:npm/express@4.18.2
    repoVerify every dependency the lockfiles in a directory install.phylax repo .
  4. Quick example

    Verify an npm package and read a human-readable summary.

    Terminal window
    phylax verify pkg:npm/express@4.18.2
    verdict:
    allow
    risk score:
    low
    provenance:
    verified
    attestations:
    3 available
  5. JSON output

    Use --json for machine-readable output. Every command supports it, and the shape is stable across releases.

    Terminal window
    phylax verify pkg:npm/express@4.18.2 --json
    {
    "ok": true,
    "verdict": "allow",
    "artifact": "pkg:npm/express@4.18.2",
    "riskScore": "low",
    "provenance": "verified",
    "attestations": { "count": 3, "available": true }
    }

    Pipe it into anything that reads JSON:

    Terminal window
    phylax verify pkg:npm/express@4.18.2 --json | jq -r '.verdict'

Exit codes

The CLI is designed to gate a build, so the exit code carries the verdict. Nothing else needs to parse the output to make a pass/fail decision.

CodeMeaning
0ALLOW. Nothing found that warrants blocking.
1BLOCK. A policy or a finding failed the artifact.
2WARN, when run with --strict. Otherwise WARN exits 0.
3The artifact could not be resolved, or no attestation exists.

Artifact references

Every command that takes an artifact accepts a package URL, bare or fully qualified:

Terminal window
phylax verify npm/express@4.18.2
phylax verify pkg:npm/express@4.18.2
phylax verify pkg:pypi/requests@2.32.3

Global flags

FlagEffect
--jsonMachine-readable output.
--strictTreat WARN as a failure.
--fail-on <verdict>Set the verdict that fails the command.
--offlineUse cached data and local attestations only.
--debugVerbose diagnostics, including the requests made.

Wire this into a pipeline with CI/CD Pipelines, or call the same checks over HTTP with the REST API.

Did this page help you?