Files
gitea-pr-review/README.en.md
T

2.0 KiB

gitea-pr-review

English documentation | 中文: README.md

gitea-pr-review fetches Gitea Pull Requests and converts them into LLM-friendly documents.

Features

  • Fetch core PR context: title, status, branches, commit list, and basic diff stat
  • Preserve review/comment/reply content in full
  • Two output formats:
    • markdown: ready for direct LLM input
    • json: structured output for automation and post-processing
  • Re-render Markdown from existing JSON without calling Gitea again

Build

cargo build --release
# binary: target/release/gitea-pr-review

Environment Variables

Required for the fetch subcommand:

  • GITEA_PR_CLI_API_TOKEN
  • GITEA_PR_CLI_URL (for example: https://gitea.com)
  • GITEA_PR_CLI_REPO (for example: Origami404/aaa)

Usage

1) Fetch from Gitea (fetch)

# default: markdown to stdout
gitea-pr-review fetch <pr-index>

# json to stdout
gitea-pr-review fetch <pr-index> --format json

# write to file
gitea-pr-review fetch <pr-index> --out pr.md
gitea-pr-review fetch <pr-index> --format json --out pr.json

2) Render Markdown from JSON (render-md)

# to stdout
gitea-pr-review render-md --in pr.json

# to file
gitea-pr-review render-md --in pr.json --out pr.md

Markdown Output Shape (Example)

# <repo> `#<pr-index>` <pr-title>

## Metadata

### Commits
- <sha-short> <title> (<author>, <date>)

### Diff Stat
total: <files_changed> files, +<additions>, -<deletions>
- <file-path>: +<additions>, -<deletions>

## Review 1 (<review-state>)
> <reviewer>

### Comment <pr-index>.<comment-seq>
<file>:<line>
<user>:
```md
<original comment body>
```

### Reply <pr-index>.<comment-seq>.<reply-seq>
<file>:<line>
<user>:
```md
<original reply body>
```

Notes

  • Output goes to stdout by default; use --out to write a file.
  • The renderer preserves markdown-heavy comment bodies safely by adjusting code fences when needed.
  • Both Comment and Reply include their directly associated file path and line number (when provided by the API).