Skip to content

feat(cli): add dependency graph query command#380

Merged
jdx merged 3 commits intomainfrom
codex/query-selectors
Apr 29, 2026
Merged

feat(cli): add dependency graph query command#380
jdx merged 3 commits intomainfrom
codex/query-selectors

Conversation

@jdx
Copy link
Copy Markdown
Contributor

@jdx jdx commented Apr 29, 2026

Summary

  • add aube query for local selector-based dependency graph inspection inspired by vlt's dependency selector model
  • support package/name/version/source/license selectors plus direct/transitive flags and JSON/parseable output
  • regenerate usage docs and add BATS coverage for the CLI path

Validation

  • cargo fmt --check
  • cargo test -p aube query::tests
  • cargo test -p aube cli_ordering_tests::test_cli_ordering
  • cargo clippy -p aube --bin aube --bin aubr --bin aubx -- -D warnings
  • mise run test:bats test/query.bats
  • mise run render

Note: cargo clippy --all-targets -- -D warnings still reports the existing items_after_test_module warning in crates/aube/src/commands/install/mod.rs.

This PR was generated by Codex.


Note

Low Risk
Additive CLI feature that only reads existing lockfile data and adds new parsing/output paths; minimal impact on existing commands aside from command dispatch and docs regeneration.

Overview
Adds a new aube query command that reads the local lockfile, walks the reachable dependency graph (optionally scoped by workspace --filter and --prod/--dev roots), and filters packages via a selector expression supporting attribute predicates and pseudo-selectors like :scripts, :bin, :peer, :type(...), and :license(...).

The command can emit human-readable output, tab-separated --parseable rows, or --json output; CLI wiring, usage spec/docs generation (aube.usage.kdl, docs/cli/*), and new BATS coverage are included.

Reviewed by Cursor Bugbot for commit 780bcad. Bugbot is set up for automated code reviews on this repo. Configure here.

@greptile-apps
Copy link
Copy Markdown

greptile-apps Bot commented Apr 29, 2026

Greptile Summary

Adds a new read-only aube query command that walks the resolved lockfile graph and filters packages via a vlt-inspired selector syntax (*, [attr=value], :pseudo, chained and comma-separated groups). The selector parser, BFS traversal, and output formatters are well-implemented; issues flagged in prior review cycles (silent react:prod tokenisation, [bin=x] returning false) are fully addressed with tests.

Confidence Score: 5/5

Safe to merge — new read-only command with no impact on install, publish, or auth paths

Only P2 findings: deprecated missing from the flags() output (cosmetic inconsistency) and potential redundant BFS stack pushes in monorepos (performance, not correctness). All prior P1 issues are addressed.

crates/aube/src/commands/query.rs — specifically the flags() function and BFS stack deduplication in collect_entries

Important Files Changed

Filename Overview
crates/aube/src/commands/query.rs New query command — selector parsing is solid and previous thread issues are addressed; minor: flags() omits deprecated from the flags column, and direct deps may be pushed to the BFS stack multiple times in monorepos
crates/aube/src/main.rs Wires Query variant into the clap enum and dispatch match — straightforward and consistent with other command registrations
test/query.bats Two BATS integration tests covering name-filter and comma-separated selector groups; version assertions are flexible
aube.usage.kdl Adds query command spec consistent with the Rust implementation and docs
docs/cli/query.md Generated docs file — accurate and matches the implementation
docs/cli/commands.json Auto-generated command registry entry — consistent with usage spec and Rust args
docs/cli/index.md Adds aube query link in alphabetical order — correct placement
crates/aube/src/commands/mod.rs Adds pub mod query; — trivial one-liner change

Fix All in Claude Code

Reviews (2): Last reviewed commit: "fix(cli): parse compact query selectors" | Re-trigger Greptile

Comment thread crates/aube/src/commands/query.rs
Comment thread crates/aube/src/commands/query.rs
@jdx jdx merged commit 038e339 into main Apr 29, 2026
17 checks passed
@jdx jdx deleted the codex/query-selectors branch April 29, 2026 14:40
@greptile-apps greptile-apps Bot mentioned this pull request Apr 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant