Where Does Pyrefly Read Config From?
Pyrefly config lives in pyrefly.toml or pyproject.toml at your project root, with editor settings layered on top.
Last updated
Pyrefly looks for configuration in your project first. It reads pyrefly.toml at the root when present, then falls back to the tool.pyrefly section of pyproject.toml. No project file means defaults, which suits quick scripts but not real codebases.
Editors add their own layer through extension settings, and command line flags beat both for one-off runs. Keep the project file in version control so every checkout behaves the same. Option names have grown across releases, so match them to the Pyrefly version you run.
Where Pyrefly stores this, by platform
[ProjectDir]/pyrefly.toml
Root config for the project. Falls back to the tool.pyrefly table in pyproject.toml when absent. Flags override files for a single invocation.
[ProjectDir]/pyrefly.toml
Same root file layout. Editors on Mac read it through the workspace folder. Keep it beside pyproject.toml to avoid discovery surprises.
[ProjectDir]\pyrefly.toml
Same discovery on Windows. Use forward or back slashes as your editor expects. The fallback table lives in pyproject.toml under tool.pyrefly.
Frequently asked questions
Which Pyrefly config wins when several exist?
The project file wins over editor defaults, and command line flags beat both for a single run. Keep pyrefly.toml in version control so every machine checks the same way. Editors that launch their own server still read the same root file.
Where do I put personal Pyrefly options?
Through the extension settings for your editor, which pass options to the same server. Prefer the project file for anything the team should share. Extension settings suit personal choices like inlay hints.
Notice an outdated path? Let us know.