Use uvx to quickly get started with ty:
uvx ty!!! tip
Adding ty as a dependency ensures that all developers on the project are using the same version
of ty.
Use uv (or your project manager of choice) to add ty as a development dependency:
uv add --dev tyThen, use uv run to invoke ty:
uv run tyTo update ty, use --upgrade-package:
uv lock --upgrade-package tyInstall ty globally with uv:
uv tool install ty@latestTo update ty, use uv tool upgrade:
uv tool upgrade tyty includes a standalone installer.
=== "macOS and Linux"
Use `curl` to download the script and execute it with `sh`:
```console
$ curl -LsSf https://astral.sh/ty/install.sh | sh
```
If your system doesn't have `curl`, you can use `wget`:
```console
$ wget -qO- https://astral.sh/ty/install.sh | sh
```
Request a specific version by including it in the URL:
```console
$ curl -LsSf https://astral.sh/ty/0.0.20/install.sh | sh
```
=== "Windows"
Use `irm` to download the script and execute it with `iex`:
```pwsh-session
PS> powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/ty/install.ps1 | iex"
```
Changing the [execution policy](https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_execution_policies?view=powershell-7.4#powershell-execution-policies) allows running a script from the internet.
Request a specific version by including it in the URL:
```pwsh-session
PS> powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/ty/0.0.20/install.ps1 | iex"
```
!!! tip
The installation script may be inspected before use:
=== "macOS and Linux"
```console
$ curl -LsSf https://astral.sh/ty/install.sh | less
```
=== "Windows"
```pwsh-session
PS> powershell -c "irm https://astral.sh/ty/install.ps1 | more"
```
Alternatively, the installer or binaries can be downloaded directly from [GitHub](#installing-from-github-releases).
ty release artifacts can be downloaded directly from GitHub Releases.
Each release page includes binaries for all supported platforms as well as instructions for using
the standalone installer via github.com instead of astral.sh.
Install ty globally with pipx:
pipx install tyTo update ty, use pipx upgrade:
pipx upgrade tyInstall ty into your current Python environment with pip:
pip install tyInstall ty globally with with mise:
mise install tyTo set it globally:
mise use --global tyInstall ty in Docker by copying the binary from the official image:
COPY --from=ghcr.io/astral-sh/ty:latest /ty /bin/The following tags are available:
ghcr.io/astral-sh/ty:latestghcr.io/astral-sh/ty:{major}.{minor}.{patch}, e.g.,ghcr.io/astral-sh/ty:0.0.20ghcr.io/astral-sh/ty:{major}.{minor}, e.g.,ghcr.io/astral-sh/ty:0.0(the latest patch version)
aspect_rules_lint
provides a Bazel lint aspect that runs ty. See its documentation for setup instructions.
See the editor integration guide to add ty to your editor.
!!! tip
You can run `echo $SHELL` to help you determine your shell.
To enable shell autocompletion for ty commands, run one of the following:
=== "Bash"
```bash
echo 'eval "$(ty generate-shell-completion bash)"' >> ~/.bashrc
```
=== "Zsh"
```bash
echo 'eval "$(ty generate-shell-completion zsh)"' >> ~/.zshrc
```
=== "fish"
```bash
echo 'ty generate-shell-completion fish | source' > ~/.config/fish/completions/ty.fish
```
=== "Elvish"
```bash
echo 'eval (ty generate-shell-completion elvish | slurp)' >> ~/.elvish/rc.elv
```
=== "PowerShell / pwsh"
```powershell
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'
```
Then restart the shell or source the shell config file.