Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 8, 2026

Plan for Scope Comparison Command

This PR adds a command to compare scopes in a provided PAT with the scopes currently requested by the server, stacked on top of PR #1750.

Checklist

  • Reset branch to be based on PR feat: Add list-scopes command using inventory architecture #1750 (copilot/rebuild-scope-handling-features)
  • Create script/compare-scopes script that:
    • Accepts PAT via GITHUB_PERSONAL_ACCESS_TOKEN env var or command-line argument
    • Fetches token scopes from GitHub API using curl
    • Calls script/list-scopes to get required scopes from the server
    • Compares and displays the differences clearly
    • Shows missing scopes (error exit)
    • Shows extra scopes (informational)
    • Handles GitHub Enterprise Server via GITHUB_HOST env var
  • Update script/list-scopes to support being called from another script (already done in PR feat: Add list-scopes command using inventory architecture #1750)
  • Add documentation to README with:
    • New "CLI Utilities" section
    • Usage examples for both list-scopes and compare-scopes
    • Clear explanation of token requirements
  • Test the scripts manually with various configurations
  • Make scripts executable with proper permissions
  • Run linting (passed) and tests (passed) to ensure no breakage
Original prompt

Create a stacked pull request on top of #1750 that adds a command to compare scopes in a provided PAT with the scopes currently requested by the server.

Requirements:

  1. Update scripts to accept a PAT (GITHUB_PERSONAL_ACCESS_TOKEN) and run the following to list scopes present on the token:
curl -sI -H "Authorization: Bearer $GITHUB_PERSONAL_ACCESS_TOKEN" \
  https://api.github.com/user | grep -i x-oauth-scopes
  1. Add or modify script/list-scopes.sh so it also prints the current scopes requested by the server (using the existing inventory architecture referenced in PR feat: Add list-scopes command using inventory architecture #1750).
  2. The stacked PR should introduce a script/command that:
    • Accepts a PAT (env var or argument), fetches and prints token scopes as above.
    • Invokes list-scopes.sh to get current required scopes from the server and prints them.
    • Presents a clear comparison/output so a user can see differences between PAT scopes and required scopes.
  3. Include documentation in README or scripts/usage comments explaining how to run the new command (env var setup, example invocation).
  4. Ensure the new PR is stacked on top of PR feat: Add list-scopes command using inventory architecture #1750 (uses its branch as base).

Notes:

This pull request was created from Copilot chat.


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants