Created
December 30, 2025 05:26
-
-
Save ochen1/ee1509a9173aea2634261cd9eef8b8a5 to your computer and use it in GitHub Desktop.
Export your gh PRs to a Markdown file for LLM ingestion
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # Export PRs by author AUTHOR to a Markdown file for LLM ingestion | |
| OUTPUT_FILE="AUTHOR-prs-REPO.md" | |
| cat > "$OUTPUT_FILE" << 'EOF' | |
| # Pull Requests by AUTHOR | |
| This document contains all pull requests authored by AUTHOR in the REPO repository. | |
| --- | |
| EOF | |
| gh pr list --repo REPO --author AUTHOR --state all --limit 100 --json number,title,state,createdAt,closedAt,mergedAt,body,url | jq -r ' | |
| .[] | "## PR #\(.number): \(.title)\n\n**State:** \(.state)\n**Created:** \(.createdAt)\n**Closed:** \(.closedAt // "N/A")\n**Merged:** \(.mergedAt // "N/A")\n**URL:** \(.url)\n\n### Description\n\n\(.body // "No description provided.")\n\n---\n" | |
| ' >> "$OUTPUT_FILE" | |
| echo "Exported PRs to $OUTPUT_FILE" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment