API Reference
CLI
agnix [OPTIONS] [PATH]
Options
| Flag | Description |
|---|---|
[PATH] | Directory or file to validate (default: .) |
--target <TOOL> | Single tool focus (generic, claude-code, cursor, codex, kiro) |
--fix | Apply HIGH and MEDIUM confidence fixes |
--dry-run | Preview fixes without modifying files |
--fix-safe | Apply only HIGH confidence fixes |
--fix-unsafe | Apply all fixes, including LOW confidence fixes |
--show-fixes | Show proposed fix diffs in text output |
--format <FMT> | Output format: text (default), json, sarif |
--strict | Treat warnings as errors (exit code 1) |
--config <PATH> | Config file path (default: .agnix.toml) |
--watch, -w | Watch mode - re-validate on file changes |
--locale <LOCALE> | Set output locale, e.g. en, es, zh-CN |
--list-locales | List supported locales and exit |
--max-files <N> | Maximum number of files to validate |
--verbose, -v | Verbose output |
--version | Print version |
--help | Print help |
Subcommands
| Command | Description |
|---|---|
agnix validate [PATH] | Validate agent configs explicitly |
agnix init | Initialize 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 check | Check configured tool versions |
agnix tools detect | Detect 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:
| Tool | Description |
|---|---|
validate_file | Validate a single configuration file |
validate_project | Validate all config files in a project |
get_rules | List all available validation rules |
get_rule_docs | Get documentation for a specific rule |
LSP server
cargo install agnix-lsp
agnix-lsp
Supported LSP capabilities:
textDocument/publishDiagnostics- real-time validationtextDocument/codeAction- auto-fix suggestionstextDocument/hover- rule documentation on hoverworkspace/didChangeConfiguration- runtime config updatesworkspace/executeCommand- project-level validation (agnix.validateProjectRulescommand)
References
- SPEC.md - full technical specification
- MCP Protocol - MCP specification