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.
✗ 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.
.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.
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 anmcp-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.