mirror of
https://github.com/oven-sh/bun
synced 2026-02-09 10:28:47 +00:00
## Summary This PR makes `bun list` an alias for `bun pm ls`, allowing users to list their dependency tree with a shorter command. ## Changes - Updated `src/cli.zig` to route `list` command to `PackageManagerCommand` instead of `ReservedCommand` - Modified `src/cli/package_manager_command.zig` to detect when `bun list` is invoked directly and treat it as `ls` - Updated help text in `bun pm --help` to show both `bun list` and `bun pm ls` as valid options ## Implementation Details The implementation follows the same pattern used for `bun whoami`, which is also a direct alias to a pm subcommand. When `bun list` is detected, it's internally converted to the `ls` subcommand. ## Testing Tested locally: - ✅ `bun list` shows the dependency tree - ✅ `bun list --all` works correctly with the `--all` flag - ✅ `bun pm ls` continues to work (backward compatible) ## Test Output ```bash $ bun list /tmp/test-bun-list node_modules (3) └── react@18.3.1 $ bun list --all /tmp/test-bun-list node_modules ├── js-tokens@4.0.0 ├── loose-envify@1.4.0 └── react@18.3.1 $ bun pm ls /tmp/test-bun-list node_modules (3) └── react@18.3.1 ``` 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Bot <claude-bot@bun.sh> Co-authored-by: Claude <noreply@anthropic.com>