跳到正文
cccskills
免费在 GitHub 公开

codex-server

Run OpenAI Codex via the Codex App Server (JSON-RPC-over-stdio) for streaming multi-turn chat sessions with persistent threads, structured output, image input, and rich event streams. Default entry point for ChatGPT/GPT/Codex-like conversations from the terminal. Uses the user's ChatGPT subscription (Plus / Pro / Team) exclusively via `codex login` — never consumes OPENAI_API_KEY billing, by design. Implementation: TypeScript on deno with npm:@openai/codex-sdk; spawns the existing system codex binary. Decoupled async invocation: every turn returns turn-id in <1 s; the actual SDK work runs in a detached worker that streams to per-turn files under ~/.codex-server/turns/<turn-id>/ — Bash's 2-min timeout never applies. Prefer this over codex-cli for streaming UX, multi-turn dialogues that need live state, structured (JSON schema) output, attaching images, or programmatic event handling. Use codex-cli only for one-shot batch invocations that pre-capture to an -o file. For OpenAI Platform API calls specifically (embeddings, image generation, audio, moderation, batches, files) — not open-ended chat — use openai-cli instead; that path bills OPENAI_API_KEY, this one uses the ChatGPT subscription. Trigger patterns (match any variation): codex / codex-server / codex app server / codex app-server / openai / open ai / OpenAI / chatgpt / chat gpt / ChatGPT / GPT / ask gpt / chat with gpt / gpt session / codex session / streaming chat / multi-turn chat / multi turn chat / second opinion / cross-check / cross check / ai pair programming / another AI / external AI / ask another model / get GPT's take / what does openai think / show me what gpt thinks / structured output from gpt / json schema gpt / resume codex thread / continue codex conversation / continue codex session / /codex-server

中文简介正在准备中。当前显示原文说明。

集成工具OpenAI

实测评分 未实测

查看安装方法

包含的文件(13)

  • SKILL.md12.8 KB
  • assets/lib/chat.ts19.2 KB
  • assets/lib/helpers.ts12.7 KB
  • assets/lib/setup.ts5.7 KB
  • assets/lib/worker.ts11.2 KB
  • assets/mise.toml19 B
  • references/auth-setup.md2.6 KB
  • references/error-handling.md6.7 KB
  • references/examples.md4.5 KB
  • references/execution-patterns.md5.8 KB
  • references/scenarios.feature7.0 KB
  • references/sdk-reference.md4.5 KB
  • references/streaming-protocol.md3.9 KB

SKILL.md(原文)

安装前可以查看交给 AI 代理的指令内容。

Codex Server Skill

Run OpenAI Codex App Server via @openai/codex-sdk on deno. Streams multi-turn chat sessions, structured output, image input, and rich event logs. This is the default ChatGPT/Codex skill — prefer it over codex-cli (which is reserved for batch one-shot codex exec use).

Auth: ChatGPT subscription only

This skill is ChatGPT-subscription-only by design. There is no API-key fallback — OPENAI_API_KEY is not in --allow-env, so deno cannot read it even if exported.

  • If ~/.codex/auth.json exists (i.e., codex login has been completed), the skill works using the user's ChatGPT Plus / Pro / Team subscription. No API-key billing is consumed.
  • If ~/.codex/auth.json is missing, every subcommand fails with exit code 2 and prints the login guide. The user must run codex login (browser flow) and re-invoke.

For the full login walkthrough (account types, troubleshooting) read references/auth-setup.md — but only when auth.json is missing.

First-run setup

Run once after install. No env vars needed.

CODEX_SERVER_VERSION=$(ls ~/.claude/plugins/cache/hideki-plugins/codex-server/ | sort -V | tail -1)
deno run --allow-read --allow-write --allow-env --allow-run=mise,codex,which \
  ~/.claude/plugins/cache/hideki-plugins/codex-server/$CODEX_SERVER_VERSION/skills/codex-server/assets/lib/setup.ts

(Resolves the highest installed cache version at runtime via a version sort — never hardcode a specific version here, the plugin has already moved past 1.0.0 and will move again.)

setup.ts copies chat.ts / worker.ts / helpers.ts into ~/.codex-server/lib/, pins the codex binary path into ~/.codex-server/config.json, and prepares the turns directory. After setup, run subsequent invocations from ~/.codex-server/lib/chat.ts (stable path, version-independent).

Operational flow (≤3 lines — this is the whole point)

  1. deno run … chat.ts new "<prompt>" → returns {turn_id, out_path, ...} JSON in <1 s. A detached worker runs the actual turn.
  2. Watch progress: use the Monitor tool on the returned out_path (it grows as deltas arrive).
  3. Done when the done marker file appears alongside out.txt; on error, the error marker appears instead.

