Skip to main content
Installing the SDK also installs the cosmon command — the fastest way to check your setup and to fire a one-off task without writing any Python. It’s the same client under the hood, so anything the CLI does you can also do from Python.
The CLI is headless — it can’t answer an ask_user, so it always runs the agent unattended (questions are never offered; the agent proceeds on its own judgment). For interactive runs where you answer the agent’s questions, use the Python handlers.

cosmon doctor

Check that the app is reachable, you’re signed in, and the agent runtime is ready. Run this first whenever something isn’t connecting.
A healthy check prints each step and the agents your app exposes:
Any line marked names what to fix — check that the app is open, you’re signed in, and Settings → Developer access is on. doctor exits 0 only when the runtime is ready; otherwise it exits 1, so it drops straight into a CI readiness gate.

cosmon run

Run one task. By default it streams the work — the answer to stdout, tool steps and [agent] speaker labels to stderr — so you can pipe the answer while still watching progress on your terminal.
string
required
The task, as a single positional argument. Quote it.
string
The platform agent — e.g. solidworks, abaqus, fluent. Omit for the default agent. cosmon doctor lists the agents your app exposes.
string
Attach a file to the prompt (read on the machine running the app). Repeatable — pass --attach once per file. Relative paths resolve against your working directory; a missing file fails before the agent runs.
flag
Print only the finished transcript in one block (tool steps inline as ▶ <step> lines) instead of streaming it live. Use it when you want just the result, e.g. answer=$(cosmon run "..." -q).
flag
Approve confirmation requests, including dangerous ones. Without it the CLI auto-declines dangerous actions (approve safe, decline dangerous) — the same safe default as an unattended Python run. See the warning below.
--auto-approve approves every confirmation gate the agent raises, including destructive operations (deleting bodies, overwriting files). Use it only for runs you fully trust and control — never on untrusted prompts. It’s the shell equivalent of on_confirm=lambda c: True in Python.
The streaming layout is exactly what .text(live=True) renders in Python:
run exits 0 on success and 1 if the run fails (printing error: <reason> to stderr) — so cosmon run ... && deploy chains correctly.

cosmon chats

List the conversations your scripts left on the server — SDK-owned only, never the app user’s own chats — newest first.
Each row is id updated_at title. Resume a conversation from Python with client.session(id="9f3c…") (see multi-turn sessions). Prints No SDK conversations on the server. when there are none.

Discovery & the descriptor

The CLI finds your running app the same way the library does: the app writes an mcp-gateway.json descriptor while Developer access is on, and the SDK reads it automatically. Point at a different one with the COSMON_SDK_DESCRIPTOR environment variable (a dev build’s data dir differs — doctor prints the path it used):

Next steps

Python reference

The full library surface — clients, runs, handlers, streaming, and errors.

Examples

Runnable scripts for every capability — copy, run, adapt.