- pipe a PDF through
retab extractions createfrom a shell script, - automate workflow tests in CI,
- explore endpoints quickly without writing client code.
Install
One-liner install
Run this in your terminal:The installer detects your OS and architecture, downloads the matching release from
github.com/retab-dev/retab/releases, verifies the SHA-256 checksum, drops the binary at ~/.retab/bin/retab, appends a PATH entry to your shell’s rc file (.zshrc, .bashrc, .bash_profile, or ~/.config/fish/config.fish), and runs retab setup to install Retab skills and MCP config.Authenticate
~/.retab/config.json (mode 0600). Tokens refresh transparently.For headless setups (CI, servers, no browser), use an API key directly — see Authentication below.Install options
The installer honors a few environment variables:| Variable | Default | Purpose |
|---|---|---|
RETAB_VERSION | latest | Pin a specific CLI version (e.g. 0.1.0). |
RETAB_INSTALL_DIR | $HOME/.retab/bin | Where the binary is dropped. |
RETAB_NO_MODIFY_PATH | unset | Set to 1 to skip the rc-file PATH edit. |
RETAB_SKIP_SETUP | unset | Set to 1 to skip automatic retab setup. |
Upgrade
Re-run the installer — it always installs the latest published release:Uninstall
Authentication
The CLI supports two auth modes. Pick OAuth on your laptop, API keys in CI.Browser OAuth (default on workstations)
~/.retab/config.json. Subsequent commands send Authorization: Bearer <token> and refresh transparently when the access token nears expiry.
The redirect lands on http://127.0.0.1:<random-port>/callback — nothing leaves your machine except the request to your identity provider. The flow times out after 5 minutes if you close the browser without finishing.
API key (CI, servers, headless boxes)
Any of these three paths works, in order of precedence:- Flag:
--api-key rt_live_…on a single command. - Env:
RETAB_API_KEY=rt_live_…exported in the shell or CI runner. - Stored:
retab auth login --api-key rt_live_…to persist to~/.retab/config.json.
rt_test_... key for local development and CI, and a rt_live_... key for
production. Legacy sk_retab_... keys still work and resolve to production.
See API keys for the full reference.
Precedence
The CLI picks credentials in this strict order. The flag and env paths always win so anRETAB_API_KEY in your environment overrides any logged-in OAuth session — useful when you want to scope a single command to a different identity.
| # | Source | Header sent |
|---|---|---|
| 1 | --api-key flag | Api-Key |
| 2 | RETAB_API_KEY env var | Api-Key |
| 3 | OAuth tokens in ~/.retab/config.json | Authorization: Bearer … (refreshed automatically) |
| 4 | api_key field in ~/.retab/config.json | Api-Key |
| 5 | nothing → error | — |
Inspecting the active credential
Switching and clearing
Core commands
Every primitive in the Retab API has a matching command group. Output is JSON on stdout so it pipes cleanly intojq.
Files
Workflows
Workflow graph commands operate on flat block, edge, test, and experiment resources keyed by workflow id, so the CLI takes<workflow-id> as an explicit
argument when creating or updating those resources.
files, parses, extractions, classifications, splits, partitions, edits, schemas, and the workflow sub-trees (blocks, edges, runs, artifacts, tests, experiments) — follows the same retab <noun> <verb> shape. Run retab <noun> --help to enumerate verbs, then retab <noun> <verb> --help for the flags.
For review corrections, --parent-id is required. It must name the existing
review version that the corrected snapshot derives from.
Workflow tests and experiments do not use public job_id or batch_id
handles. Store the returned run id, poll the corresponding runs get
command, and read child records from the runs results or runs metrics
subcommands.
Discoverability
The CLI is a tree of commands. Two shortcuts you’ll want:-
--helpeverywhere.retab --helplists nouns;retab extractions --helplists verbs;retab extractions create --helplists flags. -
Shell completion. Generate a completion script once and source it from your shell rc:
Configuration reference
Config file
~/.retab/config.json — written by retab auth login, mode 0600. Holds either an oauth block (tokens, expiry, WorkOS domain) or an api_key, plus optional base_url.Environment
RETAB_API_KEY, RETAB_BASE_URL — override anything stored on disk. The
right choice in CI.Flags
--api-key, --base-url, --debug — persistent flags on every command.
Override env vars.Binary
Installed at
~/.retab/bin/retab by default. Single static binary, no runtime dependencies.--debug flag turns on verbose output (request URLs, response codes, raw bodies). Use it when filing an issue against the CLI.
Troubleshooting
`retab: command not found` after install
`retab: command not found` after install
The installer added
~/.retab/bin to your shell rc, but the current shell hasn’t reloaded it. Either open a new terminal or run source ~/.zshrc (or your shell’s rc file). On fish, run source ~/.config/fish/config.fish.`401 Unauthorized`
`401 Unauthorized`
Browser didn't open during `retab auth login`
Browser didn't open during `retab auth login`
The CLI uses
open (macOS), xdg-open (Linux), or rundll32 url.dll (Windows). If none of those are wired up — typical on minimal Docker images or remote SSH — the CLI prints the authorize URL to stderr instead. Copy it into a browser on a machine that can talk to your identity provider; the callback still lands on 127.0.0.1:<port> of the box where the CLI is running, so port-forward or use RETAB_API_KEY instead.`unsupported architecture` during install
`unsupported architecture` during install
The installer supports
x86_64 and arm64 only. On other architectures,
build from source: git clone https://github.com/retab-dev/retab && cd retab/cli && go build -o retab .Checksum mismatch during install
Checksum mismatch during install
A checksum mismatch means the downloaded archive doesn’t match the SHA-256 published in
checksums.txt. Don’t bypass the check — re-run the installer (it’s idempotent). If it persists, file an issue at github.com/retab-dev/retab.Get started
Try it
Walk through an end-to-end extraction with the CLI.
GitHub
Source code, releases, and issues live here.