Skip to content

Doctor and Schema Introspection

Check the machine before you ship, and ask the CLI to describe any command's request and response shapes.

Updated September 3, 20261 min readPostsale CLI

postsale doctor answers "is this machine ready?" postsale schema answers "what does this operation expect?" Together they save a lot of guesswork before batch work or automation.

In this article, we will run doctor and pre-flight, list and inspect operation schemas, and call out what schema does not cover.

Before We Begin

This article assumes that:

  • The CLI is installed and authenticated when you want live checks
  • postsale schema --list works from the local catalog without network auth

Run doctor

Here's how:

bash
postsale doctor
postsale doctor --human
postsale doctor --examples

Doctor typically reports:

  • Build identity: checks.build.version and checks.build.commit (the short source commit id the release was built from; dev for a non-release build). --version stays a bare semver, so this is where you pin the exact build.
  • Token validity. On an API key (psk_… in POSTSALE_TOKEN) the record reports credential_kind: "api_key", the key's display prefix and no expiry; a login session that shadows a key is noted as ignored_env_credential
  • LLM provider detection (for postsale run)
  • API reachability and auth. A login session is probed through the user profile; an API key is probed through a scoped carriers read, and a key that lacks read:carriers warns instead of failing
  • Carriers and origin addresses
  • Environment posture, including checks.environment.test_label_mode (informational; see Test-label mode)

Pre-flight mode

bash
postsale doctor --pre-flight

Any warning becomes exit 75. We recommend this before batch label purchase in unattended runs.

Dual LLM keys

If both an Anthropic credential (ANTHROPIC_API_KEY or ANTHROPIC_AUTH_TOKEN) and an OpenAI key exist without an override, doctor may warn and name the override knobs. Runtime still defaults to Anthropic when unset.

Inspect schemas

bash
postsale schema --list
postsale schema --all
postsale schema orders.search
postsale schema shipments.create
postsale schema --human orders.get

--list returns OpenAPI-backed slugs (verify live with postsale schema --list; see schema-slugs). --all is the bulk bootstrap document for hosts.

Agent equivalent for one tool: get_tool_schema.

Schema list is not the full CLI

Missing examples include shipments list, labels reprint, run, doctor, auth, continue, traces, and saved queries. See CLI-only commands. For those surfaces, trust --help and the feature articles.

Good to Know

SymptomLikely causeWhat to do
Slug not foundCLI-only commandUse feature docs / --help
Pre-flight exit 75Warnings presentFix warnings before money batches

Additional Reading