Skip to content

feat(run): prefer local bins for run and dlx#502

Merged
jdx merged 4 commits intomainfrom
codex/run-dlx-local-bin
May 3, 2026
Merged

feat(run): prefer local bins for run and dlx#502
jdx merged 4 commits intomainfrom
codex/run-dlx-local-bin

Conversation

@jdx
Copy link
Copy Markdown
Contributor

@jdx jdx commented May 3, 2026

Summary

  • let aube run <name> fall back to node_modules/.bin/<name> when no package script matches
  • make aube dlx / aubx prefer an installed local binary unless -p / --package is used
  • document the script/bin precedence in README, package-manager docs, and CLI reference output

Validation

  • cargo fmt --check
  • cargo test -p aube dlx
  • cargo test -p aube allow_build_review_tests
  • mise run test:bats test/run.bats
  • mise run test:bats test/dlx.bats
  • cargo clippy -p aube --all-targets -- -D warnings

Note

Medium Risk
Changes command-resolution behavior for aube run/aube dlx to execute local node_modules/.bin entries in more cases, which could affect existing automation that relied on throwaway installs or missing-script failures.

Overview
Changes CLI command resolution to prefer local project binaries. aube run <name> now falls back to executing node_modules/.bin/<name> when no package.json script matches (including filtered/recursive and --parallel runs).

Updates aube dlx/aubx behavior to avoid unnecessary throwaway installs. When --package is not provided (and not in --shell-mode), dlx will run an already-installed local bin if present; versioned/non-registry specs bypass this shortcut.

Documentation and generated CLI reference output are updated accordingly, and new bats tests cover local-bin preference and the version-spec bypass.

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

@greptile-apps
Copy link
Copy Markdown

greptile-apps Bot commented May 3, 2026

Greptile Summary

This PR wires in two new resolution shortcuts: aube run <name> falls back to node_modules/.bin/<name> when no matching package script exists, and aube dlx / aubx prefers an installed local binary before falling back to a throwaway install (bypassed by -p/--package). Both previously-flagged issues are resolved: all three run code paths (non-filtered, sequential filtered, parallel filtered) now include the bin fallback with a correctly-placed ensure_installed call, and resolve_exec_shim is consolidated in exec.rs and invoked by both exec_bin and exec_bin_status, covering Windows shim resolution in the new dlx local-bin fast path.

Confidence Score: 5/5

Safe to merge — all previously-identified gaps are addressed and the new code paths are covered by bats tests.

No P0 or P1 findings. The two issues raised in previous review threads (filtered-run bin fallback and Windows shim in dlx fast path) are both fixed. ensure_installed placement is correct across all paths, and the --if-present / bin-fallback ordering change is intentional and validated by a dedicated bats test.

No files require special attention.

Important Files Changed

Filename Overview
crates/aube/src/commands/run.rs Bin fallback added to all three code paths (non-filtered, sequential filtered, parallel filtered); ensure_installed is correctly placed before the bin check in every path.
crates/aube/src/commands/dlx.rs Local-bin fast path added when no explicit package spec is given; delegates to exec_bin (which now calls resolve_exec_shim), so Windows shim resolution is covered. resolve_exec_shim moved to exec.rs.
crates/aube/src/commands/exec.rs resolve_exec_shim moved here from dlx.rs and made pub(crate); exec_bin and exec_bin_status now both call it, fixing Windows shim execution. Tests migrated correctly.
test/run.bats Comprehensive bats tests added for non-filtered fallback, --if-present fallback, sequential filtered fallback, and parallel filtered fallback.
test/dlx.bats Tests added for local-bin preference and for version-spec bypass of the local-bin shortcut; both cases well-exercised.

Reviews (3): Last reviewed commit: "fix(dlx): respect explicit version specs" | Re-trigger Greptile

Comment thread crates/aube/src/commands/run.rs
Comment thread crates/aube/src/commands/dlx.rs Outdated
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 716e222. Configure here.

Comment thread crates/aube/src/commands/dlx.rs
@jdx jdx enabled auto-merge (squash) May 3, 2026 18:28
@jdx jdx merged commit 36f95c6 into main May 3, 2026
18 checks passed
@jdx jdx deleted the codex/run-dlx-local-bin branch May 3, 2026 18:28
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