feat: integrate gh CLI for protocol config and token auto-discovery#15
Merged
feat: integrate gh CLI for protocol config and token auto-discovery#15
Conversation
- Create gh.rs module for GitHub CLI integration - Read git_protocol from gh config (defaults to https) - Automatically retrieve token from gh auth token if not provided - Make github_token optional in import command - Update git clone URLs based on configured protocol - Add comprehensive tests for all new functionality - Works gracefully without gh CLI installed Co-authored-by: stefreak <139624+stefreak@users.noreply.github.com>
- Remove unused is_gh_available function - Remove unnecessary clone by passing reference - Update function signature to accept Option<&String> Co-authored-by: stefreak <139624+stefreak@users.noreply.github.com>
- Change get_token_with_fallback to accept Option<&str> - Use as_deref() for cleaner Option<String> to Option<&str> conversion Co-authored-by: stefreak <139624+stefreak@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix assumptions in GitHub clone URL handling
feat: integrate gh CLI for protocol config and token auto-discovery
Nov 29, 2025
Owner
|
@copilot fix formatting |
Co-authored-by: stefreak <139624+stefreak@users.noreply.github.com>
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
✅ Implementation Complete
Summary
Successfully integrated GitHub CLI (
gh) to eliminate hardcoded assumptions about user's GitHub configuration.Key Changes
gh.rsmodule for GitHub CLI integrationgit_protocolfromgh configgh auth tokengithub_tokenoptional in CLI argumentsBehavior
With gh CLI:
git_protocolconfig (https/ssh)gh auth tokenWithout gh CLI:
--github-tokenwith helpful error messageQuality Metrics
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.