You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -366,6 +367,118 @@ except VeryfiClientError as e:
366
367
367
368
---
368
369
370
+
## Command-line interface
371
+
372
+
Installing `veryfi` also installs a `veryfi` console script (and the equivalent `python -m veryfi`). The CLI is a thin wrapper around the Python `Client` and exposes every supported resource as a sub-command — designed for shell users and AI agents that drive the SDK from a terminal.
373
+
374
+
Verify the install:
375
+
376
+
```bash
377
+
veryfi --help
378
+
# or, equivalently:
379
+
python -m veryfi --help
380
+
```
381
+
382
+
### Authentication
383
+
384
+
Credentials are read from environment variables (preferred for agents) or equivalent flags:
You can also pipe binary file data via stdin by passing `--file -`:
434
+
435
+
```bash
436
+
curl -s https://cdn.example.com/r.jpg | veryfi documents process --file -
437
+
```
438
+
439
+
### Output and exit codes
440
+
441
+
Every command emits a JSON response on stdout. Use `--output raw` for single-line JSON (handy for piping into `jq`) or `--output pretty` for sorted keys. Errors are emitted as JSON on **stderr** and the process exits with a non-zero status:
442
+
443
+
| Exit code | Meaning |
444
+
|-----------|---------|
445
+
|`0`| Success |
446
+
|`2`| Missing credentials or invalid CLI arguments |
447
+
|`1`-`255`| Veryfi API error — exit code is the HTTP status (clipped to 255) |
448
+
|`70`| Unexpected error (treat as a bug) |
449
+
450
+
The exact HTTP status is always included in the stderr payload, e.g.:
451
+
452
+
```json
453
+
{
454
+
"error": "Document not found",
455
+
"status": 404,
456
+
"exception": "ResourceNotFound"
457
+
}
458
+
```
459
+
460
+
### Passing arbitrary fields
461
+
462
+
For endpoints that accept `**kwargs` (e.g. `update_document`, `add_line_item`, `update_check`), use repeatable `--field KEY=VALUE` flags or `--json-body '<json>'`. `--field` values are JSON-decoded when possible (so `total=11.23` becomes a number, `enabled=true` becomes a boolean, `data='{"a":1}'` becomes an object) and fall back to plain strings.
463
+
464
+
### Discovery
465
+
466
+
Every command at every level supports `--help`, which lists subcommands or options with their descriptions:
467
+
468
+
```bash
469
+
veryfi --help # top-level: lists all resource groups
veryfi documents process --help # leaf: lists every flag with its description
472
+
```
473
+
474
+
For AI agents and tooling that prefer a machine-readable contract, `veryfi schema` emits a JSON manifest of every command, its description, and every parameter (name, type, required, repeatable). Agents can ingest this once to register Veryfi as a tool surface without parsing `--help` text:
0 commit comments