Skip to main content

cirron spool

Manage the local spool directory where the Cirron Python SDK writes trace batches while ci.profile() is active. Spool files accumulate in ./.cirron/spool/ and contain JSON batches of spans and marks produced by your training or inference code. The spool command group is the setup path for external runs: laptops, notebooks, or customer servers that aren’t on platform-managed compute. It lets you see what the SDK has buffered locally, push those batches to the platform, or reclaim disk by clearing them.

Subcommands

  • cirron spool inspect: List spool files with sizes and timestamps
  • cirron spool flush: Upload buffered batches to the platform
  • cirron spool clear: Delete local spool files

Usage

Options

OptionDescriptionDefault
--dir <path>Override the spool directory./.cirron/spool (current working directory)
--jsonEmit machine-readable JSON (inspect only)
--forceSkip the confirmation prompt (clear only)

Subcommand Details

Inspect the Spool

List every batch file in the spool with its timestamp and size, plus a header summary and oldest/newest footer.

Example Output

Empty Spool Output

JSON Output

Flush the Spool

Upload every batch file to the platform’s trace ingest endpoint, then delete each file after it’s acknowledged. Files are sent in oldest-first order. Batches are gzip-compressed when larger than 1 KB.
Flush uses the credentials stored by cirron auth login (~/.cirron/config.json). Before sending any batch, the CLI verifies your token is still valid and transparently refreshes it if it’s close to expiry. If verification returns 401/403, the flush is aborted with a prompt to re-authenticate. Each upload has a request timeout (governed by config.timeout) and retries up to three times on transient failures (5xx, 429, network errors) with exponential backoff. Rate-limited responses respect the Retry-After header.

Example Output

Partial Failure

If a fatal error occurs mid-flush (e.g. an authentication issue or an unrecoverable 4xx), remaining batches stay in the spool and can be retried on the next run:

Missing Ingest Route

If the platform you’re pointing at doesn’t expose /api/traces yet, flush fails fast with a clear message and leaves your spool intact:

Clear the Spool

Delete every batch file in the spool directory. By default you’re shown a summary and asked to confirm; use --force to skip the prompt (useful in scripts).

Confirmation Prompt

Example Output

How It Works

The Python SDK writes spool files when ci.profile() is active. Each file is a JSON batch containing spans and marks from one flush interval (roughly 1 second of runtime). File names encode a nanosecond-precision timestamp plus a batch ID, which the CLI parses to present ordered results without reading each file’s contents. Spool files are the public local artifact of the SDK. They work standalone and can be consumed by third-party tools. Flushing to the platform is optional; many teams run profilers on disconnected laptops or air-gapped machines and simply archive the spool directory. The CLI’s spool commands are a lightweight inspection surface:
  • inspect shows the file-system inventory without parsing batch contents.
  • flush uploads exactly the JSON the SDK produced, no transformation.
  • clear is a plain directory delete.
For rich content viewing (flamegraphs, scope trees, mark plots), use cirron traces view instead.

Authentication

spool flush requires CLI authentication. inspect and clear are offline operations.
If no credentials are found, flush aborts with:

Error Handling

Common Errors

Not Authenticated

Solution: Run cirron auth login.

Auth Expired

Solution: The CLI attempted a silent token refresh and the refresh token itself has expired. Re-authenticate with cirron auth login.

Upload Timeout

Solutions: Check your network, then re-run cirron spool flush. The failed batch remains on disk and will be retried.
Solutions: Check file-system permissions on the spool directory. The batch was successfully ingested; you can safely delete the local file manually.

Examples

Disconnected Laptop Workflow

Archive and Ship a Spool

Reclaim Disk

  • cirron auth: Manage authentication (required for flush)
  • cirron status: Check CLI status
  • cirron config: Manage CLI configuration (apiUrl, timeout, etc.)