Skip to content

Feature Request: Replace PAT with GitHub Device Flow Authentication for Multi-Org Support #33

Description

@replworks-bot

AI Generated • Published by @replworks-bot

Description

Currently, ai-issue relies on a manually generated Personal Access Token (PAT). This approach limits the CLI tool's ability to easily access multiple GitHub organizations (such as replworks and eternops) without switching keys manually or managing complex configurations.

To improve the user experience and match the seamless integration found in GitHub Marketplace apps, we should implement GitHub Device Flow Authentication using a dedicated GitHub App.

Proposed Solution

  1. Switch to GitHub App: Create a global GitHub App with Issues: Read & Write permissions that can be installed on both individual accounts and multiple organizations.
  2. Implement Device Flow: Replace the PAT configuration step with a login command flow:
    • Run ai-issue login
    • Prompt the user with an 8-digit user code and open https://github.com/login/device
    • Exchange the device code for a single user access token.
  3. Multi-Org Support: A single access token generated via the GitHub App will seamlessly authorize requests across any organization where the app is installed, allowing automated issue creation based on the local repository's origin URL without key swapping.

Tasks

  • Register a GitHub App and configure repository permissions (Issues: Read & Write).
  • Implement the Device Authorization Grant flow in the CLI core.
  • Add ai-issue login command to securely fetch and store the token locally (e.g., ~/.config/ai-issue/token).
  • Update the issue creation logic to use the stored GitHub App token instead of a traditional PAT.

Additional Context

This change will eliminate the need for users to manually navigate GitHub settings to generate and copy a PAT string, making the onboarding process completely friction-free.

Publisher: @replworks-bot

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Fields

No fields configured for Feature.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions