Metadata-Version: 2.4
Name: seanergy-codeguard
Version: 0.2.0
Summary: Pre-commit AI review CLI (PR-Agent + Ollama) with YAML org rules
License: MIT
Requires-Python: >=3.10
Description-Content-Type: text/markdown
Requires-Dist: pyyaml>=6.0
Requires-Dist: pr-agent>=0.2.24

# Seanergy CodeGuard

PR-Agent reviews your staged commit against `main`, using Ollama. Org rules in YAML are passed as extra instructions. Issues can block the commit. Overrides are logged.

## Setup (once)

```bash
cd /Users/srikrishna/Desktop/demo_app
./install-dev.sh
ollama serve
ollama pull qwen2.5-coder:7b
```

The CLI calls `python -m pr_agent.cli --pr_url main review` with `CONFIG__GIT_PROVIDER=local`. It snapshots the git index (so uncommitted staged files are included) and writes the review under `.git/codeguard-review.md`.

## Usage

```bash
git commit -m "your message"
```

If something is flagged, fix it and commit again, or override:

```bash
CODEGUARD_OVERRIDE=1 \
CODEGUARD_OVERRIDE_REASON='why you are overriding' \
git commit -m "your message"
```

Skip once: `CODEGUARD_SKIP=1 git commit -m "your message"`

Ollama must be running (`ollama serve`). If it is not, the commit is blocked. To allow commits when AI is down: `CODEGUARD_AI_OPTIONAL=1`.

## Rules

Org policy is YAML (not the Python prompt):

- Packaged: `seanergy_codeguard/rules/org.yaml`
- Optional in an app repo: `.codeguard/rules.yaml`

Each rule has `id`, `title`, `severity` (`block` or `warn`), `paths`, and `hint`. After changing org YAML, run `./install-dev.sh` (or `pipx install --force .`).

