CLI Reference
Sheriff provides a command-line interface for starting the MCP server and checking status.
Commands
Section titled “Commands”Start the MCP server using stdio transport:
java -jar sheriff-mcp-1.0.2-all.jar startThe server runs in the foreground and communicates via stdin/stdout (MCP stdio transport). It uses two-phase startup: the MCP transport begins listening immediately, while database initialization happens in the background. Tool calls received before initialization completes return a retry error.
status
Section titled “status”Show current session status:
sheriff statusOutput (when a SARIF file is loaded):
SARIF: qodana.sarif.jsonLoaded: 2026-03-01T10:30:00Issues: 136 total, 115 fixed, 2 skipped, 19 remainingOutput (when no SARIF file is loaded):
No SARIF file loaded--version
Section titled “--version”Show version information:
sheriff --version# Sheriff 1.0.2--help
Section titled “--help”Show help:
sheriff --helpOutput:
Usage: sheriff [-hV] [COMMAND]AI work queue manager for static analysis issues
Commands: start Start the MCP server status Show Sheriff status
Options: -h, --help Show this help message and exit. -V, --version Print version information and exit.Exit Codes
Section titled “Exit Codes”| Code | Meaning |
|---|---|
| 0 | Success |
| 1 | General error |
| 2 | Invalid arguments |
Environment Variables
Section titled “Environment Variables”| Variable | Description | Default |
|---|---|---|
LOG_LEVEL | Logging level | INFO |
Log files are rotated automatically: 10MB max per file, 3 days retention, 50MB total cap.
State Directory
Section titled “State Directory”Sheriff stores its state in .sheriff/ (relative to working directory):
.sheriff/├── sheriff.mv.db # H2 database with issues and progress├── sheriff.log # Application logs└── sheriff.*.log.gz # Rotated log archivesClearing State
Section titled “Clearing State”To reset Sheriff and start fresh:
rm -rf .sheriff/Then reload your SARIF file.