astral-sh / uv

An extremely fast Python package and project manager, written in Rust.
https://docs.astral.sh/uv
Apache License 2.0
19.93k stars 591 forks source link

`uv tool list` might have a `--plain` flag to only list names? #5183

Open baggiponte opened 1 month ago

baggiponte commented 1 month ago

This might be a request of a solution for the wrong problem. Since I cannot install (or upgrade) multiple tools with uv tool, I thought of using a bit of a hack:

for tool in $(uv tool list); do
    uv tool uninstall $tool && uv tool install $tool
done

However, uv tool list doesn't simply print all tools, but also their entrypoints. Maybe a --plain or --tools-only or --no-entrypoints flag might do?

I remember opening a similar feature request for rye to accept multiple packages at once, but Armin correctly pointed out the executable would not be able to handle the options/flags.

zanieb commented 1 month ago

We're intending to address bulk operations some other way e.g. uv tool upgrade --all.

I wouldn't mind adding a --no-show-executables flag though; similar to how we just added a --show-paths flag in #5164

zanieb commented 1 month ago

Note I think you can also do uv tool install <name> --upgrade and skip the uninstall?

baggiponte commented 1 month ago

Note I think you can also do uv tool install <name> --upgrade and skip the uninstall?

Totally forgot about that. Thanks 😬

Feel free to close the issue whenever you want! And thanks again.

charliermarsh commented 1 month ago

I still think tool list --plain or similar would need to include versions though.

zanieb commented 1 month ago

Yeah idk, --no-show-executables and --no-show-versions?. Eventually it just makes sense to create a JSON output format.

saaketp commented 1 month ago

For comparison, pipx list has --short to show only packages and versions without the entrypoints, and --json for json output.