{"id":50416119,"url":"https://github.com/yuluyangguang1/codex-portable","last_synced_at":"2026-05-31T06:01:15.601Z","repository":{"id":361408119,"uuid":"1245556773","full_name":"yuluyangguang1/codex-portable","owner":"yuluyangguang1","description":"Codex Portable · OpenAI Codex CLI 便携版 · U盘即走 · 零安装 · MIT","archived":false,"fork":false,"pushed_at":"2026-05-30T13:16:23.000Z","size":59,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-30T15:08:58.121Z","etag":null,"topics":["ai-coding","cc-switch","cli","codex","cross-platform","mit","openai","portable","usb","yuai"],"latest_commit_sha":null,"homepage":"https://yuai-r.cn/codex/","language":"Shell","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/yuluyangguang1.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":null,"dco":null,"cla":null}},"created_at":"2026-05-21T10:32:02.000Z","updated_at":"2026-05-30T13:16:27.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/yuluyangguang1/codex-portable","commit_stats":null,"previous_names":["yuluyangguang1/codex-portable"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/yuluyangguang1/codex-portable","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yuluyangguang1%2Fcodex-portable","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yuluyangguang1%2Fcodex-portable/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yuluyangguang1%2Fcodex-portable/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yuluyangguang1%2Fcodex-portable/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yuluyangguang1","download_url":"https://codeload.github.com/yuluyangguang1/codex-portable/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yuluyangguang1%2Fcodex-portable/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33720897,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-31T02:00:06.040Z","response_time":95,"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":["ai-coding","cc-switch","cli","codex","cross-platform","mit","openai","portable","usb","yuai"],"created_at":"2026-05-31T06:01:14.890Z","updated_at":"2026-05-31T06:01:15.595Z","avatar_url":"https://github.com/yuluyangguang1.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Codex Portable\n\n把 [OpenAI Codex CLI](https://github.com/openai/codex)（终端编程 AI Agent）打包成便携版。插上 U 盘即可在任意电脑上运行，无需安装任何依赖。\n\nPack [OpenAI Codex CLI](https://github.com/openai/codex) into a portable edition. Plug in a USB drive and run on any computer with zero dependencies.\n\n---\n\n## 特性\n\n- **零安装** — 不需要 Node.js、Rust 或任何运行时（Codex CLI 是 Rust 编译的单二进制）\n- **零痕迹** — 拔走 U 盘后电脑上不留任何数据\n- **跨平台** — macOS (Apple Silicon + Intel) / Linux x64 / Windows x64\n- **CC Switch 集成** — GUI 配置第三方 OpenAI 兼容 API（中转站、one-api、Azure、DeepSeek 等）\n- **设备绑定** — 防复制保护，便携包只能在原始 U 盘上运行\n- **数据随身** — 对话历史、配置全部存在便携包内\n- **`CODEX_HOME` 隔离** — 启动时显式指向便携目录，与系统 `~/.codex` 隔离\n\n---\n\n## 快速开始\n\n### 使用发布包（推荐）\n\n从 [Releases](https://github.com/yuluyangguang1/codex-portable/releases) 下载 zip，解压到 U 盘或任意目录。\n\n| 平台 | 启动方式 |\n|------|----------|\n| macOS | 双击 `CodexPortable.command` |\n| Windows | 双击 `CodexPortable.bat` |\n| Linux | 运行 `./CodexPortable.sh` |\n\n启动后 CC Switch GUI 自动打开 → 在 Codex 标签添加供应商 → 保存 → Codex CLI 启动。\n\n### macOS 首次运行\n\nmacOS 可能提示\"无法验证开发者\"。解决方法：\n\n1. 右键点击 `CodexPortable.command` → 选择\"打开\" → 弹窗中点\"打开\"\n2. 或终端执行：`xattr -cr /path/to/codex-portable`\n\n---\n\n## 目录结构\n\n```\ncodex-portable/\n  CodexPortable.command    macOS 启动器\n  CodexPortable.bat        Windows 启动器\n  CodexPortable.sh         Linux 启动器\n  bin/                     各平台二进制（CI 构建时下载）\n    macos-arm64/codex\n    macos-x64/codex\n    linux-x64/codex\n    windows-x64/codex.exe\n  data/                    用户数据（gitignore）\n    .cc-switch/            CC Switch 数据库\n    .codex/                Codex CLI 配置和历史（auth.json + config.toml）\n    .lock                  设备绑定锁\n  lib/\n    binding.sh             设备绑定（macOS/Linux）\n    binding.ps1            设备绑定（Windows）\n    check-config.ps1       配置检查（Windows）\n  .github/workflows/\n    build.yml              CI 构建 + 发布\n```\n\n---\n\n## API 配置\n\nCodex CLI 通过 `~/.codex/auth.json` + `~/.codex/config.toml` 两个文件管理配置。CC Switch 自动写入这两个文件。\n\n### 通过 CC Switch（推荐）\n\n启动后 CC Switch GUI 打开，切换到 **Codex** 标签：\n\n- **OpenAI 官方** — 直接填 API Key\n- **第三方中转站** — 填 base_url + API Key\n- **DeepSeek / Kimi / GLM** — 选择对应模板\n- **Azure OpenAI** — 填 endpoint + key + deployment 名\n\nCC Switch 会自动生成 `auth.json` 和 `config.toml`。\n\n### 手动配置\n\n如果不用 CC Switch，可直接编辑：\n\n`data/.codex/auth.json`：\n```json\n{\n  \"OPENAI_API_KEY\": \"sk-...\"\n}\n```\n\n`data/.codex/config.toml`：\n```toml\nmodel_provider = \"custom\"\nmodel = \"gpt-5.4\"\nmodel_reasoning_effort = \"high\"\n\n[model_providers.custom]\nname = \"Custom Provider\"\nbase_url = \"https://your-provider/v1\"\nwire_api = \"responses\"\nenv_key = \"OPENAI_API_KEY\"\n```\n\n---\n\n## 设备绑定\n\n首次成功运行后自动绑定到当前 U 盘。复制到其他设备将无法运行。\n\n解绑（原始所有者）：\n```bash\n# macOS\n./CodexPortable.command --unlock\n\n# Linux\n./CodexPortable.sh --unlock\n\n# Windows\nCodexPortable.bat --unlock\n```\n\n---\n\n## 构建\n\nCI 自动从 [openai/codex releases](https://github.com/openai/codex/releases) 下载预编译二进制，从本仓库的 `cc-switch-assets` release 下载 cc-switch GUI。\n\n手动触发构建：\n```\nGitHub → Actions → Build Codex Portable → Run workflow\n```\n\n打 tag 自动发布：\n```bash\ngit tag v0.1.0\ngit push --tags\n```\n\n本地构建：\n```bash\nbash setup.sh             # 当前平台\nbash setup.sh --all       # 所有平台（U 盘版）\n```\n\n会自动下载 codex 二进制 + cc-switch GUI 到对应的 `bin/` 目录。\n\n---\n\n## 上游项目\n\n- **Codex CLI**：[openai/codex](https://github.com/openai/codex) — Rust 编写的终端编程 Agent，MIT 协议\n- **CC Switch**：[farion1231/cc-switch](https://github.com/farion1231/cc-switch) — 跨平台 AI CLI 配置管理工具，原生支持 Codex\n- **姊妹项目**：[claude-portable](https://github.com/yuluyangguang1/claude-portable) · [openclaw-portable](https://github.com/yuluyangguang1/openclaw-portable) · [hermes-portable](https://github.com/yuluyangguang1/hermes-portable)\n\nPortable 版本的工作：\n- 打包 Rust 编译的 codex 二进制（每个平台独立）\n- 集成 CC Switch 自动写入 `auth.json` + `config.toml`\n- 适配 U 盘便携场景（`CODEX_HOME` 重定向、符号链接、数据隔离）\n- 设备绑定防复制\n\n---\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyuluyangguang1%2Fcodex-portable","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyuluyangguang1%2Fcodex-portable","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyuluyangguang1%2Fcodex-portable/lists"}