Audit CLI
Scan examples and docs for agent-centric compliance
Check that Python examples and documentation follow agent-centric authoring — an Agent, PraisonAIAgents, or Workflow import and instantiation should appear within the first 40 lines, before low-level module imports.
Quick Start
# Report compliance for examples
praisonai audit agent-centric --scan ./examples
# CI gate — exit non-zero if any file fails
praisonai audit agent-centric --check ./examplesCommand Reference
praisonai audit agent-centric [--scan PATH | --fix PATH | --check PATH] [OPTIONS]| Option | Description |
|---|---|
--scan PATH | Scan path and print compliance report |
--fix PATH | Rewrite non-compliant files, then re-scan |
--check PATH | Scan and exit 1 if any file is non-compliant (CI) |
--json | Output report as JSON |
--line-limit N | Header scan line limit (default: 40) |
--only-examples | Scan Python examples only |
--only-docs | Scan documentation only |
-v, --verbose | List each non-compliant file and reason |
Examples
Scan with verbose output
praisonai audit agent-centric --scan ./examples/python --verboseFix non-compliant files
praisonai audit agent-centric --fix ./examples/python --verboseCI check
praisonai audit agent-centric --check ./docs/features --only-docsJSON output
praisonai audit agent-centric --scan ./examples --jsonCompliance reasons
| Code | Meaning |
|---|---|
A_no_agent_import | No agent-centric import found in header |
B_import_no_instantiation | Import present but no instantiation |
C_low_level_first | Low-level import appears before agent-centric code |
D_too_advanced | Example is too advanced for quick-start placement |
E_wrong_folder | File in wrong folder for its content type |
F_outdated_api | Uses deprecated API patterns |
G_non_runnable | Example cannot run as written |
H_duplicate_quickstart | Duplicate quick-start block |
I_instantiation_too_late | Agent instantiation beyond --line-limit |