Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

uv tool run suggest valid commands when command is not found #4997

Merged
merged 8 commits into from
Jul 12, 2024

Conversation

blueraft
Copy link
Contributor

@blueraft blueraft commented Jul 11, 2024

Summary

Resolves #4979.

Test Plan

cargo test

Screenshot 2024-07-11 at 22 45 36 Screenshot 2024-07-11 at 22 45 23

@T-256
Copy link
Contributor

T-256 commented Jul 11, 2024

Screenshot 2024-07-11 at 21 18 05

As new user I expect to hint about --from when not used:

However, the following executables are available via `uvx --from fastapi-cli <EXECUTABLE>`:
    - fastapi.exe

@blueraft
Copy link
Contributor Author

Screenshot 2024-07-11 at 21 18 05

As new user I expect to hint about --from when not used:

However, the following executables are available via `uvx --from fastapi-cli <EXECUTABLE>`:
    - fastapi.exe

Thanks! that makes sense, I went with uv tool run --from cmd <EXECUTABLE> instead because uvx is just an alias.

@charliermarsh charliermarsh self-assigned this Jul 12, 2024
@charliermarsh charliermarsh added enhancement New feature or request cli Related to the command line interface preview Experimental behavior labels Jul 12, 2024
@charliermarsh
Copy link
Member

Nice, thanks!

@charliermarsh charliermarsh enabled auto-merge (squash) July 12, 2024 01:46
@charliermarsh charliermarsh merged commit 23c6cd7 into astral-sh:main Jul 12, 2024
49 checks passed
if has_from {
writeln!(
printer.stdout(),
"However, the following executables are available:",
Copy link
Contributor

@j178 j178 Jul 12, 2024

Choose a reason for hiding this comment

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

Are executables from sub-depencencies considered as available? For instance, uv tool run --from fastapi, uvicorn is also an available executable, but it is not listed here.

Copy link
Member

Choose a reason for hiding this comment

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

I think we'll want a separate flag to opt-in to that, per #4994

Maybe we should even warn or error if someone uses an executable that's not provided by the --from package?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cli Related to the command line interface enhancement New feature or request preview Experimental behavior
Projects
None yet
Development

Successfully merging this pull request may close these issues.

uvx should suggest valid commands when command is not found
5 participants