Repository navigation
feat(cli): add new pixi global tree command - #4427
Merged
Merged
Conversation
tweak(cli): filter virtual packages from pixi tree command
# Conflicts: # crates/pixi_cli/src/global/tree.rs # crates/pixi_cli/src/lib.rs # crates/pixi_cli/src/tree.rs
baszalmstra
approved these changes
Aug 25, 2025
Contributor
|
Works on my machine! :) |
ruben-arts
approved these changes
Aug 25, 2025
ruben-arts
left a comment
Contributor
There was a problem hiding this comment.
Thank you, this is a great addition! I've add some tests and it all seems to work great!
ruben-arts
enabled auto-merge (squash)
August 25, 2025 08:37
tdejager
added a commit
to tdejager/pixi
that referenced
this pull request
Aug 25, 2025
Co-authored-by: Tim de Jager <[email protected]> Co-authored-by: Ruben Arts <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #3975
This pull request introduces a new global command,
pixi global tree. The behavior is very similar topixi tree, but it works on global environments.It is required to pass an argument representing the environment to target, like
pixi global list.The implementation was extracted from the one existing for
pixi tree, with some attempts at simplifying and documenting to make maintenance on it easier.Example screenshots:

I also included a small tweak to reduce the verbosity of the output slightly by filtering virtual packages (such as
__osx), which I believe to be of little use for users of this command. This tweak was applied both to the new command and to the workspace-specific tree command.Just like the workspace-specific tree command, I've also allowed the possibility of printing dependent trees / reverse dependency trees by passing the
--invertflag and specifying a regex to filter the packages to show.Two assumptions I'd like confirmation on, since this is my first code PR to Pixi and I'm not knowledgeable of package managers / Conda:
--pypiflag inpixi global add. I initially assumed this was possible, e.g. if I wanted a global environment with a Jupyter Notebook with specific Pypi dependencies that aren't available on Conda.conda-metafolder. From some basic manual tests, the output looks correct, but I'm not sure whether there is some edge case or nuance I'm missing.I'm contributing to Pixi both because the project is really useful imo, but I also want to keep/improve my Rust skills, so please feel free to point out any issue or possible improvement during the review! Even though most of the code is "recycled" from the current implementation of
pixi tree:)Edit: I just saw another PR related to the tree command: #4261. This PR may conflict with that one. I'm not sure if the PR is still active or not. If my PR is merged first, it might be a good idea to add the json format to the global tree command for consistency.