Skip to main content
Version: 0.37.3

API Reference

CLI

agnix [OPTIONS] [PATH]

Options

FlagDescription
[PATH]Directory or file to validate (default: .)
--target <TOOL>Single tool focus (generic, claude-code, cursor, codex, kiro)
--fixApply HIGH and MEDIUM confidence fixes
--dry-runPreview fixes without modifying files
--fix-safeApply only HIGH confidence fixes
--fix-unsafeApply all fixes, including LOW confidence fixes
--show-fixesShow proposed fix diffs in text output
--format <FMT>Output format: text (default), json, sarif
--strictTreat warnings as errors (exit code 1)
--config <PATH>Config file path (default: .agnix.toml)
--watch, -wWatch mode - re-validate on file changes
--locale <LOCALE>Set output locale, e.g. en, es, zh-CN
--list-localesList supported locales and exit
--max-files <N>Maximum number of files to validate
--verbose, -vVerbose output
--versionPrint version
--helpPrint help

Subcommands

CommandDescription
agnix validate [PATH]Validate agent configs explicitly
agnix initInitialize a config file
agnix eval <FILE>Evaluate rule efficacy against labeled test cases
agnix schema [--output FILE] [--fix]Output or regenerate JSON Schema for .agnix.toml
agnix tools checkCheck configured tool versions
agnix tools detectDetect installed tool versions
agnix telemetry <status|enable|disable>Manage telemetry settings

Output formats

  • text - Human-readable terminal output with colors
  • json - Machine-readable JSON object with diagnostics and summary metadata (e.g. version, files_checked, diagnostics, summary, category, rule_severity, applies_to_tool)
  • sarif - SARIF format for GitHub Code Scanning integration

MCP server

cargo install agnix-mcp
agnix-mcp

The MCP server exposes these tools:

ToolDescription
validate_fileValidate a single configuration file
validate_projectValidate all config files in a project
get_rulesList all available validation rules
get_rule_docsGet documentation for a specific rule

LSP server

cargo install agnix-lsp
agnix-lsp

Supported LSP capabilities:

  • textDocument/publishDiagnostics - real-time validation
  • textDocument/codeAction - auto-fix suggestions
  • textDocument/hover - rule documentation on hover
  • workspace/didChangeConfiguration - runtime config updates
  • workspace/executeCommand - project-level validation (agnix.validateProjectRules command)

References