askcodex

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

askcodex

askcodex

You have the
askcodex
CLI. It sends one request to an OpenAI model through the user's ChatGPT/Codex subscription and returns a text answer, an image, or a transcript. Turn the user's request into a complete brief, run one focused call, check the result against the brief, and hand the user the useful output with its saved path.
Canonical copy:
skill/
in https://github.com/JairoTorregrosa/askcodex (this is a mirror; change it there, then re-sync). Local delta: the description's not-for clause points to second-opinion.
你可以使用
askcodex
CLI。它通过用户的 ChatGPT/Codex 订阅向 OpenAI 模型发送一次请求,并返回文本答案、图像或转录文本。将用户请求整理成完整的任务说明,执行一次聚焦调用,根据任务说明检查结果,并将有用输出及其保存路径交给用户。
规范副本:https://github.com/JairoTorregrosa/askcodex 中的
skill/
(这是一个镜像;应在该处修改,然后重新同步)。本地差异:description 中的“不适用”条款指向 second-opinion。

Context you must respect

必须遵守的事项

  • This skill describes askcodex 0.3.0 or later. Check
    askcodex --version
    once per session. 0.2.x has no
    --schema
    ,
    --verbosity
    or
    --background
    , prints the ~700 KB raw catalog inside
    models --json
    , and gives errors without
    error.backend
    ; 0.1.x also hides the GPT-6 models. If it is older, tell the user to update instead of working around it: in an askcodex checkout,
    git pull && ./install.sh
    ; without one, download the latest release binary from https://github.com/JairoTorregrosa/askcodex/releases (verify
    SHA256SUMS
    ), or clone it and run
    ./install.sh
    (needs Rust 1.88+).
  • Every call is one-shot and stateless.
    ask
    sends only the prompt and optional
    --instructions
    : the model gets no tools, files, browsing, repository, or earlier conversation. A file path in a prompt is just text; paste the contents instead.
  • Everything in a prompt, a reference image or an audio file leaves the machine for OpenAI's backend. Before you paste logs, exports, code or documents, always remove credentials, tokens, keys and passwords, even when the user supplied them for the task: replace them with placeholders. Also remove personal or customer data the task does not need; if the task needs it, or you cannot tell, ask the user first.
  • Every call spends the user's subscription quota. GPT-6 Astra is the most expensive model.
  • A second model's answer is input to your work. Verify its facts, review its code, and look at its images before you report success.
  • askcodex uses the credentials
    codex login
    saved to
    ~/.codex/auth.json
    ; it reads no API key. Never print credentials.
  • 本 skill 适用于 askcodex 0.3.0 或更高版本。每个会话检查一次
    askcodex --version
    。0.2.x 不支持
    --schema
    、
    --verbosity
    或
    --background
    ,并且会在
    models --json
    中打印约 700 KB 的原始目录,错误信息中也不含
    error.backend
    ;0.1.x 还会隐藏 GPT-6 模型。如果版本过旧,应告知用户更新,而不是绕过限制:在 askcodex 的 checkout 中执行
    git pull && ./install.sh
    ;如果没有 checkout,则从 https://github.com/JairoTorregrosa/askcodex/releases 下载最新的 release binary(校验
    SHA256SUMS
    ),或 clone 仓库后运行
    ./install.sh
    (需要 Rust 1.88+)。
  • 每次调用都是一次性且无状态的。
    ask
    只发送 prompt 和可选的
    --instructions
    :模型无法使用工具、文件、浏览功能、仓库或之前的对话。prompt 中的文件路径只是文本;应改为粘贴文件内容。
  • prompt 中的所有内容、参考图像或音频文件都会离开本机并发送到 OpenAI 后端。在粘贴日志、导出数据、代码或文档前,务必移除凭据、token、密钥和密码,即使用户为任务提供了这些内容,也应替换为占位符。同时移除任务不需要的个人或客户数据;如果任务确实需要这些数据,或者无法判断,应先询问用户。
  • 每次调用都会消耗用户的订阅配额。GPT-6 Astra 是价格最高的模型。
  • 第二个模型的答案是后续工作的输入。报告成功之前,务必核实其事实、审查其代码,并查看其图像。
  • askcodex
    使用
    codex login
    保存于
    ~/.codex/auth.json
    的凭据;它不读取 API key。绝不打印凭据。

