Skip to main content

nace-cli

nace — the Drex API from the shell: calibrated decisions and document jobs. Docs: https://console.nace.ai/docs

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 asks Ground to match each target by meaning: the text describes what to find. On deployments that ground PDF, Word and PowerPoint sources with the exact-match runtime, the answering sentences, table cells, lines, blocks, sections or table rows come back. 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

A code agent can also search the workspace itself with the navigate tools, following the drex-search skill:

nace skill install --agent claude-code     # drex-search and drex-workspace; also codex, cursor, pi, hermes
nace locate "total liabilities at year end"   # the pages and tables that hold it, each with the read-file call that opens it
nace read-file reports/2025/report.pdf --pages 41
nace run-sql "SELECT ..."                  # table names come from locate
nace folder-metadata reports               # file counts, categories and subfolders, without reading the files
nace catalog                               # the fields ingestion extracted per document; pass a SELECT to query them

search and qa print 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, with no total retry budget, so a request that failed after a long wait, such as one that hit --timeout (120 s) or a slow 529, is retried too and the command can take several minutes. 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, navigate tools, agent skills, exit codes).

License

MIT

Custom and on-prem servers

Set NACE_API_KEY and NACE_BASE_URL=https://nace.customer.example in the process using the CLI or MCP server; no login or profile is required. Environment values take precedence over saved configuration. Alternatively, nace login --base-url https://nace.customer.example --api-key - < key.txt validates and saves the key and actual server URL for both tools. For unattended profile use, mount a mode-0600 file and set NACE_CONFIG_PATH to it.

Metadata

Release files for nace-cli 0.5.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.5.0
File Size Uploaded Provenance Actions
nace_cli-0.5.0.tar.gz 74.0 kB With provenance Details for nace_cli-0.5.0.tar.gz

Built distribution (wheel)

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

Total release size: 160.2 kB

Release files / nace_cli-0.5.0.tar.gz

Download URL nace_cli-0.5.0.tar.gz
Size 74.0 kB
Tags Source
SHA-256 checksum
How to use checksums
384c78c913983c06db232567f4fd845727ab94bbbaa9876930049bccecab747d
BLAKE2b-256 checksum
How to use checksums
75bca24cfc2aa9cc0c93afa8e4f2f441fb54998a753ac39b0b4dee0544cac55a
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 / nace_cli-0.5.0-py3-none-any.whl

Download URL nace_cli-0.5.0-py3-none-any.whl
Size 86.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
97bf44a7c8cab44abb6482b738fd6037b632b253370ab82af029935d0d0646b5
BLAKE2b-256 checksum
How to use checksums
430ddde19580a7a3c8ba4443fa211211a946a2dd570ab6c562ecc7b728526081
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 nace-cli 0.5.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.5.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 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