Skip to content

The command line and AI agents

You can do everything the interface does from the qcw command line, which connects to the same workbench service. Scripts and AI agents use it with --json, which makes each command print JSON.

Terminal window
uv run qcw run examples/water-opt-freq.toml

The command starts the service if it is not running, submits the job and waits for the result. Add --json to print the result as one JSON document.

An input file is TOML. Each [[molecule]] block is one job, and the jobs of one file form a job set:

[calculation]
task = "single-point"
[[molecule]]
name = "methanol"
smiles = "CO"
[[molecule]]
name = "formaldehyde"
smiles = "C=O"

If a file names no method, its jobs use the default method, r2SCAN-3c, which stays provisional until a chemist collaborator reviews it. uv run qcw methods lists the methods and their defaults, with the source of each.

  1. Submit without waiting:

    Terminal window
    uv run qcw submit batch.toml --project "First steps" --set-name "single points" --json

    --start-at 2026-12-01T20:00 delays the start, for example to run overnight.

  2. List the jobs: uv run qcw jobs list --project "First steps".

  3. Wait for them: uv run qcw jobs wait <job id> <job id>.

  4. Read a result: uv run qcw jobs result <job id>, adding --json for JSON.

  5. Show the set: uv run qcw sets show <set id>.

Scripts can act on the exit code.

Code Meaning
0 Success
1 Internal error
2 Input or usage error
3 A job failed
4 Engine unavailable
5 Service unavailable
6 Timed out
7 Disk full
8 Settings file or keyring error
130 Interrupted

With --json, an error prints a qcw.error.v1 document. uv run qcw schemas lists every published schema.

An AI agent is a program, driven by a language model, that runs qcw commands for you.

  1. Have the agent read the guide written for it: uv run qcw guide.
  2. Give its jobs an actor label with QCW_ACTOR=my-agent or --actor. The workbench saves the label with every job the agent submits.
  3. Set approval limits on the Approvals page, for example the largest number of atoms allowed in one molecule. Jobs above a limit wait there until you approve them in the browser. The command line cannot approve jobs or change the limits.

A cloud-hosted agent sends the molecules and results it reads to its model provider. For unpublished or restricted work, use an agent that runs a local model.

Terminal window
uv run qcw edit run methanol.xyz -c "distance 2, 6, 0.97" -c "pointgroup" --out methanol-edited.xyz

uv run qcw edit commands lists the 3D editor’s commands, which work here as they do in the browser.

An open-source project on GitHub. Built by Graham Morley.