How to try the ty type checker

How to try the ty type checker

This guide shows you how to try out ty, a new static type checker and language server, in your project.

⚠️
ty is pre-alpha software and is not production-ready. You may encounter bugs or incomplete features. It is released for preview and community feedback.

Prerequisites

To proceed, you’ll need uv.

Run Ty on Your Project

Run Ty from the command line

uvx ty check .

This checks all Python files recursively from the current directory.

Use the Ty Language Server

Ty includes a Language Server Protocol (LSP) implementation compatible with modern editors:

VS Code and Cursor

Install the official Ty extension from the Visual Studio Marketplace.

Other LSP-Compatible Editors

Install ty with uv install ty. Configure your editor to launch the ty server using its LSP support.

If you’re using nvim-lspconfig for Neovim, add this block:

lspconfig.ty_ls = {
  default_config = {
    cmd = { "ty", "lsp" },
    filetypes = { "python" },
    root_dir = lspconfig.util.root_pattern("pyproject.toml", ".git"),
  }
}
-- Optional: attach manually
lspconfig.ty_ls.setup{}

For Emacs, add the following to your init file:

(require 'lsp-mode)
(lsp-register-client
 (make-lsp-client
  :new-connection (lsp-stdio-connection '("ty" "lsp"))
  :major-modes '(python-mode)
  :server-id 'ty-lsp))
(add-hook 'python-mode-hook #'lsp)
Last updated on

Please submit corrections and feedback...