No run_in_background: true. No bounded poll loops. No timeout knobs. The deno invocation that Bash spawns exits in <1 s regardless of turn duration.

If you need a blocking call, use chat.ts wait <turn-id> — it polls the markers and prints the final out.txt on completion.

Hang handling (idle watchdog)

The worker wraps the SDK event stream in an idle watchdog: if no stream event arrives for CODEX_SERVER_IDLE_SECS (default 180s), the turn is presumed hung (network drop, app-server protocol stall, wedged child), marked error, and the worker hard-exits — so a hung turn surfaces as failed instead of reading as running forever. Every event resets the clock, so legitimate long reasoning (which still emits item.* events) is never killed. Override the threshold by exporting CODEX_SERVER_IDLE_SECS before invoking.

turnState adds a backstop stalled state: worker alive, no marker, yet no output progress for >5 min (longer than the watchdog, so it only appears if the worker's own watchdog failed to fire — e.g. an old worker binary or wedged I/O). wait/tail treat stalled as non-terminal and print a one-time notice; status/doctor report it directly.

The SDK pin is machine-adaptive: setup.ts reads the local codex binary's minor and writes a matching sdkSpec (npm:@openai/codex-sdk@^<minor>.0) into ~/.codex-server/config.json; the worker imports that spec dynamically. So a repo synced across machines on different codex versions (e.g. one box on 0.142, another on 0.130) each tracks its own — no single hardcoded pin to go stale. The only drift mode left is upgrading the codex binary without re-running setup: new/continue warn (≤once/24h) and doctor reports it when the live binary minor no longer matches config.codexMinor. The fix is always the same — re-run setup.ts to re-resolve the SDK to the current binary.

CLI surface

All subcommands of ~/.codex-server/lib/chat.ts. See references/examples.md for worked examples (only read when an unfamiliar invocation is needed).

  • new "<prompt>" [--model M] [--cwd PATH] [--schema FILE] [--image P]… [--skip-git-check]
  • continue [--last | --thread <id>] "<prompt>" [same flags]
  • tail <turn-id> [--follow]
  • wait <turn-id> [--timeout SECS]
  • status <turn-id> — JSON: running / complete / failed / abandoned / stalled / missing
  • list-turns [--limit N]
  • list — recent threads from ~/.codex/sessions/
  • show <thread-id> — thread metadata + tail
  • doctor — health report: auth, codex-binary-vs-SDK version skew, and any running/stalled/abandoned turns. Run this first when hangs are suspected.

new / continue always return turn-id in <1 s. tail / wait are explicitly blocking; if they exceed 2 min, invoke them with run_in_background: true and use Monitor on the output file instead — same pattern as any other streaming command.

Required deno permissions

The setup script pins the codex binary path. After setup, every chat.ts invocation needs these flags:

  • --allow-read and --allow-write — workspace + working dir + turn files
  • --allow-env=PATH,HOME,USERPROFILE — only; deliberately omits OPENAI_API_KEY
  • --allow-run=<codex-path>,<deno-path>,kill — <codex-path> from ~/.codex-server/config.json; <deno-path> (Deno.execPath()) because new/continue fork a detached deno worker; kill because wait/tail/status liveness-check the worker via kill -0
  • --allow-net=api.openai.com — defensive

Streaming and events

The worker writes one JSON event per line to events.jsonl and a human-readable rendering to out.txt. Item types observed: agent_message, reasoning, command_execution, file_change, todo_list. For deep parsing or extending event rendering read references/streaming-protocol.md — only when the default rendering is insufficient.

Per-turn directory layout

~/.codex-server/turns/<turn-id>/ contains:

  • prompt.txt — the user prompt
  • meta.json — { turn_id, thread_id, started_at, cwd, model, pid, resumed_from }
  • events.jsonl — every ThreadEvent (one JSON per line)
  • out.txt — streamed human-readable text
  • worker.log — worker diagnostics: a [boot] line written before anything can fail (so a post-mortem distinguishes "never started" from "started then died"), plus [fail]/[watchdog] reasons. This is how a detached worker preserves why it died (its real stderr is discarded by the client fork).
  • done (marker) — present once turn.completed fires
  • error (marker) — present on turn.failed, the idle watchdog, or uncaught worker errors

setup.ts GCs turn-dirs older than 7 days on every invocation.

Error handling

On unexpected behavior read references/error-handling.md. Common cases:

  • ~/.codex/auth.json missing → run codex login
  • codex not on PATH → install via brew install codex or npm install -g @openai/codex
  • worker crashed → status reports abandoned; safe to abandon, just new again

Deferred features

These are intentionally out of scope for v1.0.0. Pull them in only on demand.

  • Interactive tool-approval flow (turn/approve / turn/reject) via raw JSON-RPC. Currently auto-approved via approval_policy: on-failure.
  • WebSocket transport (--listen ws://IP:PORT).
  • In-skill ChatGPT login orchestration (account/login/start, device code) — users complete codex login externally.
  • Persistent app-server (warm process) — amortize ~500ms–2 s startup per turn.
  • Per-session model upgrade detection à la openai-cli's resolveModel.ts. Currently defers to ~/.codex/config.toml.
  • Raw JSON-RPC sub-mode using codex app-server generate-ts bindings.
  • Track the installed codex binary instead of a hardcoded SDK pin. Done over v1.2.0–v1.3.0: v1.2.0 moved the pin ^0.130.0 → ^0.142.x, restored resumeThread's ThreadOptions arg (non-git resume works), and surfaced fatal error stream events. v1.3.0 made resolution machine-adaptive — setup.ts derives sdkSpec from the local codex minor and the worker imports it dynamically, so a repo synced across boxes on different codex versions each self-tracks. Upgrading codex now just needs a setup.ts re-run (doctor/new warn when it's overdue).

Behavior Scenarios

BDD spec lives in references/scenarios.feature. Read only when auditing or amending the skill (e.g., via /skill-improve); not needed for normal execution.

Feedback Check

Before doing any work, if feedback/log.md exists next to this SKILL.md and has ≥5 entries, read the last 10. If a pattern is apparent (the same keyword in 3+ entries, or average rating below 3), tell the user (in Japanese): 「過去のフィードバックで類似パターンを検出: [簡潔に]。/skill-improve --skill codex-server で改善案を分析できます。」 Otherwise proceed silently.

Retrospective

After completing a session, reflect:

  1. Were there mid-session corrections, errors, or surprises?
  2. Ask the user (in Japanese): 「今回のセッションのフィードバック (1-5の評価、気になった点、または何もなければEnter)」
  3. If the user provides feedback OR if corrections/issues actually occurred:
    • Create feedback/log.md next to this SKILL.md if missing (header: # Feedback Log + blank line + <!-- Append new entries at the top. Do not edit previous entries. -->).
    • Prepend a new entry:
      ## <ISO-8601 timestamp>
      - **Skill Version**: <version from this file's frontmatter>
      - **Task**: <brief description>
      - **Outcome**: success | partial-success | failure | error
      - **Rating**: <N>/5 (or "—" if not provided)
      - **Corrections**: <mid-session corrections, or "none">
      - **Issues**: <specific problems, or "none">
      - **User Note**: <user's verbatim feedback, or "—">
      ---
      
  4. If the user skips AND no corrections/issues occurred, end without recording.

References

Read these on-demand only — they are not auto-loaded.

  • references/scenarios.feature — Gherkin BDD spec. Only for skill-improve / audit. Never during normal execution.
  • references/auth-setup.md — codex login walkthrough. Only when auth.json is missing.
  • references/sdk-reference.md — Codex / Thread / Turn API quick-ref. Only when extending or debugging.
  • references/streaming-protocol.md — event/item types. Only when default rendering is insufficient.
  • references/execution-patterns.md — full rationale for decoupled async. Only when this 3-line summary is not enough.
  • references/examples.md — worked invocations. Only when an unfamiliar pattern is needed.
  • references/error-handling.md — error-to-fix lookup. Only on error.

评价

还没有评价。欢迎分享你的使用感受。

评论

无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。

还没有评论。来写第一条吧。

提交后会立即公开。请勿填写邮箱、电话等个人信息。URL 最多 2 个。

0 / 1000 字

此表单受 reCAPTCHA 保护,适用 Google 的隐私权政策和服务条款。

同一仓库的技能

Run a multi-model adversarial mutual review with facilitator synthesis: 2+ panelists (different model families where possible — use codex-server / codex-cli for the external-family seat) independently answer, adversarially critique each other across rounds, and the main session acts as facilitator, synthesizing agreements, live disagreements, and calibrated confidence into one answer. Use ONLY on high-stakes, hard-to-reverse claims, designs or decisions, and only when the user EXPLICITLY asks to debate or adversarially review with multiple models — "discuss with Opus and Codex", "red-team this", "devil's advocate", 敵対的レビュー, 相互レビュー, 多モデル討論, 議論させて. A full run costs ~6 subagent/CLI dispatches: state the panel size and round count and get a go-ahead before launching. Where the Workflow tool is available, run the panel as a Workflow (judge-panel / adversarial-verify) instead of ad-hoc fan-out. Do NOT self-trigger on a bare "are you sure?" — that is a cue to OFFER the panel, not to run it.

中文简介正在准备中。当前显示原文说明。

hideki5123/agent-skill-set22026年10月21日 更新

Orchestrate multiple coding-agent sessions (Claude Code, Codex, Gemini) over the mcp_agent_mail MCP server, observe their progress on a recurring auto-loop, and prevent inconsistencies (file/edit conflicts and contradictory decisions) between concurrent tasks. Auto-manages the agent-mail server, derives the shared room key from the git repo, and runs either as the orchestrator/observer or as a participating worker. Handles the operational details (server startup, room key, reservation conventions) so the user does not have to remember them. Use when coordinating several agent sessions on different tasks at once, watching a swarm of sessions for conflicts, or wiring already-running sessions into a shared coordination room. Trigger phrases: "agent-swarm", "/agent-swarm", "orchestrate agents", "orchestrate multiple claude sessions", "coordinate sessions", "watch for conflicts between agents", "observe the swarm", "prevent inconsistency between sessions", "multi-agent observe", "複数セッションを協調", "エージェント協調", "セッション間の不整合監視", "スウォーム監視", "複数のClaudeを束ねて".

中文简介正在准备中。当前显示原文说明。

hideki5123/agent-skill-set22026年10月21日 更新

Generate AGENTS.md (cross-tool agent context — Codex CLI, Aider, Cursor, etc.) and wire CLAUDE.md as a symlink so Claude Code reads the same file. Delegates content generation to Claude's built-in /init when needed, then renames + symlinks. Idempotent. Triggers — /agents-init, "generate agents.md", "create agents.md", "share claude and codex context", "set up agents file", "init agents", "agents-init", "cross-tool agent context", "wire claude and agents".

中文简介正在准备中。当前显示原文说明。

hideki5123/agent-skill-set22026年10月21日 更新

Drive an already-running, LOGGED-IN Chromium browser on macOS via AppleScript — navigate, click, fill forms, scroll, and extract page content from the user's REAL session, with the browser left open and NO profile copy and NO restart. Use when the task needs the existing logged-in session (cookies, auth, current tabs) reused as-is. Trigger phrases: "chrome-use", "ブラウザから取得", "ログイン済みの Chromeで", "ブラウザを操作して", "このページ読んで", "Xのスレッド読んで", "ログインしたまま取得", "自分のセッションでスクレイプ", "read this page in my browser", "scrape with my session", "drive my chrome", "execute JS in my (logged-in) browser", "automate my logged-in browser". Chromium family (Chrome default; Brave/Edge/Arc/Vivaldi via --app). NOT for isolated/throwaway automation where login reuse is unneeded — use playwright-cli for that. macOS only.

中文简介正在准备中。当前显示原文说明。

hideki5123/agent-skill-set22026年10月21日 更新

codex-cli

免费

Run OpenAI Codex CLI from the terminal for batch / one-shot `codex exec` invocations with output captured to an `-o` file. Use for fire-and-forget runs, scripted CI, code review batches (`codex review`), and resuming a specific session by id (`codex exec resume`). Always use this skill instead of `mcp__codex__codex` and `mcp__codex__codex-reply` MCP tools — CLI is faster and more capable. For streaming UX, multi-turn dialogues that need live state, structured (JSON schema) output, attaching images, or programmatic event handling → **use codex-server instead**. codex-server uses the user's ChatGPT subscription via Codex App Server and decoupled async invocation that bypasses the Bash 2-minute timeout entirely. Trigger patterns (batch-only — chat/streaming triggers belong to codex-server): codex-cli / codex CLI / codex exec / codex review / codex resume / codex fork / batch + {codex, gpt} / one-shot + {codex, gpt} / non-interactive + codex / codex {to a file, -o, output file, captured output} / CI + {codex, gpt} / scripted + {codex, gpt} / fork codex session / resume codex session by id

中文简介正在准备中。当前显示原文说明。

hideki5123/agent-skill-set22026年10月21日 更新

Use confluence-cli to read, search, create, update, move, and delete Confluence pages and attachments from the terminal. Prefer this skill over `mcp__claude_ai_Atlassian__*` MCP tools when you need: page export with attachments, copy-tree, attachment management, profile-based multi-instance access, read-only mode, CQL search, or shell pipelines. Trigger phrases include "confluence", "confluence-cli", "confluence page", "read confluence", "search confluence", "create confluence page", "update confluence page", "confluence attachment", "confluence spaces", "export confluence", "confluence comments", "confluence copy-tree".

中文简介正在准备中。当前显示原文说明。

hideki5123/agent-skill-set22026年10月21日 更新

查看 hideki5123 的全部技能

报告此技能的问题