pixi icon indicating copy to clipboard operation
pixi copied to clipboard

List files of a dependency

Open ahoarau opened this issue 10 months ago • 11 comments

Problem description

In c++ workflows, you sometimes need to understand the layout of a certain package to be able to work with it. I wish there was a pixi show <pkg> --files or similar that allows to list the files installed by a package.

In conda I see the files are listed in .pixi/envs/<environment>/conda-meta/*.json in the "files" key:

  "license": "Zlib",
  "license_family": "Other",
  "md5": "c9f075ab2f33b3bbee9e62d4ad0a6cd8",
  "name": "zlib",
  "platform": "linux",
  "sha256": "5d7c0e5f0005f74112a34a7425179f4eb6e73c92f5d109e6af4ddeca407c92ab",
  "size": 92286,
  "subdir": "linux-64",
  "timestamp": 1727963153079,
  "version": "1.3.1",
  "fn": "zlib-1.3.1-hb9d3cd8_2.conda",
  "url": "https://conda.anaconda.org/conda-forge/linux-64/zlib-1.3.1-hb9d3cd8_2.conda",
  "channel": "https://conda.anaconda.org/conda-forge/",
  "extracted_package_dir": "/home/<user>/.cache/rattler/cache/pkgs/zlib-1.3.1-hb9d3cd8_2",
  "files": [
    "include/zconf.h",
    "include/zlib.h",
    "lib/pkgconfig/zlib.pc",
    "lib/libz.a",
    "lib/libz.so"
  ],

Ideally we could also pass a --remote to list the files from a package not installed locally.

ahoarau avatar Jan 26 '26 14:01 ahoarau

do you also need other fields? or files is enough?

nichtmacho avatar Jan 27 '26 17:01 nichtmacho

For my personal usage, files is enough. It would be great to have the possibility to display absolute/relative file paths.

ahoarau avatar Jan 27 '26 17:01 ahoarau

hello @nichmor @ahoarau , i would like to work on this issue.

gmarav05 avatar Jan 30 '26 04:01 gmarav05

hello @nichmor @ahoarau , i would like to work on this issue.

hey! feel free to take it! and assign me as a reviewer

nichtmacho avatar Jan 30 '26 09:01 nichtmacho

@gmarav05 @nichmor Great ! Do you guys have any idea on the actual api you'd like ?

ahoarau avatar Jan 30 '26 09:01 ahoarau

I would like to see similar API as pixi list does - maybe it outputs it in a table, and you can also export it in json. You can also take inspiration from npm view and uv pip show

nichtmacho avatar Jan 30 '26 13:01 nichtmacho

There is https://github.com/toprinse/pixi-inspect , maybe we can extend that to include more information?

baszalmstra avatar Feb 03 '26 08:02 baszalmstra

rattler-build has this ability. Is that what you need?

baszalmstra avatar Feb 13 '26 10:02 baszalmstra

rattler-build has this ability. Is that what you need?

Close but not exactly. I'm expecting to type the name of the package as I'm writing it in the pixi.toml file. pixi show eigen --files

ahoarau avatar Feb 23 '26 15:02 ahoarau

rattler-build has this ability. Is that what you need?

@baszalmstra i think we should move/copy this functionality in rattler-bin

pavelzw avatar Mar 25 '26 00:03 pavelzw

there is now pixi-browse which allows you to view all files of a conda package. more on the interactive side as of now and fetches the files from your conda channel directly instead of interacting with your environment. but something like pixi exec pixi-browse --matchspec eigen might be interesting for you

pavelzw avatar Mar 25 '26 00:03 pavelzw