2.8 KiB
2.8 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 inputjson: 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_TOKENGITEA_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
3) Show current document version
gitea-pr-review version
# v1
Skill For LLMs
This repository includes a reusable skill for other LLMs to operate this CLI correctly:
- Path:
skills/gitea-pr-review-cli/SKILL.md - Scope: standardized usage of
fetch/render-md/version,v1version contract, and troubleshooting - Path:
skills/organized-feedback/SKILL.md - Scope: organize
gitea-pr-reviewPR comments into structured feedback with coverage auditing and unknown-item handling
Markdown Output Shape (Example)
# <repo> `#<pr-index>` <pr-title>
> Numbering: Review `<pr>.<review>`; Comment `<pr>.<review>.<comment>`; Reply `<pr>.<review>.<comment>.<reply>`
> version: v1
> fetched at: <fetch-time-rfc3339>
<pr description>
## Metadata
### Commits
- <sha-short> <title> (<author>, <date>)
### Diff Stat
total: <files_changed> files, +<additions>, -<deletions>
- <file-path>: +<additions>, -<deletions>
## Review <pr-index>.<review-seq> (<review-state>)
> <reviewer>
### Comment <pr-index>.<review-seq>.<comment-seq>
<file>:<line>
<user>:
```md
<original comment body>
```
### Reply <pr-index>.<review-seq>.<comment-seq>.<reply-seq>
<file>:<line>
<user>:
```md
<original reply body>
```
Notes
- Output goes to
stdoutby default; use--outto write a file. - The renderer preserves markdown-heavy comment bodies safely by adjusting code fences when needed.
- Both
CommentandReplyinclude their directly associated file path and line number (when provided by the API).