Metadata-Version: 2.5
Name: sanityops-cli
Version: 0.1.3
Summary: CLI tool for static defect inspection of AI logical artifacts
Project-URL: Homepage, https://sanityops.org
Project-URL: Documentation, https://sanityops.org
Project-URL: Repository, https://github.com/sanityops-org/sanityops-cli
Project-URL: Issues, https://github.com/sanityops-org/sanityops-cli/issues
Author: Sanityops Team
License: Apache-2.0
License-File: LICENSE
License-File: NOTICE
Keywords: ai,cli,defect-detection,llm,static-analysis
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: Software Development :: Quality Assurance
Requires-Python: >=3.11
Requires-Dist: anyio>=4.0
Requires-Dist: defect-check
Requires-Dist: httpx>=0.27
Requires-Dist: pyyaml>=6.0
Requires-Dist: rich>=13.0
Requires-Dist: sanityops-agent>=0.0.4
Requires-Dist: tomli-w>=1.0
Requires-Dist: tomli>=2.0
Requires-Dist: typer>=0.12
Provides-Extra: dev
Requires-Dist: ruff>=0.6.0; extra == 'dev'
Provides-Extra: test
Requires-Dist: pytest-httpx>=0.30; extra == 'test'
Requires-Dist: pytest>=8.0; extra == 'test'
Description-Content-Type: text/markdown

# Sanityops CLI

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.

**[Documentation](https://sanityops.org)** | **[Report Bug](https://github.com/sanityops-org/sanityops-cli/issues)** | **[Request Feature](https://github.com/sanityops-org/sanityops-cli/issues)**

## Features

- **Multi-level inspection depth** — Choose between L1 (fast), L2 (standard), or L3 (deep) check levels
- **Multiple artifact types** — Inspect System Prompts, Skills, and Tool Schemas
- **CI/CD ready** — Designed for automated pipeline integration
- **Configurable rules** — Customize inspection behavior via YAML configuration

## Installation

### From Curl (Recommended)

**macOS and Linux:**

```bash
curl -fsSL https://downloads.sanityops.org/sanityops-cli/install.sh | bash
```

**Windows PowerShell:**

```powershell
irm https://downloads.sanityops.org/sanityops-cli/install.ps1 | iex
```

For a reviewable PowerShell installation, download the script first:

```powershell
irm https://downloads.sanityops.org/sanityops-cli/install.ps1 -OutFile install.ps1
Get-Content .\install.ps1
.\install.ps1
```

Both installers verify the downloaded binary against `checksums.txt` before installing. They default to user-writable locations (`~/.local/bin` on macOS/Linux and `%USERPROFILE%\.sanityops\bin` on Windows), then add the Windows directory to the user PATH if needed.

### From PyPI

```bash
pip install sanityops-cli
```

### From Source

```bash
git clone https://github.com/sanityops-org/sanityops-cli.git
cd sanityops-cli
pip install -e .
```

## Quick Start

### 1. Initialize Configuration

```bash
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.

### 2. Configure Artifacts

Edit `.sanityops/inspect_config.yaml` to specify your artifacts:

```yaml
project:
  id: <your-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

```bash
# 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
```

### Check Levels

| Level | Description | Use Case |
|-------|-------------|----------|
| L1 | Fast | Quick validation during development |
| L2 | Standard | Default, balanced depth for regular use |
| L3 | Deep | Comprehensive analysis for production releases |

## Documentation

Full documentation is available at [sanityops.org](https://sanityops.org).

## Requirements

- Python >= 3.11
- OpenAI API key (or compatible LLM provider) for defect checking

## Development

### Setup

```bash
# 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

```bash
pytest
```

### Code Style

This project uses [Ruff](https://docs.astral.sh/ruff/) for linting. Run:

```bash
ruff check .
```

## Contributing

We welcome contributions! Please see our [Contributing Guide](CONTRIBUTING.md) for details on:

- Development setup
- Code style guidelines
- Pull request process
- Commit message conventions

## License

This project is licensed under the Apache License 2.0 - see the [LICENSE](LICENSE) file for details.

## Acknowledgments

Built with [Typer](https://typer.tiangolo.com/) and [Rich](https://github.com/Textualize/rich).
