Skip to main content
Version: 0.12.1

API Reference

CLI

agnix [OPTIONS] [PATH]

Options

FlagDescription
[PATH]Directory or file to validate (default: .)
--target <TOOL>Single tool focus (claude-code, cursor, codex, copilot)
--tools <TOOLS>Comma-separated tool list
--fixApply auto-fixes
--format <FMT>Output format: text (default), json, sarif
--strictTreat warnings as errors (exit code 1)
--config <PATH>Config file path (default: .agnix.toml)
--versionPrint version
--helpPrint help

Subcommands

CommandDescription
agnix schema [--output FILE]Output JSON Schema for .agnix.toml
agnix watch [PATH]Watch mode - re-validate on file changes
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