@jonathan0823/pi-sonarqube
SonarQube extension for Pi — run local analysis and browse issues.
Package details
Install @jonathan0823/pi-sonarqube from npm and Pi will load the resources declared by the package manifest.
$ pi install npm:@jonathan0823/pi-sonarqube- Package
@jonathan0823/pi-sonarqube- Version
0.1.3- Published
- Jun 19, 2026
- Downloads
- not available
- Author
- jonathan0823
- License
- MIT
- Types
- extension
- Size
- 162.9 KB
- Dependencies
- 4 dependencies · 0 peers
Pi manifest JSON
{
"extensions": [
"./dist/index.js"
]
}Security note
Pi packages can execute code and influence agent behavior. Review the source before installing third-party packages.
README
pi-sonarqube
A Pi extension to run local SonarQube analysis and browse the resulting issues — all from within Pi.
Requirements
- Pi installed
- A running SonarQube server (e.g.
http://localhost:9000) sonar-scanneravailable in$PATH
Install
pi install npm:@jonathan0823/pi-sonarqube
Or add it to your settings.json:
{
"packages": ["npm:@jonathan0823/pi-sonarqube"]
}
Then /reload in Pi.
Quick start
1. Init project config
Inside a project directory, run:
/sonarqube init
For monorepos, you can point at a path directly:
/sonarqube init apps/web
/sonarqube init apps/api
Pi will ask you for:
- SonarQube server URL (prefilled with
http://localhost:9000) - Project key (default: derived from directory name)
- Token (optional, used when your server requires auth)
The config is saved to <project>/.pi/sonarqube.json.
2. Run analysis
/sonarqube analyze
/sonarqube analyze apps/web
/sonarqube analyze apps/api
Pi will:
- Run
sonar-scanneragainst your server - Wait for the analysis to complete
- Fetch the latest issues
- Return a concise summary
3. Browse issues
/sonarqube issues
/sonarqube issues apps/web
Use Up/Down to move, Enter to preview the affected source code, and Esc to close.
Tip: Tab-complete /sonarqube subcommands and filters in the editor.
4. Open a specific issue
/sonarqube open 3
/sonarqube open apps/web 3
Commands
| Command | Description |
|---|---|
/sonarqube init [path] |
Set up project config for a path |
/sonarqube analyze [target] |
Run analysis for a target or path |
/sonarqube issues [target] |
Browse the latest analysis results for a target |
/sonarqube open [target] <n> |
Preview source at issue #n |
Tool (for the LLM)
The extension also registers a sonarqube tool that the LLM can call with actions:
analyze— run analysisissues— list issuesopen— open an issue with its index
The tool accepts optional issue filters (severities, statuses, types, rules) so the agent can fetch just blocker/critical context.
Use paths directly.
Configuration sources (precedence order)
- Environment variables (highest)
SONARQUBE_URL/SONAR_HOST_URLSONARQUBE_TOKEN/SONAR_TOKENSONAR_PROJECT_KEY
- Project config —
.pi/sonarqube.json(set via/sonarqube init) - Scan properties —
sonar-project.properties - Defaults —
http://localhost:9000, project key from directory slug
Project structure
packages/pi-sonarqube/
├── src/
│ └── index.ts # Extension source + init command + config
├── dist/
│ ├── index.js # Compiled output
│ ├── index.d.ts # Type declarations
│ └── index.js.map # Source map
├── fixtures/
│ ├── issue-project/ # Test project with known issues
│ └── clean-project/ # Test project with no issues
├── README.md
├── LICENSE
├── package.json
└── tsconfig.json
Contributing
See CONTRIBUTING.md.
License
MIT