Console script (cli)#

Functions:

version_callback(value)

Versioning call back.

main(ctx[, version])

Manage uv virtual environments from central location.

link_virtualenvs_to_workon_home(*[, paths, ...])

Create symlink from paths to workon_home.

list_virtualenvs(*, workon_home[, verbose])

List available central virtual environments

clean_virtualenvs(*, workon_home[, dry_run, ...])

Remove missing broken virtual environment symlinks.

run_with_virtualenv(*, ctx[, venv_name, ...])

Run uv commands using using the named or specified virtual environment.

link_workon_home_to_venv(*[, venv_name, ...])

Create symlink from virtual environment to a local .venv

shell_config()

Use with eval "$(uv-workon shell-config)" or uv-workon shell-config | source for fish shell.

shell_activate(*[, venv_name, venv_path, ...])

Use to activate virtual environments.

shell_cd(*[, venv_name, venv_path, ...])

Command to change to parent directory of virtual environment.

install_ipykernels(ctx, *[, venv_names, ...])

Install ipykernels for virtual environment(s) that contain ipykernel module.

remove_kernels(*[, names, venv_paths, ...])

Remove installed kernels

list_kernels()

List installed kernels.

uv_workon.cli.version_callback(value)[source]#

Versioning call back.

uv_workon.cli.main(ctx, version=<typer.models.OptionInfo object>)[source]#

Manage uv virtual environments from central location.

Create symlink from paths to workon_home.

uv_workon.cli.list_virtualenvs(*, workon_home, verbose=None)[source]#

List available central virtual environments

uv_workon.cli.clean_virtualenvs(*, workon_home, dry_run=False, verbose=None, yes=None)[source]#

Remove missing broken virtual environment symlinks.

uv_workon.cli.run_with_virtualenv(*, ctx, venv_name=None, venv_path=None, resolve=True, workon_home, venv_patterns, use_default_venv_patterns=True, dry_run=False, verbose=None)[source]#

Run uv commands using using the named or specified virtual environment.

For example, use uv-workon run -n my-env -- python ... is translated to uv run -p patt/to/my-env --no-project python .... If an option mirrors one of the command options (-n, etc), pass it after --. Use --dry-run to echo the equivalent command to be run in the shell.

Under the hood, this uses uv run with the environment variables VIRTUAL_ENV and UV_PROJECT_ENVIRONMENT and the option -p all set to the path of the virtual environment, and with the option --no-project.

Create symlink from virtual environment to a local .venv

This is, in a sense, the inverse of the link subcommand. While link links from a virtualenv to workon_home, this links from workon_home to a local .venv. This can then be used (with care) via uv run ....

Note that this is experimental and subject to change.

uv_workon.cli.shell_config()[source]#

Use with eval "$(uv-workon shell-config)" or uv-workon shell-config | source for fish shell.

This will add the subcommand uv-workon activate and uv-workon cd to the shell. Without running shell config, activate and cd will just print the command to screen.

uv_workon.cli.shell_activate(*, venv_name=None, venv_path=None, resolve=False, no_command=False, workon_home, venv_patterns, use_default_venv_patterns=True)[source]#

Use to activate virtual environments.

uv_workon.cli.shell_cd(*, venv_name=None, venv_path=None, no_command=False, workon_home, venv_patterns, use_default_venv_patterns=True)[source]#

Command to change to parent directory of virtual environment.

uv_workon.cli.install_ipykernels(ctx, *, venv_names=None, venv_paths=None, all_venvs=False, display_format='Python [venv: {name}]', no_user=False, resolve=True, workon_home, venv_patterns, use_default_venv_patterns=True, dry_run=False, verbose=None, yes=None)[source]#

Install ipykernels for virtual environment(s) that contain ipykernel module.

uv_workon.cli.remove_kernels(*, names=None, venv_paths=None, missing=False, workon_home, venv_patterns, use_default_venv_patterns=True, dry_run=False, verbose=None, yes=None)[source]#

Remove installed kernels

uv_workon.cli.list_kernels()[source]#

List installed kernels. Interface to jupyter kernelspec list.