Skip to content
This repository was archived by the owner on Apr 15, 2026. It is now read-only.

feat(auth): implement hjk auth codex command#27

Merged
jmgilman merged 2 commits intomasterfrom
joshuagilman/jmg-19-implement-hjk-auth-codex-command
Jan 2, 2026
Merged

feat(auth): implement hjk auth codex command#27
jmgilman merged 2 commits intomasterfrom
joshuagilman/jmg-19-implement-hjk-auth-codex-command

Conversation

@jmgilman
Copy link
Copy Markdown
Collaborator

@jmgilman jmgilman commented Jan 2, 2026

Summary

  • Add hjk auth codex command to configure OpenAI Codex CLI authentication
  • Run codex login interactively and store resulting auth.json in macOS Keychain
  • Inject credentials into containers when starting Codex sessions

Implementation

Follows the same pattern as Claude and Gemini auth:

  1. CodexProvider in internal/auth/codex.go handles the login flow and keychain storage
  2. injectAuthToken in run.go passes credentials as CODEX_AUTH_JSON env var
  3. runAgentSetup in manager.go writes ~/.codex/auth.json before starting sessions

Test plan

  • Run hjk auth codex and complete OAuth flow
  • Run hjk run <branch> --agent codex and verify no auth prompt appears
  • just check passes

Closes JMG-19

🤖 Generated with Claude Code

jmgilman and others added 2 commits January 1, 2026 18:37
Add support for OpenAI Codex CLI authentication. The command runs
`codex login` interactively, which opens a browser for ChatGPT OAuth,
then stores the resulting auth.json contents in the macOS Keychain.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add missing credential injection for Codex sessions:
- Add codex case to injectAuthToken to pass CODEX_AUTH_JSON env var
- Add codex case to runAgentSetup to write ~/.codex/auth.json

This ensures the Codex CLI finds its auth.json when running inside
containers, matching the pattern used for Claude and Gemini.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@linear
Copy link
Copy Markdown

linear Bot commented Jan 2, 2026

@jmgilman jmgilman merged commit 3ffddd0 into master Jan 2, 2026
1 check passed
@jmgilman jmgilman deleted the joshuagilman/jmg-19-implement-hjk-auth-codex-command branch January 2, 2026 02:43
jmgilman added a commit that referenced this pull request Jan 3, 2026
Current behavior:
N/A - new feature

New behavior:
Adds support for OpenAI Codex CLI authentication with interactive `codex login` flow that opens browser for ChatGPT OAuth, stores auth.json contents in macOS Keychain, and injects credentials into containers via CODEX_AUTH_JSON environment variable and ~/.codex/auth.json file

Closes: #27
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant