Files
Claude-Code-Workflow/docs/commands/claude/cli.md
catlog22 4a89f626fc Refactor documentation for code commands and workflows
- Updated command syntax formatting to use code blocks for clarity in `prep.md`, `review.md`, and `spec.md`.
- Enhanced architectural diagrams in `ch01-what-is-claude-dms3.md` and core concepts in `ch03-core-concepts.md` using mermaid syntax for better visualization.
- Improved workflow diagrams in `ch04-workflow-basics.md` and `4-level.md` to provide clearer representations of processes.
- Added troubleshooting section in `installation.md` to address common installation issues and provide quick start examples.
- Revised skill documentation in `claude-meta.md` and `claude-workflow.md` to standardize command triggers and output structures.
- Updated best practices and workflow index documentation to enhance readability and understanding of workflow levels and practices.
2026-02-28 19:53:24 +08:00

4.0 KiB

CLI Tool Commands

One-Liner

CLI tool commands are the bridge to external model invocation — integrating Gemini, Qwen, Codex and other multi-model capabilities into workflows.

Core Concepts

Concept Description Configuration
CLI Tool External AI model invocation interface cli-tools.json
Endpoint Available model services gemini, qwen, codex, claude
Mode analysis / write / review Permission level

Command List

Command Function Syntax
cli-init Generate configuration directory and settings files /cli:cli-init [--tool gemini|qwen|all] [--output path] [--preview]
codex-review Interactive code review using Codex CLI /cli:codex-review [--uncommitted|--base <branch>|--commit <sha>] [prompt]

Command Details

cli-init

Function: Generate .gemini/ and .qwen/ configuration directories based on workspace tech detection, including settings.json and ignore files.

Syntax:

/cli:cli-init [--tool gemini|qwen|all] [--output path] [--preview]

Options:

  • --tool=tool: gemini, qwen or all
  • --output=path: Output directory
  • --preview: Preview mode (don't actually create)

Generated File Structure:

.gemini/
├── settings.json      # Gemini configuration
└── ignore            # Ignore patterns

.qwen/
├── settings.json      # Qwen configuration
└── ignore            # Ignore patterns

Tech Detection:

Detection Item Generated Config
TypeScript tsconfig-related config
React React-specific config
Vue Vue-specific config
Python Python-specific config

Examples:

# Initialize all tools
/cli:cli-init --tool all

# Initialize specific tool
/cli:cli-init --tool gemini

# Specify output directory
/cli:cli-init --output ./configs

# Preview mode
/cli:cli-init --preview

codex-review

Function: Interactive code review using Codex CLI via ccw endpoint, supporting configurable review targets, models, and custom instructions.

Syntax:

/cli:codex-review [--uncommitted|--base <branch>|--commit <sha>] [--model <model>] [--title <title>] [prompt]

Options:

  • --uncommitted: Review uncommitted changes
  • --base <branch>: Compare with branch
  • --commit <sha>: Review specific commit
  • --model <model>: Specify model
  • --title <title>: Review title

Note: Target flags and prompt are mutually exclusive

Examples:

# Review uncommitted changes
/cli:codex-review --uncommitted

# Compare with main branch
/cli:codex-review --base main

# Review specific commit
/cli:codex-review --commit abc123

# With custom instructions
/cli:codex-review --uncommitted "focus on security issues"

# Specify model and title
/cli:codex-review --model gpt-5.2 --title "Authentication module review"

CLI Tool Configuration

cli-tools.json Structure

{
  "version": "3.3.0",
  "tools": {
    "gemini": {
      "enabled": true,
      "primaryModel": "gemini-2.5-flash",
      "secondaryModel": "gemini-2.5-flash",
      "tags": ["analysis", "Debug"],
      "type": "builtin"
    },
    "qwen": {
      "enabled": true,
      "primaryModel": "coder-model",
      "tags": [],
      "type": "builtin"
    },
    "codex": {
      "enabled": true,
      "primaryModel": "gpt-5.2",
      "tags": [],
      "type": "builtin"
    }
  }
}

Mode Descriptions

Mode Permission Use Cases
analysis Read-only Code review, architecture analysis, pattern discovery
write Create/modify/delete Feature implementation, bug fixes, documentation creation
review Git-aware code review Review uncommitted changes, branch diffs, specific commits