Command line

DataMind Oda usually runs as its own app, and it can also run from a command line. A command-line run is Oda itself, without the app window: it starts one mode, does its work, and exits or keeps serving. Use it to answer one task from a script, to serve the interface to a browser, or to let a program of yours drive Oda.

Start a mode

Each start names one mode with --profile:

sh
oda --profile <name>

Oda ships five modes:

ModeWhat it servesDetails
webThe Oda interface in a browser on this computer.Oda in the browser
headlessAnswers one task, then exits.This page, below
sdkAn Oda SDK client, over standard input and output.Automation clients
sdk-minimalA small standalone runtime for an SDK client.Automation clients
acpAn automation client that speaks the Agent Client Protocol.Automation clients

Run one task and exit

The headless mode answers one task and ends on its own:

sh
oda --profile headless "run the tests"

Continue a saved chat

Name an earlier chat with --session-id and give the new task:

sh
oda --profile headless --session-id <id> "carry on with the task"

Read a run as JSON events

Add --json to write newline-delimited events to standard output instead of the final answer:

sh
oda --profile headless --json "run the tests"
EventWhat it carries
sessionOpens the stream: the chat's id and the folder the run works in.
statusThe run's phase: turn_start, step_start, step_end or turn_end.
textA piece of the answer, when it is committed.
thinkingThe model's reasoning, when it is committed.
tool_callA tool the run starts, with its arguments.
tool_resultHow a tool ended: completed or error.
finalThe run's final answer.
errorA problem with the invocation itself, such as a bad option or a missing task.

The full contract of one-off runs is on Headless runs.

Model access for command-line runs

A run needs a model credential before it can answer. Until one resolves, model requests fail with MISSING_CREDENTIAL.

Add packages and customise a mode

Oda profiles and launchers covers how a mode is built from its packages, and how your own settings join its layers.

Questions, answered

What can I start from a command line?

Oda ships five modes, one per start: web serves the interface in a browser on this computer, headless answers one task and exits, sdk and sdk-minimal serve SDK clients, and acp serves automation clients that speak the Agent Client Protocol. Name the mode with --profile.

How do I give Oda one task and read the answer?

Start the headless mode with the task: oda --profile headless "run the tests". The answer goes to standard output, the model's reasoning goes to standard error, and the run exits on its own when the task settles.

What happens if I start a run with no task?

Nothing runs. With no task and nothing piped in, the run stops with a task is required, for example: oda --profile headless "run the tests". A task of only spaces is refused too, and the run exits 1 even when text is piped in.

Where do I find the id of the chat a run saved?

From a run's event stream: with --json, the opening session event carries the chat's id. Name that id with --session-id to continue the chat in a later run.

Which chats can a run continue?

Only ones the mode can adopt, and it refuses before the task runs when it cannot: the chat must not be live in this Oda process, must not have been saved under an agent preset this mode does not run, must not be a subagent or forked chat, must have a recorded folder that matches the one you run from, and must have undamaged records and their storage available.

Why do my requests fail with MISSING_CREDENTIAL?

The run has no credential for the model yet. Oda looks in the environment the run starts in, then the saved credential, then a .env file in the folder you run from, and last in Oda's home folder. Save the key in the app on Settings > Models, or provide it where the run looks; Stored credentials covers the order.

A run failed right after my DataMind server restarted. What should I do?

Usually nothing. For about 40 seconds after a restart, requests can fail while Oda retries them; if the run still failed, wait a moment and start it again.

How do I get machine-readable output from a run?

Add --json. The run writes one event per line to standard output instead of the final answer: session, status, text, thinking, tool_call, tool_result, final, and error for problems with the invocation itself. It is a projection of the run, not the chat's full log.

Can I add a package to a mode?

Yes: oda plugin --profile <name> add <package>, then start the mode again. A running mode keeps the set of packages it started with, so the change applies from the next start. Oda profiles and launchers covers the command and how a mode is built.