consult

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

consult - AI Consultation CLI

consult - AI咨询CLI

Synopsis

概述

bash
consult -m <model> [options]
consult stats [options]
The
-m
/
--model
flag is always required (except for stats).
bash
consult -m <model> [options]
consult stats [options]
-m
/
--model
标记始终为必填项(stats模式除外)。

Models

模型

ModelAliasSpeedApproach
gemini
pro
~120-150sFile access via --yolo, fast
codex
gpt
~200-250sShell command exploration, thorough
claude
opus
~60-120sAgent SDK with tool use
模型别名速度实现方式
gemini
pro
~120-150s通过--yolo访问文件,速度快
codex
gpt
~200-250sShell命令探索,全面深入
claude
opus
~60-120s支持工具调用的Agent SDK

Modes

模式

General Mode

通用模式

bash
consult -m gemini --prompt "What's the best way to structure auth?"
consult -m codex --prompt-file review-checklist.md
bash
consult -m gemini --prompt "What's the best way to structure auth?"
consult -m codex --prompt-file review-checklist.md

Protocol Mode

协议模式

bash
consult -m gemini --protocol spir --type spec       # Review a specification
consult -m codex --protocol spir --type plan        # Review a plan
consult -m claude --protocol spir --type impl       # Review implementation
consult -m gemini --protocol spir --type pr         # Review a PR
consult -m codex --protocol spir --type phase       # Phase-scoped review
consult -m gemini --type integration                # Integration review
bash
consult -m gemini --protocol spir --type spec       # Review a specification
consult -m codex --protocol spir --type plan        # Review a plan
consult -m claude --protocol spir --type impl       # Review implementation
consult -m gemini --protocol spir --type pr         # Review a PR
consult -m codex --protocol spir --type phase       # Phase-scoped review
consult -m gemini --type integration                # Integration review

Stats Mode

选项

bash
consult stats                     # 30-day summary
consult stats --days 7 --json     # Last 7 days as JSON
bash
-m, --model <model>         # Model to use (required except stats)
--prompt <text>              # Inline prompt (general mode)
--prompt-file <path>         # Prompt from file (general mode)
--protocol <name>            # Protocol: spir, bugfix, tick, maintain
-t, --type <type>            # Review type: spec, plan, impl, pr, phase, integration
--issue <number>             # Issue number (architect context)

Options

评审类型(搭配--protocol使用的--type)

bash
-m, --model <model>         # Model to use (required except stats)
--prompt <text>              # Inline prompt (general mode)
--prompt-file <path>         # Prompt from file (general mode)
--protocol <name>            # Protocol: spir, bugfix, tick, maintain
-t, --type <type>            # Review type: spec, plan, impl, pr, phase, integration
--issue <number>             # Issue number (architect context)
类型使用场景
spec
评审规范完整性
plan
评审实现方案
impl
评审代码实现
pr
合并前评审拉取请求
phase
阶段范围评审(仅构建者可用)
integration
架构师的集成评审
协议特定的提示词存储在
codev/protocols/<protocol>/consult-types/
路径下。

Review Types (--type with --protocol)

上下文解析

TypeUse Case
spec
Review specification completeness
plan
Review implementation plan
impl
Review code implementation
pr
Review pull request before merge
phase
Phase-scoped review (builder only)
integration
Architect's integration review
Protocol-specific prompts live in
codev/protocols/<protocol>/consult-types/
.
  • 构建者上下文(当前工作目录在
    .builders/
    中):自动从porch状态检测项目
  • 架构师上下文(当前工作目录在
    .builders/
    外):需要
    --issue <N>
    参数

Context Resolution

并行咨询(三方/ cmap模式)

  • Builder context (cwd in
    .builders/
    ): auto-detects project from porch state
  • Architect context (cwd outside
    .builders/
    ): requires
    --issue <N>
为进行全面评审,可并行运行三个模型:
bash
consult -m gemini --protocol spir --type spec &
consult -m codex --protocol spir --type spec &
consult -m claude --protocol spir --type spec &
wait
或者在Claude Code中使用cmap模式:三个并行的后台Bash调用。

Parallel Consultation (3-Way / cmap)

常见错误

Run all three models in parallel for thorough reviews:
bash
consult -m gemini --protocol spir --type spec &
consult -m codex --protocol spir --type spec &
consult -m claude --protocol spir --type spec &
wait
Or from Claude Code, use cmap pattern: three parallel background Bash calls.
  • -m
    标记为必填项——
    consult --type spec
    如果没有该标记会执行失败
  • 不能同时使用
    --prompt
    --type
    (模式冲突)
  • 不能同时使用
    --prompt
    --prompt-file
  • --protocol
    需要搭配
    --type
    使用——不能单独使用
  • 通用模式:
    --prompt
    的文本需直接传入,不能作为位置参数

Common Mistakes

  • The
    -m
    flag is required
    consult --type spec
    will fail without it
  • Cannot combine
    --prompt
    with
    --type
    (mode conflict)
  • Cannot use
    --prompt
    and
    --prompt-file
    together
  • --protocol
    requires
    --type
    — cannot use alone
  • General mode:
    --prompt
    text is passed directly, not as a positional arg