Facts already verified (2026-10-02)

已核实事实(2026-10-02)

  • askcodex models --no-refresh
    lists what the account can use, with each model's description, Codex's default effort and any retirement date. On 2026-10-02:
    gpt-6.1-sol
    ,
    gpt-6-astra
    ,
    gpt-6-sol
    ,
    gpt-6-luna
    ,
    gpt-5.6-sol
    ,
    gpt-5.6-terra
    ,
    gpt-5.6-luna
    ,
    gpt-daybreak-blue-latest
    ,
    gpt-5.5
    (retires 2026-10-14), and the hidden
    gpt-reserve
    and
    codex-auto-review
    . All take text;
    ask
    sends text only. OpenAI ships models every few days: trust the live catalog over this list.
  • ask
    defaults to
    gpt-6.1-sol
    at
    medium
    . The catalog lists it for every plan; if a plan refuses it with a model-availability error (OpenAI's Codex docs have offered Free and Go only Luna), pass
    --model gpt-6-luna
    . askcodex never switches models on its own.
  • --effort
    takes
    low
    ,
    medium
    ,
    high
    ,
    xhigh
    ,
    max
    , or
    none
    . The catalog also lists
    ultra
    , which is Codex's multi-agent mode; the backend rejects it. A level a model does not take fails with HTTP 400 (
    none
    on
    gpt-6-astra
    and
    gpt-6.1-sol
    ;
    gpt-6-sol
    and
    gpt-6-luna
    accept it although the catalog omits it).
  • --verbosity low|medium|high
    sets answer length and detail. Unset, the backend answers at
    medium
    ; Codex itself asks for
    low
    . On the same prompt
    low
    used 240 output tokens and
    high
    513.
  • --schema FILE
    makes the backend enforce a JSON Schema in strict mode, even against a prompt that asks for prose. Strict rules: every property in
    required
    ,
    "additionalProperties": false
    on every object, and an optional value adds
    "null"
    to its own type (
    ["string","null"]
    ,
    ["integer","null"]
    ; an
    enum
    must list
    null
    too). A schema that breaks them fails before generation with
    error.backend.code: "invalid_json_schema"
    and a message naming the key. With
    --json
    ,
    .result.json
    is the parsed answer. askcodex re-checks its structure against the schema, so an answer that does not parse or does not match is a
    response_invalid
    failure, never a result.
  • image create
    and
    image edit
    return one PNG per call of about 1.57 megapixels; the prompt sets the aspect ratio.
    --background transparent
    or
    opaque
    forces the background (both honored); unset, the prompt decides. The result reports the file's real
    width
    ,
    height
    and
    alpha_channel
    . There is no model, size, quality, format, or count flag, because the backend ignores those fields.
  • transcribe
    takes a WAV file up to 25 MiB and has no model or language selector.
  • askcodex models --no-refresh
    会列出账户可用的模型,包括每个模型的描述、Codex 默认 effort 和退役日期。截至 2026-10-02,模型包括:
    gpt-6.1-sol
    、
    gpt-6-astra
    、
    gpt-6-sol
    、
    gpt-6-luna
    、
    gpt-5.6-sol
    、
    gpt-5.6-terra
    、
    gpt-5.6-luna
    、
    gpt-daybreak-blue-latest
    、
    gpt-5.5
    (将于 2026-10-14 退役),以及隐藏的
    gpt-reserve
    和
    codex-auto-review
    。所有模型都接受文本;
    ask
    也只发送文本。OpenAI 每隔几天就会发布模型;应以实时模型目录为准,而不是此列表。
  • ask
    默认使用
    gpt-6.1-sol
    ,effort 为
    medium
    。模型目录显示所有套餐均可使用它;如果某个套餐因模型不可用错误而拒绝该模型(OpenAI 的 Codex 文档曾注明 Free 和 Go 套餐仅提供 Luna),则传入
    --model gpt-6-luna
    。
    askcodex
    绝不会自行切换模型。
  • --effort
    接受
    low
    、
    medium
    、
    high
    、
    xhigh
    、
    max
    或
    none
    。模型目录还列出
    ultra
    ,这是 Codex 的 multi-agent 模式;后端会拒绝它。模型不支持某个 effort 时会触发 HTTP 400(
    gpt-6-astra
    和
    gpt-6.1-sol
    不支持
    none
    ;
    gpt-6-sol
    和
    gpt-6-luna
    接受
    none
    ,尽管模型目录未列出)。
  • --verbosity low|medium|high
    用于设置答案长度和详细程度。未设置时,后端以
    medium
    作答;Codex 自身要求使用
    low
    。对于同一个 prompt,
    low
    使用了 240 个输出 token,而
    high
    使用了 513 个。
  • --schema FILE
    会让后端在 strict 模式下强制执行 JSON Schema,即使 prompt 要求输出 prose 也仍然如此。严格规则:每个属性都必须列入
    required
    ;每个 object 都要设置
    "additionalProperties": false
    ;可选值需要在其自身类型中加入
    "null"
    (
    ["string","null"]
    、
    ["integer","null"]
    ;
    enum
    也必须列出
    null
    )。违反这些规则的 schema 会在生成前失败,并返回
    error.backend.code: "invalid_json_schema"
    以及一条指明具体 key 的消息。使用
    --json
    时,
    .result.json
    是解析后的答案。
    askcodex
    会再次对照 schema 检查结构,因此无法解析或不匹配的答案属于
    response_invalid
    失败,绝不会作为结果返回。
  • image create
    和
    image edit
    每次调用返回一个约 1.57 百万像素的 PNG;宽高比由 prompt 决定。
    --background transparent
    或
    opaque
    可强制设置背景(两者均受支持);未设置时由 prompt 决定。结果会报告文件实际的
    width
    、
    height
    和
    alpha_channel
    。它没有 model、size、quality、format 或 count flag,因为后端会忽略这些字段。
  • transcribe
    接受最大 25 MiB 的 WAV 文件,并且没有 model 或 language 选择器。

