Skip to content

[github] Add support for using the default GitHub CLI authentication #384

Description

@BUR4KBEY

Extension name

github

Description

Currently, the GitHub extension requires users to provide a Personal Access Token through the extension preferences.

The token is stored in Vicinae's storage_data_item SQLite table, and in my current setup the token is stored as plaintext.

It would be useful to support using the authentication credentials from the GitHub CLI (gh) instead of requiring a separate Personal Access Token.

Many developers already authenticate using:

gh auth login

The extension could retrieve the existing authentication token using:

gh auth token

or otherwise integrate with the authentication configuration already managed by gh.

This would provide several benefits:

  • No need to duplicate GitHub credentials.
  • Users can manage authentication in one place using GitHub CLI.
  • Avoid storing an additional Personal Access Token in Vicinae's extension storage.
  • Token rotation and re-authentication would automatically be reflected when using the existing GitHub CLI credentials.

Suggested behavior

Prefer GitHub CLI authentication when gh is installed and authenticated:

GitHub Extension
      │
      ▼
Is `gh` available and authenticated?
      │
   ┌──┴──┐
  Yes    No
   │      │
   ▼      ▼
Use gh    Ask for Personal Access Token
credentials

The existing Personal Access Token preference could remain available as a fallback for users who do not use GitHub CLI.

GitHub itself recommends using GitHub CLI or Git Credential Manager instead of creating additional Personal Access Tokens when possible.

Thank you!

Steps to reproduce

No response

Vicinae version

0.28.1

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions