Skip to content

CLI Reference

Sheriff provides a command-line interface for starting the MCP server and checking status.

Start the MCP server using stdio transport:

Terminal window
java -jar sheriff-mcp-1.0.2-all.jar start

The 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.

Show current session status:

Terminal window
sheriff status

Output (when a SARIF file is loaded):

SARIF: qodana.sarif.json
Loaded: 2026-03-01T10:30:00
Issues: 136 total, 115 fixed, 2 skipped, 19 remaining

Output (when no SARIF file is loaded):

No SARIF file loaded

Show version information:

Terminal window
sheriff --version
# Sheriff 1.0.2

Show help:

Terminal window
sheriff --help

Output:

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.
CodeMeaning
0Success
1General error
2Invalid arguments
VariableDescriptionDefault
LOG_LEVELLogging levelINFO

Log files are rotated automatically: 10MB max per file, 3 days retention, 50MB total cap.

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 archives

To reset Sheriff and start fresh:

Terminal window
rm -rf .sheriff/

Then reload your SARIF file.