Skip to main content

ndi-cli

Looking for NDI (Nace Document Intelligence)? Outside developers should start at Nace Console and its documentation, using nace-sdk, nace-cli, or nace-mcp. Console keys (nace_sk_...) use Authorization: Bearer at https://console.nace.ai; they do not work at ndi-api.nace.ai.

The examples below cover direct NDI service access with separately provisioned ndi_sk_... credentials and the ndi-* packages.

ndi — the NDI platform CLI. Document operations, jobs, and workspace lifecycle wrap the same /v1 methods as ndi-sdk. ask-file also runs inside an agent sandbox, next to the file commands only an agent run has; every other verb is refused there.

Setup

ndi login                                          # browser device-code; writes ~/.ndi/config.toml
export NDI_BASE_URL="https://ndi-api.nace.ai"      # optional; default shown
export NDI_WORKSPACE_ID="<workspace uuid>"         # or: ndi workspace use <id>

$NDI_API_KEY still wins over the file. $NDI_CONFIG_PATH overrides the config location. Workspace-scoped verbs also take --workspace ID.

Commands

Command Use
ndi login Authorize and save the API key
ndi version CLI + SDK versions
ndi upload FILE Stage bytes; prints ndi://upload/<id>
ndi upload-delete UPLOAD_ID Delete an unused upload; used uploads require deleting their jobs first
ndi parse SOURCE Markdown / text / blocks
ndi extract SOURCE -s SCHEMA Structured extract (--validate checks a schema with no job)
ndi split SOURCE --class id:label Logical sections
ndi classify SOURCE --class id:label Labels (refuses jobid://)
ndi ground SOURCE --target id=TEXT Locate quoted text (after search, poll any grounding_job_ids; when none are planned, use ndi ground explicitly)
ndi job ID / ndi jobs / ndi cancel ID Inspect or cancel jobs
ndi workspace create|list|get|stats|delete|use Workspace lifecycle
ndi workspace global-context [--set TEXT|--file PATH|--clear] Show, replace, or remove (--clear) the background every query without --context runs with; --no-context on a query runs with none
ndi files upload|list|get|delete Workspace files (a directory walks nested files; --ingest then queues ingestion)
ndi ingest Queue ingestion
ndi automatic-search QUERY Service answers with fact search or an agent over files, tables and the catalog (--mode fact|agent skips the routing step, --path scopes it to files); prints the route, the output job id, and the answer (plus the catalog table when there is one)
ndi filtered-search --cursor CURSOR Page a catalog table past its first rows. A new filtered-search QUERY is deprecated: use automatic-search
ndi je-testing QUERY Journal-entry testing over a ledger package (--path to scope it, --reasoning-effort for the thinking budget)
ndi ledger-understanding start|get|sources|select|selection Measure the ledger package, confirm sources, or read the latest report
ndi locate NEED The pages and table tabs that hold a piece of information, printed as NDI's own search agent reads them (it prints its locate id first: pass --locate-id to later locates and reads for the question, and what that id already showed or read is left out; --prefix/--path scope it; --all lists every file of a kind; also runs as ndi-locate)
ndi read-file PATH The text of one file (--pages, --component, --lines A-B to scope it), as NDI's own search agent reads it (--locate-id records the read under a locate id)
ndi run-sql SQL One read-only SELECT over the workspace's tables; its res_… handle is a table in the next statement
ndi folder-metadata [DIR ...] A folder's file counts, categories, subfolders and one page of its files, as NDI's own search agent sees it (--names-only prints every path, one per line)
ndi catalog [SQL] The typed fields ingestion extracted from every document, as tables: without SQL their list, with SQL one read-only SELECT over them (no job, no credits)
ndi ask-file PATH QUESTION Cited answer over one document, image or recording
ndi systemone --state TEXT --questions JSON Answer noul, choice and score questions about a state in one call, no workspace (--state-json for a JSON state; any value may be @FILE or @-)

Sources

SOURCE for document ops:

  • local file — uploaded, then the handle is used
  • directory — supported files, one job each (-j N, default 4)
  • https://... — fetched by the server
  • ndi://upload/<uuid> — a prior ndi upload
  • jobid://<uuid> or a bare UUID — reuse a parse job (not classify)
  • ws://<file_id> — a workspace file (needs a workspace)
  • - — a jobid:// / UUID line, or raw bytes with --file-name
ndi parse a.pdf -o id | ndi extract - -s schema.json
ndi files upload ./corpus --ingest
ndi ledger-understanding start          # --force to re-scan; --selection-id after confirm
ndi ledger-understanding get
ndi ledger-understanding sources --review-reading-id READING
ndi ledger-understanding select --primary SRC --supporting SRC --revision REV

ndi files upload DIR keeps relative paths under --path (default: the directory name) and uploads in parallel (-j, default 8). Unsupported files (and .DS_Store) are skipped; a warning on stderr lists them when the run finishes. --ingest then queues ingestion in batches of 1000 file ids. A single file still requires --path.

Output

Result content goes to stdout; status (job <id> queued, saved …) goes to stderr. -o auto|md|json|payload|id picks the shape. --json is an alias for -o json.

The default (auto) prints the full JSON response. When that is over $NDI_OUTPUT_LIMIT characters (default 400,000), the compact text rendering prints instead and stderr carries note: output shortened … with the full size. --json always prints it whole, and --save / --out-dir always write it whole. Commands whose output is the content itself (ws context, parse markdown) print it as before. --save PATH / --out-dir DIR write files. --async submits and prints the job id.

When a Parse result has external complete content, -o auto and -o md print the inline preview. Use -o json or -o payload to inspect its disclosure and authenticated full-content URL. A final-size preview carries content_truncated; reduced-layout Office parsing carries parse_fidelity. Documents use document.content_url; workbooks use the affected document.spreadsheet.sheets[].content_url. The CLI does not download these URLs automatically.

API failures exit 1. Usage / config errors exit 2. Schema-validation failures also show up to five field constraints, each limited to 500 characters; request input and unrelated error-detail fields are omitted. Unsupported inputs print error: 422 [unsupported_file_type] ... to stderr and exit 1. ndi upload prints no handle, document operations print no job ID, and ndi files upload --ingest creates no workspace file or ingestion job. The server checks a bounded byte prefix, rejects conclusive filename/content conflicts, and treats the multipart Content-Type as advisory.

See the CLI guide for the full command reference. SKILL.md is the agent-facing guide to reading a workspace with ndi.

To select existing customer storage, run ndi storage-connections list, then ndi workspace create "Customer workspace" --storage-connection CONNECTION_ID. Customer storage is not generally available; disabled deployments return not_implemented for every connection operation (including storage-connections list) and for creating a workspace with a connection, retries included; enabled deployments with incomplete configuration return storage_unavailable. Set up connections and rotate credentials through the console or Python/TypeScript SDK. The CLI does not accept cloud secrets as command-line arguments.

Metadata

Release files for ndi-cli 0.30.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ndi-cli 0.30.1
File Size Uploaded Provenance Actions
ndi_cli-0.30.1.tar.gz 62.3 kB With provenance Details for ndi_cli-0.30.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for ndi-cli 0.30.1
File Interpreter ABI Platform Actions
ndi_cli-0.30.1-py3-none-any.whl Python 3 none any Details for ndi_cli-0.30.1-py3-none-any.whl

Total release size: 131.7 kB

Release files / ndi_cli-0.30.1.tar.gz

Download URL ndi_cli-0.30.1.tar.gz
Size 62.3 kB
Tags Source
SHA-256 checksum
How to use checksums
bf9f12e3ae010b330f6eafcf838c8b226d5711694d032db9802e5b1243c23117
BLAKE2b-256 checksum
How to use checksums
47fbd053850ab59a9912e0a4c88f78cb17c0effccaff91e95c50c33838c10b17
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 9, 2026.

Transparency log

Release files / ndi_cli-0.30.1-py3-none-any.whl

Download URL ndi_cli-0.30.1-py3-none-any.whl
Size 69.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
bb21c2db153918c97f66e3d7fcf1a1e175716648631a4312998da0d81efb6201
BLAKE2b-256 checksum
How to use checksums
faae50806e72ffddd572ff7b38a5d983e55741049b8d84432b7e1c5addcf5a46
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 9, 2026.

Transparency log

Security for ndi-cli 0.30.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for ndi_cli-0.30.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 9, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page