CLI Reference
Complete reference for all Comply commands and flags.
comply check
Run compliance checks against the current git diff.
comply check [OPTIONS]
| Flag | Default | Description |
|---|---|---|
--config PATH | .comply.yml | Path to config file |
--repo PATH | . (current dir) | Path to git repository |
--rule NAME | All rules | Run only the named rule |
--format TEXT | text | Output format: text or json |
--no-color | Off | Disable colored output |
Examples
# Check with default config
comply check
# Check with a custom config path
comply check --config /path/to/.comply.yml
# Run a single rule by name
comply check --rule no-print-statements
# Output JSON (useful for scripting)
comply check --format json
JSON output format
When using --format json:
{
"results": [
{
"rule": "no-print-statements",
"status": "PASS",
"message": "No print() calls found in diff"
}
],
"summary": {
"passed": 9,
"warned": 0,
"failed": 0,
"skipped": 0
},
"exit_code": 0
}
comply init
Create a starter .comply.yml in the current directory.
comply init [OPTIONS]
| Flag | Default | Description |
|---|---|---|
--output PATH | .comply.yml | Output file path |
--force | Off | Overwrite existing config |
# Create default config
comply init
# Write to a different path
comply init --output config/comply.yml
# Overwrite existing config
comply init --force
comply mcp
Start the MCP server on stdio transport.
comply mcp
No flags. The server reads from stdin and writes to stdout using the MCP protocol. Intended to be launched by an MCP-compatible client (Claude Desktop, Cursor).
comply validate
Validate a .comply.yml file without running checks.
comply validate [OPTIONS]
| Flag | Default | Description |
|---|---|---|
--config PATH | .comply.yml | Path to config file |
comply validate
comply validate --config custom.yml
Exits with code 0 if the config is valid, 1 if there are errors.
Exit codes
| Code | Meaning |
|---|---|
0 | All rules passed or warned; no fail-level violations |
1 | One or more on_fail: fail rules were violated |
2 | Configuration error or invalid arguments |
Next steps
Config schema reference for all .comply.yml fields.