uv icon indicating copy to clipboard operation
uv copied to clipboard

Does uv run support argcomplete?

Open carlpaten-ivadolabs opened this issue 1 year ago • 1 comments

I can't find in the documentation whether I can use argcomplete to get bash/zsh autocompletion when running uv run myscript.py.

This issue is two things:

  • A documentation bug report
  • A feature request, if uv doesn't have this already

carlpaten-ivadolabs avatar Dec 17 '24 20:12 carlpaten-ivadolabs

Isn't argcomplete for argparse? Our argument parser isn't written in Python.

Please see https://docs.astral.sh/uv/getting-started/installation/#shell-autocompletion

zanieb avatar Dec 17 '24 20:12 zanieb

I believe @carlpaten was asking whether uv plugs into the mechanics of argcomplete when typing uv run myscript.py <TAB>, not uv itself, right? (That's at least what I was looking for when I discovered this issue.)

hoxell avatar Apr 14 '25 08:04 hoxell

Same here.

Example situation with pytest: with python3-argcomplete installed in my Debian 12, and pytest installed in a normal venv, the shell transparently provides completion for pytest (not sure of the exact mechanism, I guess it involves finding $VENV/lib/python3.11/site-packages/_pytest/_argcomplete.py).

Now when using uv:

  • when using uv run, the completion does not seem to delegate command options to its completer
  • when using .venv as a venv, argcomplete does not know about pytest's completion, likely because of the differences with a real venv

ydirson avatar Jun 12 '25 08:06 ydirson