{"id":49994902,"url":"https://github.com/gabewillen/codextra","last_synced_at":"2026-05-19T07:10:11.734Z","repository":{"id":356573839,"uuid":"1233079257","full_name":"gabewillen/codextra","owner":"gabewillen","description":"Transparent Codex wrapper and account-rotation proxy","archived":false,"fork":false,"pushed_at":"2026-05-19T05:15:47.000Z","size":226,"stargazers_count":10,"open_issues_count":2,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-19T05:57:42.168Z","etag":null,"topics":["cli","codex","golang","openai","proxy"],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gabewillen.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null}},"created_at":"2026-05-08T15:12:15.000Z","updated_at":"2026-05-19T05:15:25.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/gabewillen/codextra","commit_stats":null,"previous_names":["gabewillen/codextra"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/gabewillen/codextra","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gabewillen%2Fcodextra","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gabewillen%2Fcodextra/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gabewillen%2Fcodextra/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gabewillen%2Fcodextra/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gabewillen","download_url":"https://codeload.github.com/gabewillen/codextra/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gabewillen%2Fcodextra/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33205692,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-18T09:27:30.708Z","status":"online","status_checked_at":"2026-05-19T02:00:06.763Z","response_time":58,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli","codex","golang","openai","proxy"],"created_at":"2026-05-19T07:10:09.586Z","updated_at":"2026-05-19T07:10:11.723Z","avatar_url":"https://github.com/gabewillen.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# codextra\n\n`codextra` is a thin wrapper around `codex`.\n\nIt starts a local proxy, launches the real `codex` binary with the proxy URL in\nCodex's `chatgpt_base_url` config override while preserving Codex's\n`/backend-api` base path, and otherwise passes arguments through unchanged. The\nproxy owns account selection and rotation.\n\n`codextra` is intended for switching between paid personal ChatGPT\nsubscriptions that you personally control. **It is not intended to encourage or\nsupport cycling through free accounts, shared accounts, trial accounts, or other\naccounts used to evade usage limits or service terms.**\n\nThis repo intentionally uses only the Go standard library.\n\n## Why Proxy\n\nThis started as a feature added directly to a Codex fork. That worked, but Codex\nmoves quickly and Rust compile times made the fork expensive to keep current.\n\n`codextra` keeps the account-rotation behavior outside the Codex codebase. The\ngoal is to preserve a small maintenance surface: launch Codex normally, point its\nChatGPT backend traffic at a local proxy, and keep rotation policy in this repo\ninstead of repeatedly merging a large upstream project.\n\n## Usage\n\nInstall the latest release on macOS or Linux:\n\n```sh\ncurl -fsSL https://raw.githubusercontent.com/gabewillen/codextra/refs/heads/main/install.sh | sh\n```\n\nInstall the latest release from PowerShell:\n\n```powershell\nirm https://raw.githubusercontent.com/gabewillen/codextra/refs/heads/main/install.ps1 | iex\n```\n\nThe installer requires `codex` to already be installed and available on `PATH`.\nIf your Codex binary lives somewhere else, set `CODEXTRA_CODEX_BIN`:\n\n```sh\ncurl -fsSL https://raw.githubusercontent.com/gabewillen/codextra/refs/heads/main/install.sh | CODEXTRA_CODEX_BIN=/path/to/codex sh\n```\n\n```powershell\n$env:CODEXTRA_CODEX_BIN = \"C:\\path\\to\\codex.exe\"; irm https://raw.githubusercontent.com/gabewillen/codextra/refs/heads/main/install.ps1 | iex\n```\n\nThe installer puts `codextra` in a writable directory already on `PATH` when it\ncan. Override the target directory with:\n\n```sh\ncurl -fsSL https://raw.githubusercontent.com/gabewillen/codextra/refs/heads/main/install.sh | INSTALL_DIR=/usr/local/bin sh\n```\n\n```powershell\n$env:INSTALL_DIR = \"$HOME\\bin\"; irm https://raw.githubusercontent.com/gabewillen/codextra/refs/heads/main/install.ps1 | iex\n```\n\nOr build from source:\n\n```sh\ngo install github.com/gabewillen/codextra/cmd/codextra@latest\n```\n\n```sh\ncodextra [codex args...]\n```\n\n`codextra` intercepts account-management commands and passes everything else\nthrough to `codex`.\n\n```sh\ncodextra login personal-plus\ncodextra login personal-pro --device-auth\ncodextra login --tag\ncodextra --account personal-pro\n```\n\n`login \u003calias\u003e` runs the normal `codex login`, imports the resulting active\nCodex auth from `$CODEX_HOME/auth.json` or `~/.codex/auth.json`, and stores it\nunder the alias. `login --tag` skips the login step and stores the current\nCodex auth, using the auth email as the alias when available and otherwise\nusing the account ID. Use `login --tag \u003calias\u003e` to choose the alias yourself.\nUse aliases for your own paid personal subscriptions; do not use `codextra` to\nmanage pools of free or throwaway accounts.\n\nOnly `login` and the internal `serve-proxy` command are reserved by `codextra`.\nAll other arguments are passed to `codex` unchanged after injecting the\n`chatgpt_base_url` override.\n\nUse `--account \u003calias\u003e` or `--account=\u003calias\u003e` to switch the active codextra\naccount before launching Codex. The flag is consumed by `codextra` and is not\npassed through to `codex`. Selecting an account only updates codextra's account\nregistry; proxied requests get their `Authorization` and `ChatGPT-Account-ID`\nheaders from the active codextra account instead of relying on Codex's\n`auth.json`. `codextra` does not replace `CODEX_HOME`, so Codex session\nhistory, resume state, config, and other local files stay in the normal Codex\nhome. Because Codex still reads the normal `auth.json` locally, UI and status\nmetadata can show the account logged in through Codex itself rather than the\nalias selected with `--account`; proxied model requests still use the selected\ncodextra account.\n\nAfter rotation, Codex's `/status` screen can show mixed account information:\nthe `Account` field comes from Codex's startup auth snapshot, while usage limits\nand model requests come from the currently selected codextra proxy account.\n\nBy default, `codextra` looks for `codex` on `PATH`. Override it with:\n\n```sh\nCODEXTRA_CODEX_BIN=/path/to/codex codextra\n```\n\nThe proxy listens on a random localhost port and forwards to:\n\n```sh\nCODEXTRA_UPSTREAM=https://chatgpt.com\n```\n\nProxy diagnostics are written to `~/.codextra/proxy.log` as structured `slog`\ntext records. The file is capped at 1 MiB by default and truncates before a\nwrite that would exceed the cap.\n\n```sh\nCODEXTRA_PROXY_LOG_MAX_BYTES=1048576\n```\n\nThe proxy stays alive while at least one `codextra` process has an attached\nclient stream open. After the last client disconnects, the proxy exits after a\nshort grace period.\n\n```sh\nCODEXTRA_PROXY_IDLE_GRACE_SECONDS=10\n```\n\nAccount metadata is stored at:\n\n```sh\n~/.codextra/accounts.json\n```\n\nWhen an account becomes temporarily unavailable due to usage availability or\nauthentication state, the proxy can switch to another configured account owned\nby the user.\n\n## Releases\n\nTagged releases are built by GoReleaser for macOS, Linux, and Windows on amd64\nand arm64. Push a `v*` tag to publish a GitHub release with archives and\nchecksums.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgabewillen%2Fcodextra","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgabewillen%2Fcodextra","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgabewillen%2Fcodextra/lists"}