{"library":"pyrefly","title":"Pyrefly","description":"Pyrefly is a fast type checker and language server for Python, developed by Meta and written in Rust. It provides lightning-fast static type checking along with powerful IDE features such as code navigation, semantic highlighting, and code completion. Pyrefly aims to catch type-related errors before runtime, improve code quality, and enhance the developer experience. It is available as a command-line tool and an IDE extension, with new releases typically every Monday and more frequent updates for new features and bug fixes.","language":"python","status":"active","last_verified":"Fri Apr 10","install":{"commands":["pip install pyrefly"],"cli":{"name":"pyrefly","version":"pyrefly 1.0.0"}},"imports":[],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"# 1. Create a new project directory and navigate into it\n# mkdir my_project && cd my_project\n\n# 2. Install Pyrefly (assuming pip is installed and virtual environment is active)\n# pip install pyrefly\n\n# 3. Initialize Pyrefly configuration (creates pyproject.toml or pyrefly.toml)\n# pyrefly init\n\n# 4. Create a sample Python file with a type error (e.g., 'main.py')\n# echo 'def greet(name: str) -> str:\\n    return f\"Hello, {name}\"\\n\\nprint(greet(42))' > main.py\n\n# 5. Run Pyrefly to check for type errors\n# pyrefly check\n\n# Expected output for 'print(greet(42))' should show a type error, e.g.:\n# main.py:3:11: Type mismatch: Expected `str` but got `int`","lang":"bash","description":"This quickstart demonstrates how to install Pyrefly, initialize a project, and run a basic type check on a Python file containing a simple type error. Pyrefly operates as a command-line tool, not typically imported within Python code.","tag":null,"tag_description":null,"last_tested":"2026-04-25","results":[{"runtime":"python:3.10-alpine","exit_code":1},{"runtime":"python:3.10-slim","exit_code":0},{"runtime":"python:3.11-alpine","exit_code":-1},{"runtime":"python:3.11-slim","exit_code":0},{"runtime":"python:3.12-alpine","exit_code":-1},{"runtime":"python:3.12-slim","exit_code":0},{"runtime":"python:3.13-alpine","exit_code":-1},{"runtime":"python:3.13-slim","exit_code":0},{"runtime":"python:3.9-alpine","exit_code":1},{"runtime":"python:3.9-slim","exit_code":0}]},"compatibility":null}