Do this

执行步骤

  1. Pick the command and read its guide before you write the prompt:
    ResultCommandRead first
    Answer, analysis, writing, code, or review
    askcodex ask "prompt" --model <slug> --effort <level>
    (add
    --verbosity low
    for a concise answer)
    prompting-text.md and the model's guide below
    Classification or extraction you will parse
    askcodex ask - --schema /tmp/askcodex/<name>.schema.json --json < brief.txt
    , then read
    .result.json
    Same as above
    New image
    askcodex image create "prompt" -o /tmp/askcodex/<name>-v1.png
    (add
    --background transparent
    for a cutout)
    prompting-images.md and model-gpt-image-2.md
    Image edit from one to five PNG references
    askcodex image edit "prompt" -i ref.png -o /tmp/askcodex/<name>-v2.png
    Same as a new image
    Audio transcript
    askcodex transcribe recording.wav
    transcription.md
    Which models exist, their default effort, what retires
    askcodex models --no-refresh
    (a short list with descriptions)
    Nothing; no prompt is involved
    Quota, account, auth status
    askcodex usage
    /
    whoami
    /
    auth status
    , each with
    --json --no-refresh
    Nothing
  2. For
    ask
    , pick the model and read its guide:
    The taskModelGuide
    Most work: coding, review, debugging, analysis, drafting
    gpt-6.1-sol
    (default)
    model-gpt-6.1-sol.md
    The hardest or most consequential single deliverable
    gpt-6-astra
    model-gpt-6-astra.md
    Clear, repeatable extraction, classification, or transformation
    gpt-6-luna
    model-gpt-6-luna.md
    Authorized defensive security work
    gpt-daybreak-blue-latest
    model-gpt-daybreak-blue-latest.md
    Reproducing a GPT-6 Sol result
    gpt-6-sol
    model-gpt-6-sol.md
    Reproducing a GPT-5.6 result
    gpt-5.6-sol
    ,
    gpt-5.6-terra
    ,
    gpt-5.6-luna
    sol, terra, luna
    Anything on
    gpt-5.5
    move to
    gpt-6.1-sol
    (
    gpt-6-luna
    if the plan refuses it)
    model-gpt-5.5.md
    prompting.md indexes every guide. Pin
    --model
    and
    --effort
    whenever you compare outputs or need to reproduce one.
  3. Write a complete brief: the deliverable, its audience, the constraints, what "done" means, the source material itself, what must stay unchanged, and the output format.
  4. Run one focused request. Create
    /tmp/askcodex/
    first and give every artifact a descriptive name with a version suffix, so an edit never overwrites a useful result. For a long-running job, run it in the background or in tmux and save its output to a file.
  5. Inspect the result against the brief. Make the next request about one specific observed problem, and keep the last useful version.
  1. 选择命令,并在编写 prompt 前阅读相应指南:
    结果命令先阅读
    答案、分析、写作、代码或评审
    askcodex ask "prompt" --model <slug> --effort <level>
    (需要简洁答案时添加
    --verbosity low
    )
    prompting-text.md 和下方的模型指南
    需要解析的分类或提取
    askcodex ask - --schema /tmp/askcodex/<name>.schema.json --json < brief.txt
    ,然后读取
    .result.json
    同上
    新图像
    askcodex image create "prompt" -o /tmp/askcodex/<name>-v1.png
    (抠图时添加
    --background transparent
    )
    prompting-images.md 和 model-gpt-image-2.md
    使用一至五张 PNG 参考图编辑图像
    askcodex image edit "prompt" -i ref.png -o /tmp/askcodex/<name>-v2.png
    与新图像相同
    音频转录
    askcodex transcribe recording.wav
    transcription.md
    哪些模型可用、默认 effort 以及何时退役
    askcodex models --no-refresh
    (返回带描述的简短列表)
    无需阅读;不涉及 prompt
    配额、账户、认证状态
    askcodex usage
    /
    whoami
    /
    auth status
    ,每个命令都添加
    --json --no-refresh
    无需阅读
  2. 对于
    ask
    ,选择模型并阅读其指南:
    任务模型指南
    大多数工作:编码、评审、调试、分析、起草
    gpt-6.1-sol
    (默认)
    model-gpt-6.1-sol.md
    最困难或后果最严重的单项交付物
    gpt-6-astra
    model-gpt-6-astra.md
    清晰、可重复的提取、分类或转换
    gpt-6-luna
    model-gpt-6-luna.md
    经授权的防御性安全工作
    gpt-daybreak-blue-latest
    model-gpt-daybreak-blue-latest.md
    复现 GPT-6 Sol 的结果
    gpt-6-sol
    model-gpt-6-sol.md
    复现 GPT-5.6 的结果
    gpt-5.6-sol
    、
    gpt-5.6-terra
    、
    gpt-5.6-luna
    sol、terra、luna
    所有基于
    gpt-5.5
    的任务
    改用
    gpt-6.1-sol
    (如果套餐拒绝,则使用
    gpt-6-luna
    )
    model-gpt-5.5.md
    prompting.md 索引了所有指南。只要需要比较输出或复现结果,就应明确固定
    --model
    和
    --effort
    。
  3. 编写完整的任务说明,包括交付物、受众、约束条件、“完成”的标准、源材料本身、必须保持不变的内容以及输出格式。
  4. 执行一次聚焦的请求。先创建
    /tmp/askcodex/
    ,并为每个产物提供描述性名称和版本后缀,确保编辑时不会覆盖有用结果。对于长时间运行的任务,在后台或 tmux 中运行,并将输出保存到文件。
  5. 根据任务说明检查结果。下一次请求应只针对观察到的一个具体问题,并保留最后一个有用版本。

