@inpolicy/cli
v0.1.1
Published
Command-line interface for InPolicy — manage policies and documents from the shell, GitOps pipelines, and CI.
Readme
@inpolicy/cli
Command-line interface for InPolicy — manage policies and documents from the shell, GitOps pipelines, and CI.
Install
npm install -g @inpolicy/cli
# or run on-demand without installing globally:
npx @inpolicy/cli policies listAuth
Set an API key from app.inpolicy.ai → Settings → API Keys:
export INPOLICY_API_KEY=inp_live_...Override the API base for self-hosted backends:
export INPOLICY_API_URL=https://api.acme.internal/api/v1Commands
All commands live under inpolicy policies.
inpolicy policies sync <dir>
Sync a directory of markdown policy files (YAML frontmatter for externalId, title, severity, enforcement, etc.) to InPolicy. Idempotent — re-running with no changes is a no-op. Designed for GitOps: commit the directory and run sync from CI on every push.
inpolicy policies sync ./policies/inpolicy policies upload <file> [--mode stage|draft|publish]
Upload a document (PDF / DOCX / TXT / MD) for AI extraction. Returns a documentId and polls until processing completes.
inpolicy policies upload ./security-handbook.pdf --mode draftinpolicy policies list [--status PUBLISHED] [--tag <tag>] [--limit 50]
List policies for the authenticated tenant.
inpolicy policies list --status PUBLISHED --limit 100inpolicy policies get <id|external:externalId>
Fetch one policy.
inpolicy policies get external:data-classification/v1inpolicy policies publish <id|external:externalId>
Promote a DRAFT or SUGGESTION to PUBLISHED.
inpolicy policies publish external:data-classification/v1Required API key scopes
policies:read— list, get, sync (no-op runs)policies:write— sync, bulk upsertpolicies:publish— sync withpublish: true,publishcommanddocuments:write—upload
Exit codes
0— success1— error (message printed to stderr)
License
MIT
