This repo packages a Codex skill for one narrow maintenance task: take the current Codex ChatGPT OAuth session on a machine, sync it into OpenClaw's openai-codex auth stores, install a reusable OPENAI_OAUTH_TOKEN shell helper, and optionally restart the Linux gateway.
sync-openclaw-codex-oauth/Installable Codex skill folder.sync-openclaw-codex-oauth/scripts/sync_codex_oauth_to_openclaw.pyDeterministic sync script used by the skill.sync-openclaw-codex-oauth/references/paths-and-checks.mdFile locations, validation commands, and constraints.
- Read the latest Codex OAuth session from
~/.codex/auth.json - Update
~/.openclaw/agents/main/agent/auth-profiles.json - Update
~/.openclaw/openclaw.jsonauth profile references - Refresh the legacy
~/.openclaw/agents/main/agent/auth.jsonbridge - Install
~/.config/openai-codex-env.zshand source it from common shell startup files - Optionally restart the OpenClaw gateway on Linux, preferring
openclaw gateway restartbefore falling back to the manual launch path
This workflow does not convert a Codex OAuth token into OPENAI_API_KEY. Plain openai/* API-key flows still need a real OpenAI API key. The skill only standardizes the openai-codex/* OAuth path and OPENAI_OAUTH_TOKEN export.
Clone the repo and copy the skill folder into your Codex skills directory:
git clone git@github.com:erain/openclaw-codex-oauth-skill.git
mkdir -p "${CODEX_HOME:-$HOME/.codex}/skills"
cp -R openclaw-codex-oauth-skill/sync-openclaw-codex-oauth "${CODEX_HOME:-$HOME/.codex}/skills/"Ask Codex to use the skill directly:
Use $sync-openclaw-codex-oauth to sync a new Codex OAuth token into OpenClaw on this machine.
Or run the bundled script yourself:
cd sync-openclaw-codex-oauth
python3 scripts/sync_codex_oauth_to_openclaw.py --print-summary
python3 scripts/sync_codex_oauth_to_openclaw.py --restart-gateway --print-summaryopenclaw models list --provider openai-codex --json
openclaw models list --status --json
zsh -lc 'printenv OPENAI_OAUTH_TOKEN | wc -c'Redacted successful-run evaluations live in evals/. Add an entry there when a
real run proves the skill still syncs credentials, validates openai-codex
auth, and reloads the gateway successfully.