# @okrapdf/cli

The okraPDF command line: upload PDFs, pull grounded context with bbox citations, run parse jobs, extract structured data, and query collections — built for agents first (JSON envelopes with `next_actions` whenever stdout is not a TTY).

```bash
npm install -g @okrapdf/cli
okra auth login
```

## Primary workflows

```bash
okra upload ./report.pdf                  # add --no-wait to queue; resume with okra jobs wait
okra documents read doc-abc123 --pages 1-3
okra chat "Summarize this document" --doc doc-abc123
```

## Grounded context (agent loop)

```bash
okra context structure doc-abc123
okra context get "termination clause" --source-id doc-abc123
okra context ask "What is the guaranteed fee?" --source-id doc-abc123
okra parse doc-abc123 --engine mineru     # reparse, then: okra jobs wait doc-abc123
```

Context responses are token-bounded and cited: every snippet carries `page`, a deterministic page-image `citation_url`, and the matched node's `bbox` (`bbox_source: "node"`). `structure`/`resolve` report `pages_parsed` / `page_coverage` so a partial parse is never silent.

## More

```bash
okra extract ./report.pdf --schema ./schema.json
okra render ./report.py --out report.pdf
okra collections query earnings "What changed quarter over quarter?" -o earnings.csv
okra resources list                       # discover every API noun and verb
```

Run `okra --help` for the full surface, including the self-host runtime (`okra self-host --help`).

## Library

Importing okraPDF from code? Use [`@okrapdf/sdk`](https://www.npmjs.com/package/@okrapdf/sdk) — this package is just the `okra` binary over it. The legacy unscoped `okrapdf` package is deprecated.

## Agent skill

Teach a coding agent the cited-context loop:

```bash
npx skills add okrapdf/okra-agent
```
