Metadata-Version: 2.4
Name: gitlab-pr-analyzer
Version: 0.9.3
Summary: Intelligent tool for collecting, analyzing, and summarizing GitLab Merge Requests and commits
Home-page: https://example.com/gitlab-pr-analyzer
Author: GitLab PR Analyzer Team
Requires-Python: >=3.8
Description-Content-Type: text/markdown
Requires-Dist: click>=8.1.0
Requires-Dist: rich>=13.0.0
Requires-Dist: requests>=2.31.0
Requires-Dist: python-gitlab>=3.15.0
Requires-Dist: python-dateutil>=2.8.2
Requires-Dist: fuzzywuzzy>=0.18.0
Requires-Dist: python-levenshtein>=0.21.0
Dynamic: author
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: requires-dist
Dynamic: requires-python
Dynamic: summary

## GitLab MR & Commit Analyzer

[中文文档](README.cn.md) | English

A command-line tool for intelligently collecting, analyzing, and summarizing GitLab Merge Requests and commit records.

## Installation & Setup

### Prerequisites
- **Python 3.8+**
- **GitLab access**
  - `GITLAB_HOST` (e.g. `https://gitlab.example.com`)
  - `GITLAB_TOKEN` (PAT with `read_api` or `api` scope)

### Recommended (optional)
- **GitLab CLI (glab)**: recommended for better and faster diff retrieval
  - install and authenticate: `glab auth login`

### Install GitLab CLI (glab)

- **macOS (Homebrew)**:

```bash
brew install glab
glab auth login
```

- **Linux (APT, Ubuntu/Debian)**:

```bash
sudo apt update
sudo apt install -y glab
glab auth login
```

- **Windows (Winget)**:

```powershell
winget install --id GitLab.glab
glab auth login
```

> Daily usage tip: use the short command `glpa` (legacy: `gl-pr-analyzer`, `gl-pr-ai`).

### Install

```bash
pip install gitlab-pr-analyzer
```

### Configuration (Environment Variables)

| Variable | Description | Required |
|----------|-------------|----------|
| `GITLAB_HOST` | GitLab instance base URL | **Yes** |
| `GITLAB_TOKEN` | Personal Access Token | **Yes** |
| `GITLAB_INSTANCE_NAME` | Banner display name | No |
| `CURSOR_AGENT_PATH` | Path to cursor-agent for AI features | No (Yes for AI) |

## Quick Start

```bash
# 0. Check connectivity (recommended after setting env vars)
glpa check

# 1. Interactive Mode (best for starting)
glpa interactive

# project path tip: from a URL like https://gitlab.example.com/group/subgroup/project use: --repo group/subgroup/project

# 2. Search with AI analysis (English output)
glpa search "authentication bug" --ai -r group/subgroup/project

# 3. Search with AI analysis (Chinese output)
glpa search "authentication bug" --ai -cn -r group/subgroup/project

# 4. Collect data
glpa collect --save-json -r group/subgroup/project

# 5. Generate report + export datasets
glpa traverse --days 7 --save-json -r group/subgroup/project

# optional: enable AI analysis for traverse
glpa traverse --days 7 --save-json --ai -cn -r group/subgroup/project
```

For detailed command usage, see [USAGE.md](USAGE.md).

