Generate AI-friendly PR delta metadata from Azure DevOps pull requests
npm install azpr-deltaGenerate a single AI-ready JSON file describing all changes in an Azure DevOps Pull Request.
az)az devops loginshell
npm install -g azpr-delta
`Usage
`shell
azpr-delta --pr 6138 --out pr-6138.json
`or if you want to use the default output file name (
pr-[pr_number].json):`shell
azpr-delta --pr 6138
`
Metadata Structure
The generated JSON is designed to be easily parsed by Large Language Models. It contains:-
meta: Execution details like PR ID, project name, and generation timestamp.
- pullRequest: The full raw metadata from Azure DevOps (author, reviewers, merge status, etc.).
- iterations: A history of pushes to the PR.
- comparison: Details on exactly which commits/iterations are being compared.
- files: An array of changed files including:
- path: The file location.
- changeType: e.g., "edit", "add", or "delete".
- stats: Count of lines added and removed.
- hunks: Semantic blocks of code changes with context.
- before/after: Snippets of the file content (truncated by default unless --includeFullContent` is used).