Skip to content

Instantly share code, notes, and snippets.

@fepegar
Created May 26, 2025 20:50
Show Gist options
  • Save fepegar/faab43bad2bd8035fdd7f2723e558728 to your computer and use it in GitHub Desktop.
Save fepegar/faab43bad2bd8035fdd7f2723e558728 to your computer and use it in GitHub Desktop.
Starship config with modules for uv
[python]
python_binary = ".venv/bin/python"
[custom.uv-version]
description = "The currently installed version of uv"
shell = "bash"
detect_files = [
".python-version",
"Pipfile",
"__init__.py",
"pylock.toml",
"pyproject.toml",
"requirements.txt",
"setup.py",
"tox.ini",
"uv.lock",
]
style = "bold fg:#dffe7c"
symbol = "by"
command = '''
if ! command -v uv >/dev/null; then
exit 1
fi
uv_version=$(uv --version | awk '{print $2}')
emoji=⚡️
printf "%s v%s" "$emoji" "$uv_version"
'''
format = "$symbol [($output )]($style)"
[custom.uv-lock]
description = "Symbol representing the state of the lock file"
shell = "bash"
style = "bold fg:#cf67e2"
detect_files = [
".python-version",
"Pipfile",
"__init__.py",
"pylock.toml",
"pyproject.toml",
"requirements.txt",
"setup.py",
"tox.ini",
"uv.lock",
]
command = '''
if ! command -v uv >/dev/null; then
exit 1
fi
suffix=""
if uv lock --check-exists >/dev/null; test $? -eq 2; then
suffix="?"
elif uv lock --check >/dev/null; test $? -eq 2; then
suffix="!"
fi
if [ -n "$suffix" ]; then
printf ["$suffix"]
fi
'''
format = "[($output )]($style)"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment