본문으로 건너뛰기
cccskills
무료GitHub에 공개

openai-cli

Call the OpenAI Platform API from the terminal via TypeScript on deno — chat completions, Responses API, reasoning (o-series), embeddings, image generation, audio (Whisper transcription, TTS), files, batches, moderation, and model listing. Two-tool stack: mise + deno (no node_modules, no pnpm, no bash). Models are resolved dynamically per session against `client.models.list()` — never hardcoded — and any detected upgrade prompts the user via AskUserQuestion (even in auto-mode). Secrets stay outside the agent: existence-only key checks, scoped `--allow-env=OPENAI_API_KEY` and `--allow-net=api.openai.com` flags, no `.env` files. Scoped to the Platform API specifically — for open-ended chat/conversation ("ask gpt", "chat with gpt") prefer the codex-server skill instead, which uses the user's ChatGPT subscription rather than API-key billing. Use this skill only when the request is explicitly about the Platform API surface (embeddings, image generation, audio, moderation, batches, files, or a chat/Responses call made programmatically as part of a script or pipeline). Trigger patterns (match any variation): openai api / openai platform api / open-ai api / embeddings / dall-e / gpt-image / image generation / generate image / whisper / transcribe audio / speech-to-text / tts / text-to-speech / read aloud / moderation / content moderation / openai cli / openai-cli / call openai api / use openai api / openai chat completions api / openai responses api / responses api / openai batch / openai files / openai embeddings api. Does NOT access ChatGPT chat history (the API does not expose it; use the Settings → Data Controls export instead). Does NOT handle open-ended chat/conversation requests — see codex-server for that.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

연동 도구OpenAI

실행 점수 미검증

설치 방법 보기

포함된 파일(18)

  • SKILL.md13.2 KB
  • assets/lib/preflight.ts1.7 KB
  • assets/lib/resolveModel.ts7.7 KB
  • assets/lib/setup.ts4.1 KB
  • assets/mise.toml19 B
  • references/advanced.md5.3 KB
  • references/audio.md4.7 KB
  • references/chat.md4.1 KB
  • references/embeddings.md3.5 KB
  • references/error-handling.md4.1 KB
  • references/files-and-batches.md4.3 KB
  • references/images.md3.3 KB
  • references/models.md5.7 KB
  • references/moderations.md2.4 KB
  • references/reasoning.md3.4 KB
  • references/responses.md4.1 KB
  • references/security.md4.6 KB
  • references/setup.md5.0 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

openai-cli

Call OpenAI's Platform API from the terminal. Implementation: TypeScript on deno with the official openai SDK (consumed via npm:openai@5 — no pnpm install, no node_modules). Tool versions pinned via mise. Total stack: 2 tools.

