trodo-cli 0.0.0-stage → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +33 -2
- package/bin/trodo.js +7 -0
- package/lib/args.js +45 -0
- package/lib/commands/agents.js +63 -0
- package/lib/commands/api.js +37 -0
- package/lib/commands/auth.js +165 -0
- package/lib/commands/conversations.js +49 -0
- package/lib/commands/datasets.js +182 -0
- package/lib/commands/evals.js +138 -0
- package/lib/commands/issues.js +40 -0
- package/lib/commands/prompts.js +125 -0
- package/lib/commands/runs.js +118 -0
- package/lib/commands/setup.js +34 -0
- package/lib/commands/spans.js +38 -0
- package/lib/commands/traces.js +112 -0
- package/lib/commands/users.js +14 -0
- package/lib/common.js +69 -0
- package/lib/config.js +78 -0
- package/lib/filters.js +157 -0
- package/lib/http.js +74 -0
- package/lib/main.js +137 -0
- package/lib/output.js +61 -0
- package/package.json +29 -4
- package/skills/trodo/SKILL.md +121 -0
- package/skills/trodo-datasets/SKILL.md +116 -0
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: trodo
|
|
3
|
+
version: 1.0.0
|
|
4
|
+
cli_version: ">=0.3.0"
|
|
5
|
+
last_updated: 2026-11-03
|
|
6
|
+
description: >-
|
|
7
|
+
Read and act on an AI agent's production traces in Trodo with the `trodo` CLI:
|
|
8
|
+
find failing runs, read a run's span tree or a whole conversation, see why an
|
|
9
|
+
eval failed step by step, check traffic stats against last week, triage and
|
|
10
|
+
close issues, pull and push prompt versions, give feedback, and turn traces
|
|
11
|
+
into datasets and fine-tuning files. Use for "why did this run fail", "what
|
|
12
|
+
broke since yesterday", "show me the conversation", "which evals fail most",
|
|
13
|
+
"fix this Trodo issue", "update the prompt", "build a dataset from my traces".
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
# Trodo from the terminal
|
|
17
|
+
|
|
18
|
+
Every command prints JSON (pipe it to `jq`), `--table` for a person, `--csv` for a
|
|
19
|
+
sheet. Exit codes: 0 ok, 1 the API said no, 2 a usage mistake (the message says which).
|
|
20
|
+
|
|
21
|
+
## Setup
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
npm i -g trodo-cli
|
|
25
|
+
trodo login # opens the app: check the code, choose the team, Connect
|
|
26
|
+
trodo whoami
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
Without a browser (CI): `TRODO_API_KEY=trodo_mk_…` from Settings → MCP.
|
|
30
|
+
|
|
31
|
+
Everything is per team. `trodo teams` lists the teams this terminal is signed in
|
|
32
|
+
to, `trodo switch TEAM` changes the current one, `--team TEAM` picks one for a
|
|
33
|
+
single command. Check `trodo whoami` before writing anything.
|
|
34
|
+
|
|
35
|
+
## Find what went wrong
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
trodo traces stats --since 24h --compare # errors, latency, cost, evals vs the day before
|
|
39
|
+
trodo runs list --since 24h --where "status=error" --table
|
|
40
|
+
trodo runs list --eval "any:failed" --agent support --table
|
|
41
|
+
trodo issues list --status open,regression --table
|
|
42
|
+
trodo runs search "refund for order 4821" # free text over inputs, outputs and spans
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
The filter is the Traces page's: `--since 24h|7d|30d`, `--agent NAME`,
|
|
46
|
+
`--where "field op value"` (`= != ~ > >= < <=` on any property:
|
|
47
|
+
`total_cost>0.05`, `span.model~gpt-4o`, `metadata.tier=pro`) and
|
|
48
|
+
`--eval "NAME:COND"` (`failed`, `passed`, `score<0.5`, `reason=CODE`,
|
|
49
|
+
`STEP.FIELD=value`; `trodo evals list` names the evals and their steps).
|
|
50
|
+
`trodo traces agents`, `trodo traces fields` and `trodo traces values FIELD`
|
|
51
|
+
say what `--agent` and `--where` can name.
|
|
52
|
+
|
|
53
|
+
## Read one
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
trodo runs tree RUN_ID # the span tree: names, models, time, tokens, errors
|
|
57
|
+
trodo runs get RUN_ID # everything: spans, messages, feedback, evaluations
|
|
58
|
+
trodo spans get SPAN_ID # one span's full input and output
|
|
59
|
+
trodo conversations get ID --messages # the thread as user / assistant turns
|
|
60
|
+
trodo evals verdicts --run RUN_ID # every eval's verdict on it
|
|
61
|
+
trodo evals verdict VERDICT_ID # each step the eval took and why
|
|
62
|
+
trodo evals steps EVAL --table # which step decides most failures
|
|
63
|
+
trodo users get DISTINCT_ID # one user's runs, cost, evals and feedback
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
Read the deepest failing span before deciding the cause: what failed above it is
|
|
67
|
+
what the user saw, not why.
|
|
68
|
+
|
|
69
|
+
## Fix and verify
|
|
70
|
+
|
|
71
|
+
```bash
|
|
72
|
+
trodo issues get ID # root cause, evidence, timeline
|
|
73
|
+
trodo issues failures ID # recorded inputs to replay against the fix
|
|
74
|
+
trodo traces count --since 1h --eval "NAME:failed" # after the fix ships: should fall to 0
|
|
75
|
+
trodo issues close ID # a new failure reopens it as a regression
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
## Prompts
|
|
79
|
+
|
|
80
|
+
```bash
|
|
81
|
+
trodo prompts pull support-triage --label production -o prompt.json
|
|
82
|
+
# edit prompt.json
|
|
83
|
+
trodo prompts push support-triage -f prompt.json --message "why" --label staging
|
|
84
|
+
trodo prompts label support-triage 5 production # agents fetching by label switch on their next call
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
Moving `production` changes what live agents run. Do it only when asked.
|
|
88
|
+
|
|
89
|
+
## Feedback
|
|
90
|
+
|
|
91
|
+
```bash
|
|
92
|
+
trodo runs feedback RUN_ID --thumbs down --comment "quoted the wrong plan"
|
|
93
|
+
trodo evals mark VERDICT_ID --wrong --should pass --reason "the refund was within policy"
|
|
94
|
+
trodo evals queue --table ; trodo evals grade ITEM_ID CHOICE
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
## Datasets and training data
|
|
98
|
+
|
|
99
|
+
```bash
|
|
100
|
+
trodo traces export --kind spans --eval any:passed --eval any:not-failed --format openai -o sft.jsonl
|
|
101
|
+
trodo traces export --kind runs --since 7d --include-trace --dir ./runs # one JSON file per run
|
|
102
|
+
trodo datasets create "Refund failures" --kind runs --eval "Refund policy:failed" --include-trace
|
|
103
|
+
trodo datasets rows "Refund failures" -o rows.jsonl
|
|
104
|
+
# write better answers: {"id": "...", "expected": "..."} per line
|
|
105
|
+
trodo datasets update "Refund failures" -f updates.jsonl
|
|
106
|
+
trodo datasets export "Refund failures" --rows expected --format openai --target expected -o train.jsonl
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
`trodo datasets append NAME -f rows.jsonl` takes `{"input": "…", "output": "…", "expected": "…"}`
|
|
110
|
+
lines, or `{"run_id": "…"}` / `{"span_id": "…"}` / `{"conversation_id": "…"}` to copy traffic.
|
|
111
|
+
|
|
112
|
+
## What the CLI will not do
|
|
113
|
+
|
|
114
|
+
It reads everything and only adds. Nothing deletes, archives, replaces or
|
|
115
|
+
reverts data, and traces cannot be changed. If a task needs that, tell the
|
|
116
|
+
person to do it in the app.
|
|
117
|
+
|
|
118
|
+
## Anything else
|
|
119
|
+
|
|
120
|
+
`trodo api GET /runs/conversations --param q=alice` calls any `/api/v1` route with the
|
|
121
|
+
signed-in key. `trodo help` lists every command.
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: trodo-datasets
|
|
3
|
+
version: 1.0.0
|
|
4
|
+
cli_version: ">=0.2.0"
|
|
5
|
+
last_updated: 2026-11-03
|
|
6
|
+
description: >-
|
|
7
|
+
Turn an agent's production traces into datasets and fine-tuning files with the
|
|
8
|
+
`trodo` CLI: pick traces by what the team's evals said about them (passed,
|
|
9
|
+
failed, a score, one step's answer), keep whole runs with their span trees,
|
|
10
|
+
process rows locally, write Expected back, and export OpenAI / Fireworks /
|
|
11
|
+
Together chat JSONL or DPO pairs. Use for "build a training set from my
|
|
12
|
+
traces", "export the runs that passed", "label these rows", "make a dataset of
|
|
13
|
+
failures", "fine-tune on what went well", and for running a Trodo labeling agent.
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
# Trodo datasets from the terminal
|
|
17
|
+
|
|
18
|
+
The team's evals already say which traces went well. A supervised fine-tune
|
|
19
|
+
wants exactly those: their own Output is the target, nothing to label. Rows
|
|
20
|
+
that failed need a better answer first (Expected). Work in that order.
|
|
21
|
+
|
|
22
|
+
## Setup
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
npm i -g trodo-cli
|
|
26
|
+
trodo login # opens the app: check the code, choose the team, Connect
|
|
27
|
+
trodo whoami
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
In CI or anywhere without a browser: `TRODO_API_KEY=trodo_mk_…` (Settings → MCP).
|
|
31
|
+
Every command prints JSON; add `--table` to read it yourself.
|
|
32
|
+
|
|
33
|
+
## 1. Know the evals
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
trodo evals list --table
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
`--eval "NAME:COND"` takes an eval's name (or any unique part of it, or `any`):
|
|
40
|
+
`failed`, `passed`, `not-failed`, `marked-wrong`, `not-marked-wrong`,
|
|
41
|
+
`marked-right`, `score<0.5`, `reason=CODE`, or one step's answer
|
|
42
|
+
`STEP.FIELD=value` / `STEP.FIELD<3` (STEP is the step's id or the start of its
|
|
43
|
+
name). Several `--eval` flags AND together. "Passed every eval" is
|
|
44
|
+
`--eval any:passed --eval any:not-failed`. People's corrections count: a
|
|
45
|
+
verdict someone marked wrong is read the other way round.
|
|
46
|
+
|
|
47
|
+
## 2. Look before you pull
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
trodo traces count --kind runs --since 30d --agent support --eval "any:passed" --eval "any:not-failed"
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
Kinds: `spans` (one model call), `runs` (one task, add `--include-trace` for
|
|
54
|
+
every span), `conversations` (a whole thread), `verdicts` (eval results, for
|
|
55
|
+
training the eval itself). Narrow with `--where "status=error"`,
|
|
56
|
+
`--where "total_cost>0.05"`, `--where "span.model~gpt-4o"`, `--where "metadata.tier=pro"`.
|
|
57
|
+
|
|
58
|
+
## 3a. Straight to a training file
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
trodo traces export --kind spans --since 30d --eval any:passed --eval any:not-failed \
|
|
62
|
+
--format openai --target output -o sft.jsonl
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
## 3b. Or keep it as a dataset (versioned, shared with the team, labelable)
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
trodo datasets create "Refunds that went well" --kind runs --since 30d \
|
|
69
|
+
--agent support --eval "Refund policy:passed" --include-trace [--live]
|
|
70
|
+
trodo datasets export "Refunds that went well" --rows passed --format openai --target output -o train.jsonl
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
`--live` keeps adding new matches every 15 minutes.
|
|
74
|
+
|
|
75
|
+
## 4. Process rows locally, write them back
|
|
76
|
+
|
|
77
|
+
```bash
|
|
78
|
+
trodo datasets export "Refund failures" > rows.jsonl # each line has its "id"
|
|
79
|
+
python label.py < rows.jsonl > updates.jsonl # your logic: {"id", "expected", "metadata"?}
|
|
80
|
+
trodo datasets update "Refund failures" -f updates.jsonl --label derived --name "Expected from label.py"
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
One call is one dataset version (restorable in the app). `--label derived`
|
|
84
|
+
records that a rule wrote Expected, not a person. Add rows with
|
|
85
|
+
`trodo datasets append NAME -f rows.jsonl`: plain rows `{input, output?, expected?}`
|
|
86
|
+
or references `{run_id}` / `{span_id}` / `{conversation_id}` that Trodo fills in.
|
|
87
|
+
|
|
88
|
+
## 5. Or let a Trodo agent label in the product
|
|
89
|
+
|
|
90
|
+
The dataset page's **Label** menu (or asking Lucid) makes a labeling agent:
|
|
91
|
+
models that must agree, a model with your rules, a stronger model rewriting
|
|
92
|
+
failures, or two models compared. Run one from here:
|
|
93
|
+
|
|
94
|
+
```bash
|
|
95
|
+
trodo agents list --table
|
|
96
|
+
trodo agents run "Label Expected where models agree" --wait
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
## 6. Train
|
|
100
|
+
|
|
101
|
+
```bash
|
|
102
|
+
trodo datasets export "Refunds" --rows expected --format openai --target expected -o train.jsonl
|
|
103
|
+
firectl dataset create refunds train.jsonl
|
|
104
|
+
firectl sftj create --base-model accounts/fireworks/models/qwen3-8b --dataset refunds --output-model refunds-v1
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
DPO: `--format dpo` writes Expected as preferred and Output as rejected, for
|
|
108
|
+
rows that have both and differ.
|
|
109
|
+
|
|
110
|
+
## Rules
|
|
111
|
+
|
|
112
|
+
- Count first, then pull with a `--limit`. Exports stream; use `-o file`.
|
|
113
|
+
- Never write Expected from a guess. Expected is a person's answer or the
|
|
114
|
+
output of a rule the team agreed on.
|
|
115
|
+
- The key acts as the person who made it, on one team. A 403 `missing_scope`
|
|
116
|
+
means the key needs that scope; make a new one with `trodo login`.
|