Installation
All methods for installing ty, adding it to a project, updating it, and integrating it with editors. Load when the user asks how to install ty, add it to a project, or connect it to an editor.
Table of Contents
- Without Installation
- Add to Project with uv
- Global Installation Methods
- Docker
- Shell Autocompletion
- Editor Integration
Without Installation
Run ty directly without installing it:
uvx ty check
Add to Project with uv
Adding ty as a project dev dependency ensures all developers use the same version:
uv add --dev ty
Run with uv:
uv run ty check
Update to latest version:
uv lock --upgrade-package ty
Global Installation Methods
uv tool install
uv tool install ty@latest
Update:
uv tool upgrade ty
Standalone installer (macOS and Linux)
curl -LsSf https://astral.sh/ty/install.sh | sh
# or with wget:
wget -qO- https://astral.sh/ty/install.sh | sh
Specific version:
curl -LsSf https://astral.sh/ty/0.0.18/install.sh | sh
Standalone installer (Windows)
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/ty/install.ps1 | iex"
Specific version:
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/ty/0.0.18/install.ps1 | iex"
pipx
pipx install ty
Update:
pipx upgrade ty
pip
pip install ty
mise
mise install ty
mise use --global ty
GitHub Releases
Download binaries directly from https://github.com/astral-sh/ty/releases.
Docker
Copy the ty binary from the official image:
COPY --from=ghcr.io/astral-sh/ty:latest /ty /bin/
Available image tags:
ghcr.io/astral-sh/ty:latestghcr.io/astral-sh/ty:{major}.{minor}.{patch}(e.g.,ghcr.io/astral-sh/ty:0.0.18)ghcr.io/astral-sh/ty:{major}.{minor}(e.g.,ghcr.io/astral-sh/ty:0.0— latest patch)
Shell Autocompletion
Run the setup command once, then restart the shell or source the config file.
# Bash
echo 'eval "$(ty generate-shell-completion bash)"' >> ~/.bashrc
# Zsh
echo 'eval "$(ty generate-shell-completion zsh)"' >> ~/.zshrc
# fish
echo 'ty generate-shell-completion fish | source' > ~/.config/fish/completions/ty.fish
# Elvish
echo 'eval (ty generate-shell-completion elvish | slurp)' >> ~/.elvish/rc.elv
# PowerShell / pwsh
if (!(Test-Path -Path $PROFILE)) {
New-Item -ItemType File -Path $PROFILE -Force
}
Add-Content -Path $PROFILE -Value '(& ty generate-shell-completion powershell) | Out-String | Invoke-Expression'
Editor Integration
VS Code
Install the ty extension from the VS Code Marketplace.
The extension automatically disables the Python extension's built-in language server (python.languageServer set to "None").
To use ty only for type checking and keep another language server for completions/hover:
{
"python.languageServer": "Pylance",
"ty.disableLanguageServices": true
}
Neovim (nvim-lspconfig, version >= 0.11)
-- Optional settings configuration
vim.lsp.config('ty', {
settings = {
ty = {
-- ty language server settings go here
}
}
})
-- Enable the language server
vim.lsp.enable('ty')
For Neovim < 0.11:
require('lspconfig').ty.setup({
settings = {
ty = {}
}
})
Zed
ty is included out of the box. Enable ty and disable basedpyright in settings.json:
{
"languages": {
"Python": {
"language_servers": [
"ty",
"!basedpyright",
"..."
]
}
}
}
Override ty executable path:
{
"lsp": {
"ty": {
"binary": {
"path": "/home/user/.local/bin/ty",
"arguments": ["server"]
}
}
}
}
PyCharm (version 2025.3+)
- Go to Python | Tools | ty in Settings
- Select the Enable checkbox
- Choose Execution mode:
Interpreter(searches project interpreter) orPath(searches$PATH) - Configure desired options
Any LSP-compatible editor
Start the language server:
ty server
Then configure your editor to connect to the ty LSP server.