- Conciseness: Only add what an LLM agent needs. Avoid fluff.
- LSAP Alignment: Follow Language Server Agent Protocol principles (progressive disclosure, high-density context).
- Verification: Test CLI commands before documenting them.
We use uv for dependency management. Please ensure you have it installed.
-
Sync dependencies:
uv sync
-
Run the CLI in development:
uv run lsp --help
We maintain high standards for code quality and type safety:
- Formatting & Linting: We use
ruff.just lint
- Type Checking: We use
ty check.just check
- Testing: We use
pytest.just test
lsp-cli uses typer for its command-line interface. Commands are defined in src/lsp_cli/__main__.py.
- Define the command using
@app.command(). - Use the
Annotatedpattern for arguments and options (seesrc/lsp_cli/options.py). - Ensure the command uses the
init_clientcontext manager to interact with the background manager. - Format the output using
rich.
The background manager is located in src/lsp_cli/manager/. It uses litestar to provide a UDS-based API for managing LSP clients.
Best practices are organized in skills/lsp-code-analysis/references/ with hierarchical naming:
skills/lsp-code-analysis/references/
├── bp_<category>.md # Category guides (explore, modify, troubleshoot)
├── bp_<category>_<scenario>.md # Specific scenarios
└── bp_<lang>_<domain>.md # Language/domain specific
| Pattern | Use Case | Example |
|---|---|---|
bp_<category>.md |
General category guide | bp_explore.md |
bp_<category>_<scenario>.md |
Specific scenario | bp_modify_refactor.md |
bp_<lang>_<domain>.md |
Language or domain specific | bp_python_django.md, bp_typescript_react.md |
# Initialize from template
just new-bp <category> [scenario]
# Examples:
just new-bp explore # -> bp_explore.md
just new-bp modify api-migration # -> bp_modify_api-migration.md
just new-bp python django # -> bp_python_django.mdThen add an entry to the appropriate table in skills/lsp-code-analysis/SKILL.md or domain indices.
explore— Understanding/navigating codemodify— Changing/refactoring codetroubleshoot— Fixing LSP issues
- Verify
lspcommands work as described - Run project tests:
just test - Repackage:
just package