Skip to main content
The Python SDK includes the strand command for running the upload-to-results workflow without a script. It uses the same strand.Client as the library and MCP tools. Each command maps one-to-one to an SDK method and uses the same argument names.

Install

Installing the package puts strand on your PATH.

Configuration

The CLI reads the same environment variables as strand.Client().
Generate a key at app.strandai.com. Commands print machine-readable JSON to stdout, so they compose with jq and shell pipelines. On failure the CLI writes a one-line message to stderr and exits with a non-zero status.

End-to-end run

Commands

strand markers

List the markers your account can request (credit-free). The names printed are exactly what strand predict will accept for your account.
Wraps client.markers.list().

strand upload

Upload a local whole-slide image. The command performs a resumable chunked upload and prints the sample’s current ingest state. Dimensions may still be absent while ingest preprocessing continues.
Wraps client.uploads.upload_file(...). Before an immediate dry run or submission, poll strand samples get SAMPLE_ID until status is ready.

strand predict

Price or submit a prediction against an uploaded sample. --dry-run prints the full estimate without creating a job or reserving credits. The default submission reserves credits and prints the job id.
Wraps client.predict.submit(..., dry_run=...). See Markers for the predictable panel.

strand status

Print a point-in-time status snapshot for a job: state, progress, markers, and the served model.
Wraps client.jobs.get(<job-id>).status.

strand wait

Wait for a terminal job snapshot. The command prefers the job’s SSE stream and falls back to status polling if the stream disconnects.
Wraps client.jobs.get(<job-id>).wait(...). A failed job or elapsed timeout prints an error and exits non-zero; completed, partially failed, and cancelled snapshots print as JSON.

strand cancel

Cancel an eligible in-flight job, release its credit reservation, and print the refreshed post-cancel snapshot.
Wraps client.jobs.get(<job-id>).cancel().

strand results

Download a completed job’s OME-Zarr result tree to a local directory. Streams the files through the API-key result proxy.
Wraps client.jobs.get(<job-id>).download_results(dir).

strand export

Request or reuse a generated result export, wait until it is ready, write it to the required destination path, and print that path.
Wraps client.jobs.get(<job-id>).download_export(...).

strand samples list

List owned samples, the public cohort, or both through one cursor-paginated surface. The JSON envelope contains items and next_cursor; every item has canonical id and an ownership discriminator.
Wraps client.samples.list(...).

strand samples get

Read an owned or public sample using its canonical id. Owned output includes jobs and job_count. Public output includes geometry and marker channels. --download mirrors a public sample’s OME-Zarr store.
Wraps client.samples.get(...).

strand samples patch

Patch an owned sample’s display name, complete tag set, and/or physical scale. Omitted options are not sent.
Wraps client.samples.patch(...).

strand uploads list

List resumable upload records for your organization. This is distinct from the scoped sample catalog.
Wraps client.uploads.list(...).

See also