Hard rules

  1. Never hardcode model names in any TS file you write. Always resolve via lib/resolveModel.ts <family> first. See references/models.md for family heuristics.
  2. Never read or print secrets. Use existence checks only. Forbidden: echo $OPENAI_API_KEY, printenv | grep, cat ~/.zshrc, cat .env, logging Authorization headers. See references/security.md.
  3. Always use scoped deno permissions. Base perms: --allow-env=OPENAI_API_KEY --allow-net=api.openai.com --allow-read=$HOME/.openai-cli --allow-write=$HOME/.openai-cli. Add --allow-read=<input> and --allow-write=<output> per use case — never blanket --allow-read / --allow-net.
  4. Cross-OS only. All non-trivial logic lives in assets/lib/*.ts. No bash, no PowerShell scripts, no shell heredocs.
  5. Upgrade prompts are mandatory even in auto-mode / dangerous-permission mode. When resolveModel.ts reports UPGRADE_NEEDED, you MUST use AskUserQuestion.

Path conventions

  • Skill cache (read-only, version-pinned): ${CLAUDE_PLUGIN_ROOT}/skills/openai-cli/assets/lib/*.ts. Use this only for the very first setup.ts invocation. ${CLAUDE_PLUGIN_ROOT} is set when Claude orchestrates the skill; in a plain user shell, resolve to ~/.claude/plugins/cache/hideki-plugins/openai-cli/<version>/skills/openai-cli/assets/lib/.
  • User workspace (stable, version-independent): ~/.openai-cli/lib/*.ts. After setup.ts runs once, all skill scripts are copied here. Every command after first-time setup runs from this stable path.

Preflight (before every call)

deno run --allow-env=OPENAI_API_KEY --allow-read --allow-run=mise,deno ~/.openai-cli/lib/preflight.ts

If any check fails:

  • mise missing → instruct platform install and stop. macOS: brew install mise. Linux: curl https://mise.run | sh. Windows: winget install jdx.mise.
  • deno missing → run cd ~/.openai-cli && mise install.
  • workspace missing → run setup (below).
  • OPENAI_API_KEY missing → instruct user to export it in their shell rc. Do not offer a .env fallback.

First-time setup (run once)

From inside Claude (uses skill cache):

deno run --allow-read --allow-write --allow-env --allow-run=mise ${CLAUDE_PLUGIN_ROOT}/skills/openai-cli/assets/lib/setup.ts

From a user shell (manual run, version-pinned path):

deno run --allow-read --allow-write --allow-env --allow-run=mise ~/.claude/plugins/cache/hideki-plugins/openai-cli/1.0.0/skills/openai-cli/assets/lib/setup.ts

setup.ts creates ~/.openai-cli/{lib,.cache,tmp}/, copies assets/lib/*.ts into ~/.openai-cli/lib/, copies the mise.toml template into ~/.openai-cli/.mise.toml, runs mise trust && mise install, and existence-checks OPENAI_API_KEY.

Then, once OPENAI_API_KEY is set, populate models.json (uses the stable workspace path now that setup has copied the scripts):

deno run --allow-env=OPENAI_API_KEY --allow-net=api.openai.com --allow-read --allow-write ~/.openai-cli/lib/resolveModel.ts --init

Full details: references/setup.md.

Per-call workflow

For every API use case:

  1. Preflight (above). Bail if anything fails.
  2. Resolve the model for the relevant family:
    deno run --allow-env=OPENAI_API_KEY --allow-net=api.openai.com --allow-read --allow-write ~/.openai-cli/lib/resolveModel.ts <family>
    
    Where <family> is one of: chat, reasoning, embeddings, image, transcription, tts, moderation.
    • Exit 0: stdout is the resolved model id. Capture it.
    • Exit 2: stdout is UPGRADE_NEEDED:<family>:<current>:<newest>. Use AskUserQuestion with options "Upgrade to <newest>", "Stay on <current>", "Use <newest> just-this-once". Then:
      • On Upgrade: run deno run --allow-read --allow-write ~/.openai-cli/lib/resolveModel.ts --set <family> <newest> and re-run resolve.
      • On Stay: run deno run --allow-read --allow-write ~/.openai-cli/lib/resolveModel.ts --set <family> <current> (refreshes the prompt-suppress timestamp) and use <current>.
      • On Just-this-once: skip the --set; use <newest> for this call only.
    • Exit 1: fatal — surface the error and stop.
  3. Write the per-call TS file under ~/.openai-cli/tmp/<task>-<timestamp>.ts. Do not invent model names — embed the resolved id from step 2 verbatim. Always include a final log line of the form # meta: model=<id> usage=<json> so the user sees what ran.
  4. Estimate cost if the call may be expensive (input > 5K tokens, output > 1K tokens, batch, multiple images). Surface the estimate and confirm with AskUserQuestion before running.
  5. Run with scoped permissions:
    deno run --allow-env=OPENAI_API_KEY --allow-net=api.openai.com --allow-read=$HOME/.openai-cli --allow-write=$HOME/.openai-cli [+ I/O scopes for this use case] ~/.openai-cli/tmp/<task>-<timestamp>.ts
    
  6. Surface the response to the user, including the meta line for transparency.

For each endpoint's specific TS template, see the matching reference file (table below).

Endpoint reference table

Use caseFamilyReference
Chat completionchatreferences/chat.md
Responses APIchatreferences/responses.md
Reasoning (o-series)reasoningreferences/reasoning.md
Embeddings + similarityembeddingsreferences/embeddings.md
Image generation / editimagereferences/images.md
Audio transcription / translation / TTStranscription / ttsreferences/audio.md
Files (upload, list, retrieve, delete)n/areferences/files-and-batches.md
Batchesn/areferences/files-and-batches.md
Moderationmoderationreferences/moderations.md
Models (list / retrieve)n/areferences/models.md

For streaming, tool/function calling, structured outputs (zod), see references/advanced.md. For error handling and rate limits: references/error-handling.md.

Out of scope

The following are deliberately deferred from v1. If the user asks for any of these, surface this list and explain the deferral rather than silently failing:

  • Fine-tuning (client.fineTuning.jobs.*) — high-cost, error-prone. Likely a separate openai-finetune skill in future, with cost gates.
  • Realtime API (websocket, voice agents) — stateful and complex. Likely a dedicated openai-realtime skill.
  • Assistants API (client.beta.assistants.*, threads, runs) — OpenAI is sunsetting this on 2026-08-26. Note: this is OpenAI's stateful-assistants product, unrelated to Claude or any Claude skill feature. The v1 skill refuses Assistants calls and steers users to the Responses API, OpenAI's official migration target.
  • Vector Stores — tied to Assistants on the same deprecation track. Same handling.
  • ChatGPT chat history — the API does not expose chats from chat.openai.com / mobile / desktop. The only sanctioned route is Settings → Data Controls → Export Data, which emails you a ZIP with conversations.json. Future work: a separate chatgpt-export-reader skill that parses that file locally.
  • Persistent-process optimization — currently each deno run cold-starts. If session latency becomes a problem, consider deno compile-ing a single binary or running a localhost daemon.

Behavior scenarios

Scenario: Chat completion
  When the user asks the skill a question
  Then the skill returns the model's answer using the per-session-resolved chat model

Scenario: Vision request
  When the user attaches an image and asks for a description
  Then the skill returns the model's description with the image attached as chat content

Scenario: Structured output
  When the user asks for a JSON-shaped response (e.g., extract entities into a schema)
  Then the skill returns a typed object matching the requested shape

Scenario: Embeddings and similarity
  When the user asks to embed N strings and find the closest pair
  Then the skill returns the closest pair and their similarity score

Scenario: Image generation
  When the user asks to generate an image and gives an output path
  Then the skill writes the image file to that path and reports the location

Scenario: Audio transcription
  When the user provides an audio file and asks for a transcript
  Then the skill returns the transcript text and (optionally) writes a .txt/.vtt sidecar

Scenario: Text-to-speech
  When the user asks to convert text to speech and gives an output path
  Then the skill writes the audio file to that path and reports the location

Scenario: Moderation
  When the user asks to moderate a string
  Then the skill returns category scores from the moderation model

Scenario: Batch submission
  When the user asks to run an embedding/completion job over thousands of records
  Then the skill estimates cost, asks for confirmation, submits the batch, and returns the batch ID

Scenario: Cost gate triggered
  When a request would consume substantial tokens (large input, big output, batch)
  Then the skill surfaces a cost estimate and asks for confirmation before sending

Scenario: Newer model detected
  When resolveModel.ts emits UPGRADE_NEEDED
  Then the skill asks the user "Upgrade / Stay / Just-this-once" via AskUserQuestion —
       even in auto-mode or dangerous-permission mode
  And the skill never silently upgrades

Scenario: User pins a specific model
  When the user names an exact model id for a single call
  Then the skill uses that id for this call only and does not update the persisted preference

Scenario: User asks the skill to read the API key
  When the user asks to print or reveal OPENAI_API_KEY
  Then the skill refuses and points the user to their own (non-agent) terminal

Scenario: User asks for ChatGPT chat history
  When the user asks the skill to read their ChatGPT chats
  Then the skill explains that no API exposes that data and describes the Data Controls export route

Scenario: User asks for Assistants API features
  When the user mentions OpenAI's Assistants / Threads / Runs / Vector Stores
  Then the skill explains those are OpenAI products being sunset on 2026-08-26
       (unrelated to Claude or this skill) and steers the user to the Responses API

Scenario: API key missing
  When the user invokes any use case without OPENAI_API_KEY exported
  Then the skill stops and explains how to export the key in their shell rc (no .env fallback)

Scenario: API failure mid-call
  When the OpenAI API returns a rate-limit, auth error, or network failure
  Then the skill surfaces a sanitized error message (no auth header / key value leakage)
       and suggests the appropriate retry or fix

Retrospective

After completing a non-trivial use case, briefly note in feedback/log.md:

  • What the user asked
  • Which family/model resolved
  • Any unexpected behavior (rate limit, missing scope, surprising response)

This feeds the improvement loop — see references/error-handling.md for the format.

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 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일 업데이트

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

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

hideki5123/agent-skill-set22026년 10월 21일 업데이트

hideki5123의 스킬 모두 보기

이 스킬의 문제 신고