Skip to content

fix: cache github token and handle expiry for gitgo new#88

Merged
Huerte merged 2 commits into
mainfrom
feat/new-commands
Jun 12, 2026
Merged

fix: cache github token and handle expiry for gitgo new#88
Huerte merged 2 commits into
mainfrom
feat/new-commands

Conversation

@Huerte

@Huerte Huerte commented Jun 12, 2026

Copy link
Copy Markdown
Owner

Type

  • Bug fix
  • New feature
  • Documentation
  • Refactor / internal

Overview

the new command was opening the browser to ask for a token every single time. this fixes that by saving the token locally after the first time you paste it. it also catches expired tokens so you dont get stuck with a failing command.

Changes

  • gitgo new: saves the token to gitgo.github-token in your git config so it reuses it next time
  • gitgo new: catches 401 errors from github, deletes the dead token, and automatically asks for a new one
  • gitgo new: opens the classic token page by default so you can select the no expiration option
  • utils/config.py: adds a silent flag to set_config so the raw token doesnt leak into the terminal output

How to Test

  1. pip install -e ".[dev]"
  2. run gitgo new test-repo1 and paste your token when it asks
  3. run gitgo new test-repo2
  4. Expected result: the second run creates the repo immediately without opening the browser or asking for the token again

Checklist

  • I tested my changes locally and they work
  • I updated CHANGELOG.md under the [Unreleased] section
  • I updated README.md (if I added or changed a command)
  • I added or updated tests for my change (if applicable)
  • My change does not break any existing commands (if it does, describe the impact in the Overview)

@Huerte Huerte merged commit f44f41a into main Jun 12, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant