OpenAI Auth Switcher Public
Use this skill as the publishable public-track release of the OpenAI auth switcher workflow.
It is designed for OpenClaw administrators who want a web-first, first-run-friendly, release-safe workflow for OpenAI OAuth account takeover, inspection, dry-run validation, controlled switching, and public distribution.
Purpose
Keep the live/internal operator skill and the public distributable skill separated.
This public track must:
- - avoid bundling live runtime state
- avoid bundling auth snapshots, callbacks, backups, or token ledgers from a real machine
- avoid machine-specific hard-coded paths where possible
- document compatibility boundaries explicitly
- provide a release-safe packaging workflow
- keep temporary runtime files inside the skill runtime area, while encouraging important persistent state to live in an external state base via INLINECODE0
Core operating model
Treat OpenClaw OpenAI OAuth switching as a high-sensitivity maintenance workflow.
Always do work in this order:
- 1. Use
install.sh as the default user-facing bootstrap entrypoint. - Run
doctor.py when installation or environment checks fail. - Confirm runtime discovery with
env_detect.py. - Inspect the current runtime before any switch logic.
- Dry-run any target before proposing a write.
- Keep rollback and backup behavior explicit.
- Package only from this public skill directory or from a sanitized staging copy.
Included scripts
Primary public-release scripts:
- -
install.sh — recommended user entrypoint; wraps the web bootstrap into a single shell command - INLINECODE5 — recommended cleanup entrypoint before INLINECODE6
- INLINECODE7 — one-shot web bootstrap for first-run access
- INLINECODE8 — port selection helper (
9527 → 12138 → fallback) - INLINECODE11 — default admin credential generator
- INLINECODE12 — compatibility and environment checks
- INLINECODE13 — OpenClaw path and runtime discovery
- INLINECODE14 — centralized path resolution helpers
- INLINECODE15 — portable runtime inspection
- INLINECODE16 — public-safe slot metadata and local slot files
- INLINECODE17 — rollback helper using explicit backup sources
- INLINECODE18 — controlled switch experiment with backup and rollback
- INLINECODE19 — local token attribution ledger rebuild
- INLINECODE20 — hourly/daily rollup payload for local analytics
- INLINECODE21 — release-safe packager wrapper
Helper modules:
- - INLINECODE22
- INLINECODE23
- INLINECODE24
- INLINECODE25
Compatibility and safety references
Read only as needed:
- -
references/compatibility.md — Python / Node / OpenClaw / OS expectations - INLINECODE27 — path detection and override model
- INLINECODE28 — operator flow and first-run checks
- INLINECODE29 — sensitivity, boundaries, and redaction rules
- INLINECODE30 — publish checklist and forbidden contents
- INLINECODE31 — relation to the internal/live skill
Release rule
Do not publish skills/openai-auth-switcher directly.
Use the public skill directory for ClawHub publication and use a packaging wrapper that rejects runtime data, backups, session callbacks, and credential-bearing files.
Recommended first release positioning:
- - version: INLINECODE33
- tested on OpenClaw INLINECODE34
- tested on Python INLINECODE35
- tested on Node.js INLINECODE36
- Linux-first release
OpenAI Auth Switcher Public
将此技能作为OpenAI认证切换工作流的可发布公共跟踪版本使用。
它专为希望获得Web优先、首次运行友好、发布安全工作流的OpenClaw管理员设计,用于OpenAI OAuth账户接管、检查、空运行验证、受控切换和公开发布。
目的
保持内部/操作员技能与公共可分发技能相分离。
此公共跟踪必须:
- - 避免捆绑实时运行时状态
- 避免捆绑来自真实机器的认证快照、回调、备份或令牌账本
- 尽可能避免特定于机器的硬编码路径
- 明确记录兼容性边界
- 提供发布安全打包工作流
- 将临时运行时文件保留在技能运行时区域内,同时通过OPENAIAUTHSWITCHERPUBLICSTATE_DIR鼓励将重要的持久状态保存在外部状态库中
核心操作模型
将OpenClaw OpenAI OAuth切换视为高敏感性维护工作流。
始终按以下顺序执行操作:
- 1. 使用install.sh作为默认的用户面向引导入口点。
- 当安装或环境检查失败时运行doctor.py。
- 使用env_detect.py确认运行时发现。
- 在任何切换逻辑之前检查当前运行时。
- 在提议写入之前对任何目标进行空运行。
- 保持回滚和备份行为明确。
- 仅从此公共技能目录或经过清理的暂存副本进行打包。
包含的脚本
主要公共发布脚本:
- - install.sh — 推荐的用户入口点;将Web引导封装为单个Shell命令
- uninstall.sh — 在clawhub uninstall之前推荐的清理入口点
- scripts/installwebapp.py — 一次性Web引导,用于首次运行访问
- scripts/pickport.py — 端口选择助手(9527 → 12138 → 回退)
- scripts/generatewebcredentials.py — 默认管理员凭据生成器
- scripts/doctor.py — 兼容性和环境检查
- scripts/envdetect.py — OpenClaw路径和运行时发现
- scripts/paths.py — 集中式路径解析助手
- scripts/inspectruntime.py — 可移植运行时检查
- scripts/profileslot.py — 公共安全的槽元数据和本地槽文件
- scripts/rollbackexperiment.py — 使用显式备份源的回滚助手
- scripts/switchexperiment.py — 带备份和回滚的受控切换实验
- scripts/tokenledger.py — 本地令牌归属账本重建
- scripts/hourlyusage.py — 用于本地分析的每小时/每日汇总负载
- scripts/packagepublicskill.py — 发布安全打包器包装
助手模块:
- - scripts/authfilelib.py
- scripts/probelib.py
- scripts/locklib.py
- scripts/state_lib.py
兼容性和安全参考
根据需要阅读:
- - references/compatibility.md — Python / Node / OpenClaw / 操作系统预期
- references/runtime-discovery.md — 路径检测和覆盖模型
- references/install-and-runbook.md — 操作员流程和首次运行检查
- references/security-model.md — 敏感性、边界和编辑规则
- references/packaging-policy.md — 发布清单和禁止内容
- references/migration-notes.md — 与内部/实时技能的关系
发布规则
不要直接发布skills/openai-auth-switcher。
使用公共技能目录进行ClawHub发布,并使用拒绝运行时数据、备份、会话回调和包含凭据文件的打包包装器。
推荐的首次发布定位:
- - 版本:0.1.0
- 在OpenClaw 2026.3.11上测试
- 在Python 3.11上测试
- 在Node.js 22.x上测试
- Linux优先发布