Handle the output

处理输出

  • Images: always pass
    -o /tmp/askcodex/<name>-vN.png
    . With
    --json
    ,
    .result.width
    ,
    .result.height
    and
    .result.alpha_channel
    come from the saved file;
    alpha_channel: true
    only says transparency is possible, so look at the image before you call it a cutout.
  • Long text answers:
    --json > /tmp/askcodex/<name>.json
    , then
    jq -r .result.text /tmp/askcodex/<name>.json
    . Keep large JSON and image payloads out of the conversation.
  • --json
    ,
    --events
    , and
    --no-refresh
    are global flags and work after the subcommand.
  • Semantic
    --json
    success output is
    {schema_version:1,command,result}
    . Read
    .result
    . Do not pass
    --backend
    (it adds the raw backend response, ~700 KB for
    models
    ) unless the user is debugging the protocol.
  • ask --json
    gives one final envelope with
    .result.model
    ,
    .result.effort
    ,
    .result.verbosity
    ,
    .result.text
    ,
    .result.usage
    (possibly null), and
    .result.json
    with
    --schema
    . The catalog is at
    .result.models
    (slug, description, default_reasoning_level, upgrade); quota windows are at
    .result.rate_limit
    .
  • --events
    prints newline-delimited JSON:
    ask
    sends
    text_delta
    events and one final
    result
    event on success; other commands send their result. Check the exit status: partial text is not success. Do not combine
    --events
    with
    --json
    .
  • transcribe
    prints the text, or
    .result.text
    with
    --json
    .
  • Stdin prompts (
    -
    ) and
    raw --body -
    accept up to 16 MiB of UTF-8. File inputs must be regular files (symlinks to them work; devices and FIFOs do not).
    image edit
    accepts up to five PNG references totaling 25 MiB; renaming a JPEG to
    .png
    does not convert it, and the CLI checks the file signature. These caps are client memory limits, not server limits.
  • raw <METHOD> <PATH> --body '<JSON>'
    is for a backend operation the user explicitly needs. It accepts only the backend origin, leaves JSON and stream bytes unwrapped, and does not support
    --events
    .
  • reference
    prints the CLI reference locally, without credentials or network.
  • 图像:始终传入
    -o /tmp/askcodex/<name>-vN.png
    。使用
    --json
    时,
    .result.width
    、
    .result.height
    和
    .result.alpha_channel
    来自已保存的文件;
    alpha_channel: true
    仅表示可能存在透明度,因此在称其为抠图前应查看图像。
  • 长文本答案:运行
    --json > /tmp/askcodex/<name>.json
    ,然后执行
    jq -r .result.text /tmp/askcodex/<name>.json
    。不要在对话中放入大型 JSON 和图像数据。
  • --json
    、
    --events
    和
    --no-refresh
    是全局 flag,放在子命令后也可以使用。
  • --json
    的语义化成功输出为
    {schema_version:1,command,result}
    。读取
    .result
    。不要传入
    --backend
    ,因为它会附加原始后端响应(对
    models
    而言约为 700 KB),除非用户正在调试协议。
  • ask --json
    最终返回一个 envelope,其中包含
    .result.model
    、
    .result.effort
    、
    .result.verbosity
    、
    .result.text
    、
    .result.usage
    (可能为 null),使用
    --schema
    时还包含
    .result.json
    。模型目录位于
    .result.models
    (包含 slug、description、default_reasoning_level、upgrade);配额窗口位于
    .result.rate_limit
    。
  • --events
    打印换行分隔的 JSON:
    ask
    成功时发送
    text_delta
    事件和一个最终的
    result
    事件;其他命令发送各自的结果。检查退出状态:部分文本不表示成功。不要将
    --events
    与
    --json
    组合使用。
  • transcribe
    打印文本;使用
    --json
    时则打印
    .result.text
    。
  • Stdin prompt(
    -
    )和
    raw --body -
    最多接受 16 MiB 的 UTF-8。文件输入必须是普通文件(指向普通文件的 symlink 可以,设备文件和 FIFO 不行)。
    image edit
    最多接受五张 PNG 参考图,总大小为 25 MiB;将 JPEG 重命名为
    .png
    并不会转换格式,而且 CLI 会检查文件签名。这些上限是客户端内存限制,而非服务器限制。
  • raw <METHOD> <PATH> --body '<JSON>'
    用于用户明确需要的后端操作。它只接受后端 origin,不对 JSON 和流字节进行包装,并且不支持
    --events
    。
  • reference
    会在本地打印 CLI 参考文档,不使用凭据,也不访问网络。

