Skip to main content

nace-cli

nace — the Drex API from the shell: calibrated decisions and document jobs.

pipx install nace-cli    # or: uv tool install nace-cli
nace login               # paste a key from https://console.nace.ai/dashboard/api-keys

nace login checks the key against Drex before saving it to ~/.nace/config.toml (mode 0600). $NACE_API_KEY and $NACE_BASE_URL override the file; --api-key - reads the key from stdin for scripts. nace --version (or nace version) prints the CLI and SDK versions, and NACE_LOG_LEVEL=debug logs each request to stderr.

Decisions

nace decide --state "I was charged twice for my March invoice." \
  --noul "wants_refund=Is the customer asking for a refund?" \
  --choice "topic=billing,shipping,other: Which topic is it?" \
  --score "urgency=low,medium,high: How urgent is it?"
wants_refund  noul    0.930
topic         choice  billing (confidence 0.880)
urgency       score   1.400 on low < medium < high (confidence 0.500)

--state takes text, @file or - (stdin); a JSON object or array is sent as JSON. Richer questions go in --questions questions.json, or a whole request in --body. nace models lists the models; -m picks one. --json prints the response body, request_id included.

Documents

nace parse https://example.com/invoice.pdf > invoice.md
nace parse ./invoice.pdf --format markdown,text -p 1-3 --mode high
nace parse ./locked.pdf --password -          # reads the PDF password from stdin, hidden at a terminal
nace extract ./invoice.pdf --schema invoice.schema.json
nace extract job:<parse job id> --schema-id sch_... --schema-version 2
nace classify ./scan.pdf --class invoice:Invoice --class receipt:Receipt --granularity page
nace split ./batch.pdf --classes classes.json
nace ground ./invoice.pdf --target "total=Total due" --target "Net 30"

A SOURCE is one of:

  • an https:// URL. The document service picks the parser from the file name's extension, taken from the URL's last path segment; when the link doesn't end in one, name it with --file-name invoice.pdf;
  • a local file, uploaded into your workspace first at its file name (--upload-path picks another path). The same bytes again reuse the file there; an edited file fails with path_conflict: pass another --upload-path, or --on-conflict new_version to add a version (jobs on that file not yet started then read the new version);
  • ws:<workspace_id>/<file_id>, what nace upload prints;
  • job:<parse job id> to reuse a finished parse (not for classify, -p, --mode medium|high or --password).

-p/--pages and --mode apply to parse, split, classify and extract. --semantic (deprecated) asks Ground to match each target by meaning; on PDF, Word and PowerPoint those targets fail with semantic_mode_deprecated. Any other request field goes in --option key=value (dotted keys nest, JSON values parse) or --options request.json; flags win over both, and the source always comes from SOURCE.

Each command waits for the job and prints Markdown for a parse, the result JSON otherwise. For a document too large to return inline, nace parse fetches the full Markdown instead of the preview; when it can't, it prints the preview, names the nace file command that fetches the rest, and exits 1. -o json prints the whole job, -o result only the result, -o id the job id; --save PATH writes it to a file. --async prints the job id and returns at once; --watch streams progress to stderr; --wait-seconds N asks Drex to hold the create up to 60 s; --wait-timeout bounds the client-side wait (default 600 s).

Uploads

nace upload ./invoice.pdf --path invoices/2026/invoice.pdf --on-conflict new_version
nace upload-grant --path inbox/scan.pdf --max-bytes 10000000   # a one-use upload token for another client
nace upload-session --path big.csv --total-size-bytes 734003200

