CLI tool for static defect inspection of AI logical artifacts
pip install sanityops-cli Copy PIP instructions
A command-line tool for static defect inspection of AI logical artifacts (System Prompts, Skills, Tool Schemas). Designed for local development and CI/CD integration.
curl -fsSL https://downloads.sanityops.org/sanityops-cli/install.sh | bash Windows PowerShell:
irm https://downloads.sanityops.org/sanityops-cli/install.ps1 | iex For a reviewable PowerShell installation, download the script first:
pip install sanityops-cli From Source git clone https://github.com/sanityops-org/sanityops-cli.git cd sanityops-cli pip install -e . Quick Start 1. Initialize Configuration sanityops-cli init This creates .sanityops/inspect_config.yaml in your current directory with a freshly generated project UUID. The generated file matches the template below — edit the artifact paths to point at your prompts, tools, and skills.
Edit .sanityops/inspect_config.yaml to specify your artifacts:
project: id: # required: UUID # Optional: omit to use LLM_* environment variables # model: # provider: anthropic # api_key: sk-ant-... # model_id: claude-sonnet-4-20250514 # base_url: "" prompts: - file: prompts/system_prompt.md tools: - file: tools/search_tools.json skills: - file: skills/code_review.md # file only, not directories 3. Run Inspection # Standard inspection (L2 depth) sanityops-cli inspect # Fast inspection (L1 depth) sanityops-cli inspect --check-level L1 # Deep inspection (L3 depth) sanityops-cli inspect --check-level L3 # Skip defect check, only analyze artifacts sanityops-cli inspect --skip-defect-check # Use custom config file sanityops-cli inspect --config path/to/config.yaml 4. Generate Repairs (Optional) After inspection, generate repaired artifacts from the report:
# Use the latest inspection report sanityops-cli inspect repair # Use a specific report sanityops-cli inspect repair --report .sanityops/results/inspect-20250115-120000.md # Specify timeout and token budget for large projects sanityops-cli inspect repair --timeout 3600 --token-budget 500000 Repairs are written to .sanityops/repairs/repair- .md without modifying source files.
Manage server-side configuration (base URL, API key) using the config command:
# Read a config value sanityops-cli config server.base_url # Set a global config value sanityops-cli config server.base_url https://api.sanityops.org # Set a project-level config value sanityops-cli config server.base_url https://api.sanityops.org --local # Set API key (prompts for masked input if no value provided) sanityops-cli config server.api_key # List all config values sanityops-cli config --list # Remove a config key sanityops-cli config --unset server.base_url Configuration Precedence Values are resolved in this priority order (highest to lowest):
This ordering ensures CI/CD pipelines can override any project config by injecting environment variables.
You can tune the scanner agent behavior in .sanityops/inspect_config.yaml:
agent: max_loops: 60 # Maximum agent execution loops token_budget: 200000 # Token budget for agent execution timeout: 1800 # Timeout in seconds (default: 1800 = 30min) CLI flags (--timeout, --token-budget) override these values when explicitly set.
All CLI operations are logged to ~/.sanityops/logs/sanityops-cli- .log. Logs include timestamps, log levels, and redacted API keys for security.
Full documentation is available at sanityops.org.
# Clone the repository git clone https://github.com/sanityops-org/sanityops-cli.git cd sanityops-cli # Create virtual environment python -m venv .venv source .venv/bin/activate # On Windows: .venv\Scripts\activate # Install development dependencies pip install -e ".[dev,test]" Run Tests pytest Code Style This project uses Ruff for linting. Run:
ruff check . Contributing We welcome contributions! Please see our Contributing Guide for details on:
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 26, 2026.




