Skip to main content

CLI Workflows

Common operational flows, in two forms: natural language for working interactively, and stateset-direct for the same workflow once it runs unattended.
Every write needs --apply. Run the read steps first — they cost nothing and they tell you whether the write is the one you meant.

Order fulfilment

Interactively:
Scripted — same effect, no interpretation layer:

Returns processing

Approving a return doesn’t restock anything — markReceived does, when the parcel actually arrives. Refunding before receipt means you’ve paid out on an item that may never come back. See the returns workflow.

Inventory adjustment

Always pass a reason. Adjustments are recorded as movements with an audit trail, and a reason is what makes a later discrepancy traceable to the correction that caused it.

Batch work

For repeated operations, put the requests in a file rather than looping the shell:
Sessions carry context, so a multi-step flow can refer back:

Parsing output

Use --json whenever something downstream reads the result. Prose output shape isn’t a contract; the JSON shape is.

Promoting a workflow to production

Once a workflow is doing real work on a schedule, move it off natural language:
Don’t leave natural language in a cron job. The same sentence can resolve to a different action as the model changes, and a scheduled task is exactly where nobody is watching when it does.