Repository navigation
Open
Description
Hi @jackfranklin,
I've been using trace-engine-cli and spent some time going through the codebase. I have a list of possible improvements. Before opening a batch of issues, I'd like to check which ones make sense to you and how you prefer to handle them.
Bugs (reproduced locally)
insightsandnavigationssilently ignore--time-range. The option is global, so both commands accept it and return data for the full trace.insightsreportsnavigationId: nulleven when it uses the first InsightSet.- Numeric options are not validated.
tasks --top -5andprofile --bucket 0return empty results with exit code 0, which an agent reads as "nothing found". scansilently skips files it cannot decompress or parse. With a directory containing one valid trace, one truncated.jsonand one corrupt.json.gz,scan <dir> --grep RunTaskreportstotalFilesScanned: 3, totalFilesMatched: 1and exits 0 with no warning, so a broken file looks the same as a file with no matches.
Features
compare <baseline> <candidate>: compare two traces (CWV deltas and rating changes, main thread busy time, long tasks, top function regressions). Useful for before/after checks on a PR.- Cover more insight models.
insightsexposes 5 of the 19 models in the engine (ForcedReflow, DOMSize, LCPDiscovery, DocumentLatency, ImageDelivery and FontDisplay are missing, among others). ExposingstateandmetricSavingswould also help agents prioritize. --format json, and possibly stdin input and--fail-onthresholds for CI.
Tests and infra
- Add a small real Chrome trace with snapshot tests. All fixtures are synthetic, and Dependabot bumps
@paulirish/trace_enginedaily, so a change in the engine's output shape could still pass CI. - Add
"engines": { "node": ">=22" }.scanusesfs.globSync, which is not available in Node 20.
Docs
- A section on how to record a compatible trace (DevTools, Puppeteer, chrome-devtools-mcp).
Would it be OK if I open one issue per item (or only for the ones you're interested in), and then send a PR for each once we agree on the approach in the issue? If you'd prefer to skip some of these or handle them differently, just let me know.
Thanks!
Metadata
Metadata
Assignees
Labels
No labels
Activity
jackfranklin commentedon Nov 9, 2026
Hey, thanks for digging into this!
All the bugs you found are definitely legit and need fixing, so PRs welcome for that.
Feature wise: yes let's chat. I think other than the compare idea, the rest are slam dunks and happy to see PRs. The
compareidea I'm less convinced by immediately, but happy for you to open an issue and we can chat.TL;DR: yes to all of this. Appreciate the help!
Declare Node.js >=22.12.0 in engines and test Node 22 in CI
Reject --time-range where unsupported and validate numeric options
nucliweb commentedon Nov 25, 2026
Progress update. Most of this list is merged, a large part of it thanks to @kurtextrem's work on #14.
Bugs
insightsandnavigationshonor--time-range(Align navigation insights with trace metrics and shift data #17).--time-rangeand--absolute-timestampsare only available on the commands that use them (Scope time range options per command and bound profile bucket count #12).insightsreports the navigation ID it uses (Align navigation insights with trace metrics and shift data #17).--topand--bucket(Expose renderer threads and improve CPU call trees #16),--min-durationand theprofilebucket count (Scope time range options per command and bound profile bucket count #12).scanreports files it cannot read, decompress or parse inskippedFiles(Report trace files that scan cannot read, decompress or parse #23).Features
compare: discussion in Proposal:comparecommand for two traces #10.stateandmetricSavings.--format json(Add JSON output for CLI automation #20).-(Read the trace from stdin when the file argument is - #24).--fail-onthresholds.Tests and infra
enginesfield and Node 22 in CI (Declare Node.js >=22.12.0 engine and test Node 22 in CI #11).Docs
Next, I plan to work on insight coverage and the real-trace snapshot tests. About
--fail-on: with--format json, a CI job can already check thresholds withjq. Do you still want a built-in option, or should we drop it?jackfranklin commentedon Nov 26, 2026
Can you give me an example of what you would pass to
--fail-on? I'm trying to decide how much we should support that honestly vs the flexibility of either:--jsonand parsing that with jq/etcwdyt?
nucliweb commentedon Nov 26, 2026
The idea was a CI gate on Core Web Vitals, something like:
With
--format json, the same checks are onejq -ecall, and its exit code already fails the CI job:So I agree with you.
--fail-onwould add a small threshold syntax to maintain, and it would only cover the fields we choose to support. jq or a custom script is more flexible. Let's drop it. If it helps, I can add these two examples to the README so people who use the CLI in CI can find them.jackfranklin commentedon Nov 26, 2026
SGTM! Let's add to the readme. For any other issues in this list, let's make new child bugs if we don't already and we can chat about them there. Thanks!