-
Notifications
You must be signed in to change notification settings - Fork 0
Add Codex auth TUI, earned resets, and automatic patch maintenance #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| name: CI | ||
|
|
||
| on: | ||
| push: | ||
| branches: [main] | ||
| pull_request: | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| test: | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 15 | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - name: Install system test dependencies | ||
| run: sudo apt-get update && sudo apt-get install -y fzf jq | ||
|
|
||
| - name: Install uv | ||
| run: python -m pip install --disable-pip-version-check uv==0.9.5 | ||
|
|
||
| - name: Check shell syntax | ||
| run: bash -n bin/codex bin/codex-auth install.sh lib/codex-auth/*.sh tests/run.sh | ||
|
|
||
| - name: Run shell tests | ||
| run: bash tests/run.sh | ||
|
|
||
| - name: Sync locked TUI environment | ||
| run: uv sync --project tui --locked | ||
|
|
||
| - name: Run TUI tests | ||
| run: uv run --project tui pytest -q | ||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,16 @@ | ||
| .DS_Store | ||
| *.log | ||
| *.tmp | ||
| *.pyc | ||
| .pytest_cache/ | ||
| .venv/ | ||
| __pycache__/ | ||
| tmp/ | ||
| /reports/ | ||
| /assets/.frames/ | ||
| /node_modules/ | ||
| /auth.json | ||
| /auth-profiles/ | ||
| /auth-backups/ | ||
| /auth-state.json | ||
| /active-profile.json |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| # Changelog | ||
|
|
||
| ## 0.1.0 - 2026-07-10 | ||
|
|
||
| - Added the persistent Textual watch and autoswitch UI. | ||
| - Added safe capture of the current Codex login as a named profile. | ||
| - Added per-profile earned reset counts and confirmed reset redemption. | ||
| - Added generation-bound in-session auth reload support for patched Codex. | ||
| - Added automatic patch rebuilds after official curl-installed Codex updates. | ||
| - Added token-rotation lineage checks, atomic profile writes, and idempotent reset retries. | ||
| - Fixed auto mode treating an invalid or slow unrelated profile as a failed full-pool refresh. | ||
| - Added deterministic synthetic screenshots, GIF/video demos, and Linux CI. |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| # Product | ||
|
|
||
| ## Register | ||
|
|
||
| product | ||
|
|
||
| ## Users | ||
|
|
||
| Codex CLI users who keep several saved ChatGPT auth profiles and need to see quota, choose an account, or leave automatic rotation running from a terminal. The primary user is already in an active coding workflow and needs the auth tool to stay understandable without becoming another process tree to babysit. | ||
|
|
||
| ## Product Purpose | ||
|
|
||
| Codex Rolling Auth keeps the live Codex auth file on a usable saved profile. Success means one persistent screen shows current quota and freshness, manual switching is deliberate, and live automatic switching can run with an inspectable reason and no stale-cache guesswork. | ||
|
|
||
| ## Brand Personality | ||
|
|
||
| Quiet, direct, trustworthy. The interaction reference is `claude-swap`: low chrome, dense readable usage rows, literal state labels, and keyboard behavior that disappears into the task. | ||
|
|
||
| ## Anti-references | ||
|
|
||
| Do not recreate the one-shot `fzf` selector as a full-screen app. Avoid decorative terminal effects, nested panels, ambiguous color-only status, surprise credential changes, generic dashboard copy, and controls whose live or dry-run state is unclear. | ||
|
|
||
| ## Design Principles | ||
|
|
||
| 1. Show the actual state first: active profile, quota, automatic reset time, earned reset count, data age, and reload readiness. | ||
| 2. Make safety visible: passive watch, dry-run auto, and live auto must look and behave differently. | ||
| 3. Keep one source of truth: the TUI renders structured snapshots and typed engine decisions rather than duplicating policy. | ||
| 4. Explain every switch: show the chosen profile, the comparison, and the reason in plain language. | ||
| 5. Stay terminal-native: keyboard-first, compact, stable at narrow widths, and useful without animation. | ||
| 6. Treat earned resets as scarce: refresh before offering one, default confirmation to Cancel, never combine redemption with a hidden profile switch, and preserve idempotency across retries. | ||
|
|
||
| ## Accessibility & Inclusion | ||
|
|
||
| Every action is available from the keyboard. Selection, active state, errors, stale data, and live mode use text or symbols in addition to color. Focus is explicit only when selection is armed. Layout must remain readable in narrow terminals, and state changes must not depend on decorative motion. |
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔒 Security & Privacy | 🟡 Minor | ⚡ Quick win
Set
persist-credentials: falseon the checkout step.actions/checkout@v4persists the GitHub token in.git/configby default. Subsequent shell-script steps in this workflow could inadvertently read it. Addpersist-credentials: falseto prevent credential leakage.🛡️ Proposed fix
📝 Committable suggestion
🧰 Tools
🪛 zizmor (1.26.1)
[warning] 15-15: credential persistence through GitHub Actions artifacts (artipacked): does not set persist-credentials: false
(artipacked)
🤖 Prompt for AI Agents
Source: Linters/SAST tools