Skip to main content

CLI Reference

Complete reference for all Comply commands and flags.

comply check

Run compliance checks against the current git diff.

comply check [OPTIONS]
FlagDefaultDescription
--config PATH.comply.ymlPath to config file
--repo PATH. (current dir)Path to git repository
--rule NAMEAll rulesRun only the named rule
--format TEXTtextOutput format: text or json
--no-colorOffDisable 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]
FlagDefaultDescription
--output PATH.comply.ymlOutput file path
--forceOffOverwrite 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]
FlagDefaultDescription
--config PATH.comply.ymlPath 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

CodeMeaning
0All rules passed or warned; no fail-level violations
1One or more on_fail: fail rules were violated
2Configuration error or invalid arguments

Next steps

Config schema reference for all .comply.yml fields.