unstract-cli
unstract runs LLMWhisperer text
extraction and Unstract API deployments
from the terminal. Pass -o json and every command prints one JSON envelope, so a
shell script or a coding agent can drive it.
Full reference: https://docs.unstract.com/unstract/unstract_platform/cli/unstract_cli/
Install
curl -LsSf https://raw.githubusercontent.com/Zipstack/unstract-cli/main/install.sh | sh
The installer fetches uv if it is missing and
installs the CLI with it; uv brings its own Python. With uv or pip
already there:
uv tool install unstract-cli # or: pip install unstract-cli
unstract --version
Get your keys
| Key | Where it is minted | What it does |
|---|---|---|
| Platform key | An organisation admin, under Settings → Platform API Keys in the Unstract UI | Platform related operations and to identify the organization |
| Deployment key | The API deployment's own page in the Unstract UI or an organisation admin mints one under Settings → Global API Deployment Keys | Runs deployments (deployment run, deployment status) |
| LLMWhisperer key | The LLMWhisperer console | Extracts text (whisper …) |
Set up
unstract auth login
A wizard asks for each product's URL (Enter keeps the cloud host; self-hosted,
type your own) and API keys, then writes ~/.unstract/config.toml. Then verify:
unstract auth whoami # which organisation the platform key belongs to
unstract config doctor --probe # where each setting resolved from, keys checked
Usage
# Extract text from a document (path or URL); waits for the result
unstract whisper extract invoice.pdf -o raw > invoice.txt
# What deployments can I run?
unstract docstudio deployment ls
# Run one and wait for the structured result
unstract docstudio deployment run invoice-parser invoice.pdf
# Long job: submit, then check later
unstract docstudio deployment run invoice-parser invoice.pdf --no-wait
unstract docstudio deployment status invoice-parser <execution_id>
--help on any command lists its options; unstract --discover full prints
the whole command tree, every flag and the exit-code table as JSON.
Configuration
~/.unstract/config.toml, or $UNSTRACT_CONFIG, or --config, or a
project-local .unstract.toml is found by upward search. Here's an example config that uses environment variables for the API keys.
default_profile = "cloud-us"
[profiles.cloud-us.docstudio]
base_url = "https://us-central.unstract.com"
org_id = "org_ABC123"
platform_key = "env:UNSTRACT_PLATFORM_KEY"
api_key = "env:UNSTRACT_DEPLOYMENT_KEY"
[profiles.cloud-us.llmwhisperer]
base_url = "https://llmwhisperer-api.us-central.unstract.com/api/v2"
api_key = "env:LLMWHISPERER_API_KEY"
# Only for a deployment whose key differs from the profile's.
[profiles.cloud-us.deployments."invoice-parser"]
api_key = "env:INVOICE_PARSER_KEY"
Every setting resolves flag > environment > profile > built-in default.
auth login writes keys literally; env:VAR_NAME keeps them out of the file.
The connection flags on each group (--base-url, --api-key, --org-id,
--platform-key) override the profile for one invocation without writing
anything. config doctor reports where each setting resolved from without
echoing a value, and exits non-zero when one of its checks fails.
Environment variables
The same settings without a file, for CI, containers and agents:
export UNSTRACT_PLATFORM_KEY=... # auth whoami, deployment ls
export UNSTRACT_DEPLOYMENT_KEY=... # deployment run / status
export UNSTRACT_ORG_ID=... # the organisation id auth whoami reports
export LLMWHISPERER_API_KEY=... # whisper …
export UNSTRACT_BASE_URL=... # self-hosted only
export LLMWHISPERER_BASE_URL=... # self-hosted only
auth login also takes each key as a flag (--platform-key, --deployment-key,
--llmwhisperer-key; - reads it from stdin) and the host as --base-url, so
it runs without a terminal too.
Output for scripts and agents
Parsing anything? Pass -o json. stdout then carries exactly one envelope,
on success and on failure alike, and diagnostics go to stderr:
{"ok": true, "data": {...}, "error": null, "meta": {"contract_version": 1}}
Ignore fields you do not recognise; refuse a meta.contract_version above the
one you were written against. -o raw prints one field unwrapped. When a
coding agent is driving (detected from the environment it sets) json is the
default; --agent yes|no forces that, and an explicit -o wins over both.
Failures exit non-zero with a stable code:
| Code | Meaning |
|---|---|
| 0 | success |
| 1 | generic failure |
| 2 | usage error |
| 3 | authentication failed |
| 4 | not found |
| 5 | validation failed, including a run in which a document failed |
| 6 | rate limited |
| 7 | timed out; resume with the job handle in the error payload, do not resubmit |
| 8 | server error |
| 9 | result already consumed (one-shot read); pass --save next time |
| 10 | result read but not saved; it is in error.details |
| 130 | interrupted (128 + SIGINT) — the user stopped it, not a failure |
Development
uv sync --extra dev
uv run pytest
uv run ruff check .
Questions and Feedback
On Slack, join great conversations around LLMs, their ecosystem and leveraging them to automate the previously unautomatable!
Unstract Cloud: Signup and Try!
Metadata
Release files for unstract-cli 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| unstract_cli-0.1.1.tar.gz | 172.4 kB | Without provenance | Details for unstract_cli-0.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| unstract_cli-0.1.1-py3-none-any.whl | Python 3 | none | any | Details for unstract_cli-0.1.1-py3-none-any.whl |
Total release size: 268.3 kB
Release files / unstract_cli-0.1.1.tar.gz
| Download URL | unstract_cli-0.1.1.tar.gz |
|---|---|
| Size | 172.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
708c9caedec489a5f3441ae0d6e338a8425f26d15bcd12aa80c615cba4632de6
|
|
BLAKE2b-256 checksum How to use checksums |
a7a5df13301e3e74598e8291c46cfb0702246071ebb8f103a676979b599ecdec
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.6.14
|
Release files / unstract_cli-0.1.1-py3-none-any.whl
| Download URL | unstract_cli-0.1.1-py3-none-any.whl |
|---|---|
| Size | 95.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
70f853e06891e95bfbb1a2a55f4cc91cbf3b2c1895221ddbb11347b0d641a900
|
|
BLAKE2b-256 checksum How to use checksums |
c1032a400464095d982f7e86ac46d436a9b39898f023665c2fadf767b3be911d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.6.14
|
Security for unstract-cli 0.1.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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
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.