[Feature]: provide an AXI for roam-code
Problem or use case
Thank you for roam-code, it's hugely valuable.
Problem:
My agents do a poor job of using the more advanced cli calls successfully on the first one or two attempts.
eg:
+ Thought: Inspecting code details · 1.8s
$ roam grep "reasoningEffort" -C 4 --max-packets 30
Usage: roam grep [OPTIONS] [POSITIONAL]
Try 'roam grep --help' for help.
Error: No such option '-C'.
$ roam grep --help
Usage: roam grep [OPTIONS] [POSITIONAL]
Context-enriched grep with reachability, clone, and bridge annotations.
Examples:
roam grep "TODO" # single pattern
roam grep -e foo -e bar # multi-pattern alternation
roam grep --patterns-from todo.txt
roam grep -e auth -e cookie --co-occur # both must hit same symbol
roam grep -e auth_check --missing-pattern is_admin
roam grep "DATABASE_URL" --reachable-from main
roam grep "deprecated" --unreachable # only in dead code
roam grep "format_name" --rank-by importance --group-by symbol
See also ``search`` (FTS5 symbol search), ``refs-text`` (literal-string
audit with verdict), and ``history-grep`` (through-history pickaxe).
$ roam grep -e reasoningEffort -e xhigh -e variant -n 100 -s --rank-by importance --group-by symbol
VERDICT: 2703 matches in 441 files for 3 patterns
=== 1723 groups ===
packages/ui/src/components/toast.stories.tsx:105 in const Promise (1 hits) [pr=0.0036]
L105: variant="secondary"
packages/app/src/pages/session.tsx:856 in fn Page (3 hits) [pr=0.0025]
L856: variant: "error",
L1180: variant="ghost"
packages/ui/src/components/list.tsx:287 in fn List (2 hits) [pr=0.0017]
…
Proposed solution
provide a roam-axi, see: AXI https://github.com/kunchenguid/axi
AXI would provide an Agent optimized CLI interface and hopefully make roam calls more reliable and less expensive.
Alternatives considered
Write better skill docs and/or use a stronger model.
Category
Developer Experience
Additional context
No response
Thanks, Derek — the examples are really helpful. I agree that agents shouldn't have to burn several attempts guessing how a search command works.
-C and -h are supported now. I'm taking the remaining feedback into the release currently being tested: an explicit --max-results option, clearer counts for groups shown versus omitted, and a short guide recommending readable long options. For example: roam --json grep "reasoningEffort" --context 4 --max-results 5 --max-packets 3.
Trying this on Roam itself also exposed a more serious case: a search-engine error could turn into a clean-looking “no matches.” I'm fixing that shared path too, including the commands that use search to advise about deletion.
The AXI principles are useful input here. I'll keep the broader request open rather than claim these changes amount to a complete AXI interface. More examples of calls that confuse an agent would be very welcome.
A release update: 14.0.1 is available now, with a fix for the runaway grouped grep output. --max-results now bounds the displayed groups as well as the match list, and the response tells you how many matches and groups were omitted.
For a bounded call with nearby source, this form is supported:
roam --json grep "reasoningEffort" --max-results 30 --context 4 --max-packets 8
-C 4 also works. The context-packet cap accepts 1–20, so the original --max-packets 30 needs a smaller value. We added an agent CLI guide explaining these limits and the short options that differ from ordinary grep.
I've checked the published package's bounded search and context output on this repository too. This addresses the concrete output problem you showed, but it isn't a new AXI interface, so I'm keeping the broader request open. Thanks for highlighting the first-try experience—it's a useful standard for the rest of the CLI as well.
Another useful piece for automation is now in 14.0.2: setting ROAM_NO_AUTO_INDEX=1 keeps a read command from quietly building an index. In JSON mode, Roam explains what's missing in a structured response, while roam index remains the explicit build step.
This is covered by CLI/MCP tests and fresh-install checks. Keeping the issue open because these are incremental improvements, not the whole interaction model proposed here.