nace upload DIR uploads every file under a folder, keeping its path inside the folder under --path (default: the folder's name), -j at a time (default 8). Hidden files and folders are left out, and a file the document service refuses as unsupported_file_type is skipped: stderr lists them when the run ends. --ingest (with --workspace) then ingests what was uploaded, 1000 files per ingestion. upload-grant and upload-session print JSON for another client to upload with: the CLI doesn't send parts or complete a session itself, and nace upload (or a local-file SOURCE) does every step for you.

Jobs and their files

nace jobs --operation parse --status succeeded --limit 50 --cursor <next_cursor>
nace job <id> --wait                      # --watch implies --wait
nace events <id>                          # progress, one JSON object per line
nace job-request <id>                     # the request the job ran under
nace file <id> <document.content_url>     # full Markdown, saved as <id>.md
nace file <id> parse-images/<ref> --save figure-1.png
nace rows <id> <rows_url> --all > sheet.tsv
nace cancel <id>

nace file saves any file a job produced, waiting for Markdown still being prepared. Without --save it goes in the current directory as <id>.md for a document's Markdown, else <id>-<kind>-<digest> with the file's extension. --link prints a stored file's five-minute signed link instead.

Saved extraction schemas

nace schema-create Invoice --schema invoice.schema.json
nace schema-version-add sch_... --schema invoice-v2.schema.json
nace schemas --all
nace schema-versions sch_...              # oldest first
nace schema sch_... > invoice.schema.json # the JSON Schema itself; --json for the whole record
nace schema-version sch_... 1
nace workspace-create fy25-audit
nace workspace-use <workspace_id>          # later commands use it; --workspace ID or $NACE_WORKSPACE_ID win
nace upload ./report.pdf --workspace <workspace_id> --path reports/2025/report.pdf
nace upload ./fy25 --workspace <workspace_id> --ingest   # every file under a folder, 8 at a time, then ingested
nace ingest --path-prefix reports/         # makes the files searchable
nace workspace-files --status failed
nace search "What were total liabilities at year end?"
nace qa "What was total freight spend in FY2024?"   # stderr: session <id>; follow up with --session

search and qa print the answer as the ndi CLI did: the answer, evidences (N): with each evidence as 1. path, page N and its quote indented under it, then the Ground jobs to poll, the tables the answer refers to and any catalog rows; the route goes to stderr. Lists (jobs, workspaces, workspace-files) print a <what> (N): header, an indented line per item and next: <cursor> when more pages follow. Uploads go to a workspace only with --workspace; without it, to the server. nace workspace-delete takes the workspace only from --workspace.

Domains

A domain is the two-level taxonomy (group and subgroup classes) a workspace classifies its files against. Nace provides some; your account can author its own. A draft is edited in place and published once; a published or Nace-provided domain is frozen, so duplicate it and edit the copy.

nace domains list --owner platform --status published   # domains (N):, then <domain_id>  <slug>  v<n>  <status>  <owner>  <display_name>
nace domains get --id <domain_id>                       # the domain's line, then its classes
nace domains create --slug leases --display-name "Lease files" --taxonomy leases.taxonomy.json   # --taxonomy: JSON, @FILE or -
nace domains update --id <domain_id> --display-name "Leases"
nace domains publish --id <domain_id>                   # one-way; a taxonomy that fails validation exits 1 and lists each error
nace domains duplicate --id <domain_id>                 # a draft copy of any domain you see
nace workspace-create fy25-leases --domain leases  # a published domain's slug; it can't be changed later

Output and exit codes

Stdout carries the payload and stderr the status, so nace parse doc.pdf > doc.md captures only the document. A wait that runs out prints the job id on stdout. Exit 0 on success, 1 on an API or job failure (including an ingestion that failed a file, from nace ingest, nace upload --ingest or nace job) (the message names the error type, code, request id and up to five fields that failed validation), 2 on a usage or configuration error.

Requests are retried up to twice on a 408, 429, 5xx, dropped connection or timeout, but only while the retry can start within 30 s of the first attempt, so a request that fails after 30 s, such as one that hit --timeout (120 s) or a slow 529, is not retried. schema-create, schema-version-add, workspace-create, domains create, domains publish and domains duplicate are never retried.

Full guide: https://console.nace.ai/docs/developer-tools/cli (install, sign-in, decide, documents, uploads, jobs, schemas, workspaces, search, exit codes).

License

MIT

Metadata

Release files for nace-cli 0.4.0

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

Source distribution (sdist)

Source distribution for nace-cli 0.4.0
File Size Uploaded Provenance Actions
nace_cli-0.4.0.tar.gz 54.1 kB With provenance Details for nace_cli-0.4.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for nace-cli 0.4.0
File Interpreter ABI Platform Actions
nace_cli-0.4.0-py3-none-any.whl Python 3 none any Details for nace_cli-0.4.0-py3-none-any.whl

Total release size: 118.0 kB

Release files / nace_cli-0.4.0.tar.gz

Download URL nace_cli-0.4.0.tar.gz
Size 54.1 kB
Tags Source
SHA-256 checksum
How to use checksums
84f1ac1399bc24293cc46db9066134b00833e44a7dda0f40d4c83a4fd85b7805
BLAKE2b-256 checksum
How to use checksums
dabf2c3cdb6d29a489f2a3789f88add313359a52a55bb5c37dcc0aefa0a799f5
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 Oct 29, 2026.

Transparency log

Release files / nace_cli-0.4.0-py3-none-any.whl

Download URL nace_cli-0.4.0-py3-none-any.whl
Size 63.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1737398a718e8b56414aef43396d6bf3b213dfaa04c465a89d5dbcc99288e808
BLAKE2b-256 checksum
How to use checksums
f98f03917c6cae3b88a2bf56249b8fdc1263e07dc530ac5b0a3221676300914e
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 Oct 29, 2026.

Transparency log

Security for nace-cli 0.4.0

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 nace_cli-0.4.0.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 Oct 29, 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