feat(cli): add tree command#2869
Conversation
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…ck steps) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
🦋 Changeset detectedLatest commit: 64fb2dd The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Coverage Report
File Coverage
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Performance Benchmark (Lower is Faster)
|
RomanHotsiy
left a comment
There was a problem hiding this comment.
This seems to only show details about split spec.
I think we need it not about the file strcuture but about the OpenAPI iteslef.
E.g. if there is one spec in one file I would expect affected to still work listing me the path names.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…llback Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Dynamic imports inside the test body made vitest transform the whole untransformed dependency subtree within the test, exceeding the 5000ms per-test budget when istanbul coverage is enabled. Static top-level imports move that cost to the file-load phase, which has no timeout. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Add the `treeview` language to the example code fences in tree.md (matching eject.md / translate.md house style) to satisfy markdownlint MD040. Stop tracking the internal agentic planning/spec docs under docs/superpowers/: they were accidentally committed into the published documentation and caused all vale and linkcheck failures plus most markdownlint errors. Nothing references them; they remain available locally but are no longer published. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
40a8f05 to
f8f3f83
Compare
|
@cursor review |
…b.com:Redocly/redocly-cli into feat/graph-command
5d68424 to
e111d75
Compare
|
@cursor review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
1 issue from previous review remains unresolved.
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit e111d75. Configure here.
adamaltman
left a comment
There was a problem hiding this comment.
How can you control the depth? Full depth seems not so useful to me.
Right now there is no depth control — the command always prints the full tree. It is still finite: recursion stops with the 🔁 emoji (for example I can add Most tree tools print the full depth by default and limit it with a flag. So I would keep the full tree as the default. Or do you prefer a limited default? |


What/Why/How?
Adds a
redocly treecommand that prints the structure of an API description — its paths, operations, and the component$refchains between them — for quick orientation in any API (single- or multi-file) and$refimpact analysis in CI and code review.The default mode renders the document structure (root → paths → operations → component chains), bundling the description first so a multi-file API shows the same full tree as its single-file form;
--uses <component|path|file>shows only the part that depends on the given node, plus an affected-operations summary;--filesswitches to the file-level $ref graph;--formatoutputsstylish(default),json,mermaid, ordot;--output/-owrites any format to a file instead ofstdout.Works fully with OpenAPI 2.0/3.x; AsyncAPI and Arazzo render as a flat list of their top-level $ref'd components.
Reference
Related VSCE issue
Testing
Examples with docs
Screenshots (optional)
Check yourself
Security
Note
Low Risk
New read-only CLI feature built on existing bundle/resolve; no auth or data mutation. Lint config-lint skip is a small behavioral tweak for graph output formats.
Overview
Adds
redocly tree, a new CLI command that visualizes API descriptions as dependency graphs for orientation and$refimpact analysis.Default structure view bundles the spec first, then walks paths → operations → component chains (OpenAPI 2/3); multi-file layouts collapse to the same tree as a single bundled file.
--filesswitches to a cross-file$refgraph and can merge several APIs in one run.--used-byfilters to dependents of a component, path, operation, or file, with flexible matchers (JSON pointers, shorthand ids, bare names) and CI-friendly behavior (warnings on unknown inputs, exit 0). Output supportsstylish,json,mermaid,dot, plus--output.Also skips config-lint when
lintusesmermaidordotformats (same as other single-document formats), documents the command, and adds unit and e2e coverage.Reviewed by Cursor Bugbot for commit e111d75. Bugbot is set up for automated code reviews on this repo. Configure here.