CLI

Coding agents

Let Claude Code, Cursor or Codex debug agents, fix issues and build training files with the trodo CLI and its skills.

A coding agent with a shell uses the CLI like you do. Every command prints JSON, exits with a clear code, and says what was wrong in one sentence, so the agent can chain them and recover from a mistake.

Set it up

npm i -g trodo-cli
trodo login            # once, in your own terminal

Then give the agent the Trodo skills:

trodo setup claude             # into this project's .claude/skills
trodo setup claude --global    # into ~/.claude/skills, for every project
trodo setup --dir PATH         # anywhere else your agent reads skills from

Two skills come with the CLI. trodo teaches reading and acting on traces: find what failed, read the span tree, see which eval step failed, compare with last week, fix and close an issue, pull and push prompts. trodo-datasets teaches the training-data loop: count, pull, keep what passed, fix what failed, export, train.

Then ask for the outcome:

Find out why the refund eval started failing yesterday and fix it. Use the trodo CLI.

Build a fine-tuning file from last month's support conversations that passed every eval, and a second file from the ones the refund eval failed once their Expected is filled. Use the trodo CLI.

The loop an agent runs

Asked "make a dataset of conversations where the user left frustrated, with a better reply as Expected", an agent works through the CLI and does the thinking in its own code:

trodo evals list --table                                       # which eval measures this
trodo evals explain "Conversation went well" --table           # its steps, the answer options, the outcomes
trodo traces count --kind conversations --since 30d \
  --eval "Conversation went well:How it went.frustrated=yes"   # how many match
trodo traces export --kind conversations --since 30d \
  --eval "Conversation went well:How it went.frustrated=yes" -o frustrated.jsonl
python3 build.py < frustrated.jsonl > rows.jsonl               # its own logic, on its own machine
trodo datasets create "Frustrated users" -f rows.jsonl
trodo datasets export "Frustrated users" --format openai --target expected -o train.jsonl

build.py is whatever the task needs. Each exported line carries the conversation's input and output and every verdict on it, with each step's answer:

import json, sys
for line in sys.stdin:
    r = json.loads(line)
    went_well = next(e for e in r["evaluations"] if e["name"] == "Conversation went well")
    asked = {s["node_id"]: s["value"] for s in went_well["steps"]}
    if asked["read"]["goal_met"] > 1.5:        # frustrated but got there: keep for later
        continue
    print(json.dumps({
        "input": r["input"],
        "output": r["output"],
        "expected": None,                      # filled after review, with `trodo datasets update`
        "metadata": {"conversation_id": r["source"]["conversation_id"], "goal_met": asked["read"]["goal_met"]},
    }))

Nothing runs on Trodo's side. The CLI reads, the script decides, the CLI writes the rows back, and the dataset keeps versions of every change.

In CI

export TRODO_API_KEY=${{ secrets.TRODO_API_KEY }}
trodo datasets export "Refunds that went well" --rows passed --format openai --target output --version 12 -o train.jsonl

Make a key for CI in Settings → MCP with only the scopes it needs.

On this page