# @nyrra/prismantix-cli

The public PrismantiX ontology catalog and client-record CLI. The package installs one executable: `prismantix`.

```sh
npm install --global @nyrra/prismantix-cli
export PRISMANTIX_API_KEY="sk_..."

prismantix ontology list
prismantix object list healthcare
prismantix object details deviations
prismantix records pull --client NVO
prismantix records generate --client NVO --ontology pharma
prismantix records status <operation-id>
prismantix records cancel <operation-id>
```

Every command supports `--json`. JSON mode reserves stdout for one result; progress and diagnostics go to stderr. `--api-base` overrides `PRISMANTIX_API_BASE`, whose default is `https://api.prismantix.com`.

`records generate` waits for completion by default with a 30-minute timeout. Use `--no-wait`, `--timeout`, and `--poll-interval` for operational control. A completed operation exits 0. A failed operation or an operation canceled while this command is waiting exits 1 with a typed error; an explicitly acknowledged `records cancel` request exits 0.

`records pull` creates and waits for a CSV-bundle export, then writes `manifest.json` and its files under `./prismantix-exports/<canonical-client-id>/<export-id>/`. Use `--output`, repeatable `--table`, `--timeout`, and `--poll-interval` when needed.

## Restricted Foundry plugin

Foundry import is intentionally not bundled with the anonymous public CLI. Authorized Shpitdev operators install the restricted plugin explicitly:

```sh
npm login --scope=@shpitdev --registry=https://registry.npmjs.org
prismantix plugins install @shpitdev/prismantix-ontology-interop
prismantix foundry import --help
```

CI must use an npm token scoped to read restricted `@shpitdev` packages. Never commit a populated user `.npmrc`.
