Use gh CLI token as fallback for private plugin marketplaces

Resolved 💬 1 comment Opened Jan 14, 2026 by opeled Closed Jan 14, 2026

Feature Request

When adding a plugin marketplace from a private GitHub repository, Claude Code requires the GITHUB_TOKEN environment variable to be set.

It would be convenient if Claude Code could automatically use the token from gh CLI (gh auth token) as a fallback when GITHUB_TOKEN isn't set.

Current behavior

/plugin marketplace add user/private-repo
Error: Failed to clone marketplace repository: HTTPS authentication failed. 
For private repos, set GITHUB_TOKEN, GITLAB_TOKEN, or BITBUCKET_TOKEN environment variable.

Proposed behavior

If GITHUB_TOKEN is not set but gh CLI is installed and authenticated, automatically use gh auth token to authenticate.

Workaround

Users can currently work around this by running:

export GITHUB_TOKEN=$(gh auth token)

But automatic detection would provide a smoother experience for users who already have gh CLI configured.

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