Rules

规则

  • On a nonzero exit, report the error and fix its cause before another attempt. Do not loop, fabricate a result, or silently switch models.
  • With
    --json
    or
    --events
    , a failure prints
    {schema_version:1,error:{code,message, http_status?,backend?}}
    on stderr and no success result. Never turn a partial stream into a completed answer.
    error.backend
    carries the backend's own reason, filtered: only
    code
    ,
    type
    ,
    param
    ,
    message
    ,
    detail
    and
    error
    (or
    incomplete_details.reason
    ), each cut to 400 bytes. When it is absent or reads as cut off, tell the user the full cause could not be read instead of guessing. Act on it:
    The diagnostic saysCauseNext step
    backend.code: "unsupported_value"
    ,
    backend.param: "reasoning.effort"
    The model does not take that effortPick a level from the model's guide and retry once
    backend.code: "invalid_json_schema"
    The
    --schema
    file breaks a strict rule
    Fix the key the message names; no answer was generated
    backend.detail: "... not supported when using Codex with a ChatGPT account."
    Unknown slug, or a model this plan cannot useCheck
    askcodex models
    ; ask the user before using another model
    backend.code: "cyber_policy"
    or another policy code
    A safety classifier blocked the requestReport it; do not reword the request to get around it
    backend.incomplete_details
    The answer was cut shortReport it; narrow the task or ask for less output, then retry once
    code: "rate_limited"
    (HTTP 429)
    Quota or rate limitCheck
    askcodex usage --json --no-refresh
    and tell the user
  • Use
    --no-refresh
    for read-only account and auth checks.
    askcodex auth refresh
    rotates the credentials and rewrites the auth file; run it only when the user asks for a refresh.
  • Write into a project directory only when the user asks for that destination.
  • 退出码非零时,报告错误并先修复原因,然后再进行下一次尝试。不要循环调用、捏造结果或悄悄切换模型。
  • 使用
    --json
    或
    --events
    时,失败会在 stderr 上打印
    {schema_version:1,error:{code,message,http_status?,backend?}}
    ,且不会产生成功结果。绝不能把部分流当作已完成的答案。
    error.backend
    包含经过筛选的后端原因,仅保留
    code
    、
    type
    、
    param
    、
    message
    、
    detail
    和
    error
    (或
    incomplete_details.reason
    ),每项最多截断为 400 字节。如果该字段缺失或看起来被截断,应告知用户无法读取完整原因,而不是猜测。采取以下措施:
    诊断信息原因下一步
    backend.code: "unsupported_value"
    、
    backend.param: "reasoning.effort"
    模型不接受该 effort从模型指南中选择一个 level,然后重试一次
    backend.code: "invalid_json_schema"
    --schema
    文件违反严格规则
    修复消息指出的 key;没有生成任何答案
    backend.detail: "... not supported when using Codex with a ChatGPT account."
    slug 未知,或当前套餐无法使用该模型运行
    askcodex models
    检查;改用其他模型前先询问用户
    backend.code: "cyber_policy"
    或其他 policy code
    安全分类器拦截了请求报告该情况;不要通过改写请求来绕过限制
    backend.incomplete_details
    答案被截断报告该情况;缩小任务或要求更少输出,然后重试一次
    code: "rate_limited"
    (HTTP 429)
    配额或速率限制运行
    askcodex usage --json --no-refresh
    并告知用户
  • 对只读的账户和认证检查使用
    --no-refresh
    。
    askcodex auth refresh
    会轮换凭据并重写认证文件;仅当用户要求刷新时才运行。
  • 只有当用户指定目标位置时,才将文件写入项目目录。

Report

汇报

Tell the user the command you ran, the outcome, the artifact path if one was saved, and any limitation that affects the result. For
ask
, add the model and effort. For an image, give the file's real dimensions and never name a serving model: the backend does not report one. Show an image when the user needs to judge it visually.
告知用户所运行的命令、执行结果、保存产物时的路径,以及影响结果的任何限制。对于
ask
,还要说明模型和 effort。对于图像,给出文件的实际尺寸,绝不能指明提供服务的模型,因为后端不会报告该信息。如果用户需要目视判断,则展示图像。

Install

安装

The binary is
~/.local/bin/askcodex
. From a checkout,
./install.sh
installs it without touching credentials;
--skills agents
,
--skills claude
, or
--skills all
also installs this skill, and
--check-auth
checks credentials without refreshing. See the repository and the generated command reference.
二进制文件位于
~/.local/bin/askcodex
。在 checkout 中运行
./install.sh
不会触碰凭据;
--skills agents
、
--skills claude
或
--skills all
还会安装此 skill,而
--check-auth
可在不刷新的情况下检查凭据。另请参阅仓库及生成的命令参考。