跳到正文
Skillpedia
智能体84k · #1417

config-codex-cli

它能做什么

这项技能是一份分步指南,用于把 Codex 命令行工具连接到 OmniRoute。适合想在常见操作系统上让 Codex 的请求经过 OmniRoute 的开发者。

适用场景

  • ✓当用户想把 Codex CLI 与 OmniRoute 作为后端一起使用的时候。
  • ✓当用户需要在 Windows、macOS 或 Linux 上设置 Codex 的时候。
  • ✓当用户计划进行长达数小时的多步骤 Codex 会话,并希望它保持稳定的时候。

技能链接

https://github.com/cheaper-inference/OmniRoute/blob/release/v3.8.53/skills/config-codex-cli/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/cheaper-inference/OmniRoute/blob/release/v3.8.53/skills/config-codex-cli/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“请在我的电脑上设置 Codex CLI,让它使用 OmniRoute。”

每周 5 个新技能,1 分钟读完。

工作原理

这项技能会检查操作系统和 shell,写入一个 config.toml 文件(其中包含七个命名配置文件),并设置 Codex 所需的环境变量,最后验证设置。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

<!-- generated by src/lib/agentSkills/generator.ts; manual edits will be overwritten -->

Overview

Step-by-step agent workflow to configure the OpenAI Codex CLI on any machine (Linux, macOS, Windows) to use OmniRoute as an OpenAI-compatible backend. Detects OS and shell, writes config.toml and 7 named profiles, sets environment variables, and verifies the setup.

Quick install

npm install -g omniroute   # or: npx omniroute
omniroute --version

Subcommands

No CLI subcommands mapped for this family yet.

<!-- skill:custom-start -->

Long-running Codex tasks (#7287)

Two OmniRoute defaults silently break multi-hour Codex sessions. Document them whenever configuring Codex for overnight / multi-hour work. Full guide: docs/guides/CODEX-CLI-CONFIGURATION.md → Long-running tasks.

Session affinity (default off)

  • Setting: sessionAffinityTtlMs (ms; UI shows Affinity TTL (seconds) under Dashboard → Settings → Routing → Session affinity). Legacy alias: codexSessionAffinityTtlMs.
  • Default 0 = disabled. Each turn can land on a different account and break prompt-cache / session continuity.
  • Codex session keys (x-codex-session-id, x-session-id, x-omniroute-session, body prompt_cache_key / session_id) are only used for pinning when TTL > 0.
  • Max: 86400 seconds / 86400000 ms (24h). Set TTL above the expected task length (e.g. 43200 s for ~12h).

Stream idle timeout (default 10 minutes)

  • Env: STREAM_IDLE_TIMEOUT_MS (default 600000). Also consider FETCH_BODY_TIMEOUT_MS (same baseline; 0 disables).
  • Synthetic SSE heartbeats do not reset the idle clock — only real upstream chunks do.
  • A quiet reasoning turn past the idle window is force-closed (stream_idle_timeout / StreamIdleTimeoutError). Grep logs for Idle timeout: no data from.

Recommended multi-hour recipe

  1. Dashboard → Settings → Routing → Session affinity → Affinity TTL = 43200 (12h) or 86400 (24h max).
  2. OmniRoute environment:
STREAM_IDLE_TIMEOUT_MS=0
FETCH_BODY_TIMEOUT_MS=0
  1. Restart OmniRoute. Leave Codex config.toml as usual (wire_api = "responses", correct base_url).

Defaults decision

Do not flip ship defaults in code for this skill: sessionAffinityTtlMs stays 0 and STREAM_IDLE_TIMEOUT_MS stays 600000. Long-running operators must opt in. See Discussion #5718 and issue #7287.

<!-- skill:custom-end -->
常见问题

设置会创建什么?

它会写入一个 config.toml 文件,其中包含七个命名配置文件,并设置 Codex 需要的环境变量。

它会检查结果吗?

会。这项技能最后会验证设置。

长时间的编码会话怎么办?

这项技能说明,会话亲和性默认关闭;对于长会话,应把它设置为长于预期任务的时长。

详情

作者的原始描述

Step-by-step agent workflow to configure the OpenAI Codex CLI on any machine (Linux, macOS, Windows) to use OmniRoute as an OpenAI-compatible backend. Detects OS and shell, writes config.toml and 7 named profiles, sets environment variables, and verifies the setup.

repo: cheaper-inference/OmniRoute

热度

GitHub 星标
84k
排名
#1417
许可证
MIT
更新时间
2026/11/2

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能