Repository navigation
feat(github): read the token from GH_TOKEN / GITHUB_TOKEN - #4
Merged
Merged
Conversation
The token is currently only read from ~/.config/uvault/config.toml, so
CI has to write a secret to disk before it can run `uvault status`, and a
developer with `gh auth login` already done still gets:
WARNING: No GitHub token configured in ~/.config/uvault/config.toml.
Using unauthenticated access. You may hit rate limits.
That warning is easy to miss, and unauthenticated GitHub allows 60
requests/hour: running `status` over a project with ~60 VCS dependencies
exhausted the quota partway through and set a 59-minute backoff.
`GH_TOKEN` and `GITHUB_TOKEN` are the names the GitHub CLI and GitHub
Actions already set, so consulting them makes both work with no config
file. The change is purely additive — a token in the user config still
takes precedence, so no existing setup changes behaviour.
Docs updated; three tests cover env, the Actions fallback, and config
precedence. 100% coverage preserved.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 12 12
Lines 1066 1074 +8
=========================================
+ Hits 1066 1074 +8 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
petrus-v
approved these changes
Sep 30, 2026
petrus-v
left a comment
Owner
There was a problem hiding this comment.
Thanks for your feedback and improvement ! this is awesome !
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.
Problem
The token is only read from
~/.config/uvault/config.toml. Two consequences we hit immediately:uvault status.gh auth loginalready done still runs unauthenticated, and the warning is easy to scroll past:That second one bit us for real. Unauthenticated GitHub allows 60 requests/hour; running
statusover a project with ~60 VCS dependencies exhausted the quota partway through and set a 59-minute backoff:I also lost a little time to
XDG_CONFIG_HOMEnot being honoured (read_user_configusesPath.home()), which is fine, but it does mean there's currently no way to supply a token without writing the file.Change
Consult
GH_TOKEN, thenGITHUB_TOKEN, when the user config has no token. Those are the names the GitHub CLI and GitHub Actions already set, so both work with zero configuration.Purely additive: a token in
~/.config/uvault/config.tomlstill wins, so no existing setup changes behaviour. The warning now names the env vars too.