Proxies pyright-langserver over HTTP. One server per workspace.
npm i -g pyrightVerify: pyright-langserver --version (actually returns the stdio connection error — pyright-langserver has no --version; if you see that error, the binary is reachable).
pyrightconfig.jsonpyproject.tomlsetup.cfgsetup.py
If none found, wrapper uses current working directory.
py-direct start # cwd walk-up
py-direct start /abs/path/to/project # explicit
py-direct call textDocument/documentSymbol \
'{"textDocument":{"uri":"file:///abs/path/to/file.py"}}'
py-direct call textDocument/hover \
'{"textDocument":{"uri":"file:///abs/path/to/file.py"},
"position":{"line":10,"character":5}}'
py-direct call workspace/symbol '{"query":"UserModel"}'Standard LSP 3.17 methods pyright implements:
textDocument/documentSymbol, textDocument/hover, textDocument/definition, textDocument/references, textDocument/implementation, textDocument/typeDefinition, textDocument/completion, textDocument/signatureHelp, textDocument/prepareCallHierarchy, callHierarchy/incomingCalls, callHierarchy/outgoingCalls, workspace/symbol, textDocument/foldingRange, textDocument/semanticTokens/full.
- No config fallback: pyright works against loose
.pyfiles without anypyproject.tomlby treating each file as its own inferred project. Less accurate cross-file type inference but still answersdocumentSymbol/hover. - Stub packages: if your project uses typed stubs (e.g.
types-requests), pyright readspyproject.toml[tool.pyright]config. PintypeCheckingMode,venvPath, etc. there —py-directhas no way to override them per call. - Slow on large projects: cold start re-indexes all
.pyfiles in the workspace. Typical warm latency is sub-100ms; cold can be 1-5s for mid-size repos.
- Cold: 0.1-0.5s (pyright init, per-file lazy-load)
- Warm: ~70ms per call (HTTP round-trip dominates)
~/.cache/py-direct/<workspace-hash>/{pid,port,workspace,log}
Inspect log if startup fails.