Use OAuth for Claude, Gemini, and Codex with Persistent Headless Tmux Sessions

hackernews | | 📦 오픈소스
#claude #codex #gemini #oauth #tmux
원문 출처: hackernews · Genesis Park에서 요약 및 분석

요약

oauth-cli-coder는 별도의 API 키나 인증 절차 없이 기존 터미널의 OAuth 인증을 그대로 활용해 Claude, Gemini, Codex 등의 AI CLI를 제어할 수 있는 오픈소스 도구입니다. 이 도구는 분리된 tmux 세션(300x100 크기)에서 AI CLI를 실행하며, 사용자가 프롬프트를 입력하면 화면을 모니터링하여 응답이 완료될 때까지 기다린 후 결과를 캡처하고 세션을 유지합니다. ask, slash, read 등의 명령어와 모델 선택, 세션 관리 옵션을 제공하여 여러 AI 에이전트에게 서로 다른 역할을 부여하고 결과를 피드백하는 다중 에이전트 파이프라인 구축이 가능합니다.

본문

Drive Claude Code, Gemini CLI, and Codex programmatically — through the same tmux session they already run in. No API keys. No custom auth. If you're logged in on your terminal, oauth-cli-coder can use it. ┌──────────────┐ your code │ tmux pane │ AI CLI ─────────> │ (headless) │ (Writing) -> (Critique) -> (Gap Analysis) ^ | └──────────────────────────────────────────────────┘ # Start four agents with different roles IDEA=$(oauth-coder ask gemini "outline a story about AI" --session-id idea-agent) DRAFT=$(oauth-coder ask claude "$IDEA — expand into prose" --session-id author --model opus) REVIEW=$(oauth-coder ask claude "$DRAFT — critique this" --session-id critic --model sonnet) GAPS=$(oauth-coder ask codex "$DRAFT + $REVIEW — find gaps" --session-id gap-finder) # Feed gaps back for another round oauth-coder ask gemini "refine based on: $GAPS" --session-id idea-agent See examples/ for complete working demos including: creative_chain.py — Python API version with multi-round refinementcreative_chain.sh — Pure shell version | Command | Description | |---|---| oauth-coder ask | Send a prompt and get the response | oauth-coder slash | Run a slash command (/compact , /clear , etc.) | oauth-coder read | Read current screen output without sending anything | oauth-coder list | List all active sessions | oauth-coder stop | Close a specific session | oauth-coder stop-all | Close all sessions | Common options: --model , --cwd , --session-id , --option /-o , --close oauth-coder starts a detached tmux session with a large virtual terminal (300x100)- It launches the CLI tool ( claude ,gemini ,codex ) inside that session - The TUI controller watches the screen and automatically navigates past startup prompts - When you call ask() , it pastes your prompt into the pane via tmux buffers (safe for large inputs) - It polls the screen until the CLI returns to an idle prompt - It captures the full scrollback and parses out the last response block - The session stays alive for the next call By running the actual CLI binary in a real terminal, the tool inherits your existing OAuth tokens, browser sessions, and local config. You authenticate once in your browser — oauth-cli-coder rides on top of that. No API keys, no token management, no separate credentials. Contributions welcome! This project uses: - Python 3.12+ with uv for packaging - pytest for tests - click for the CLI git clone https://github.com/codeninja/oauth-cli-coder.git cd oauth-cli-coder uv sync uv run pytest MIT

Genesis Park 편집팀이 AI를 활용하여 작성한 분석입니다. 원문은 출처 링크를 통해 확인할 수 있습니다.

공유

관련 저널 읽기

전체 보기 →