mirror of
https://github.com/catlog22/Claude-Code-Workflow.git
synced 2026-02-04 01:40:45 +08:00
- Implemented CliCommandNode component for executing CLI tools with AI models. - Implemented PromptNode component for constructing AI prompts with context. - Added styling for mode and tool badges in both components. - Enhanced user experience with command and argument previews, execution status, and error handling. test: add comprehensive tests for ask_question tool - Created direct test for ask_question tool execution. - Developed end-to-end tests to validate ask_question tool integration with WebSocket and A2UI surfaces. - Implemented simple and integrated WebSocket tests to ensure proper message handling and surface reception. - Added tool registration test to verify ask_question tool is correctly registered. chore: add WebSocket listener and simulation tests - Added WebSocket listener for A2UI surfaces to facilitate testing. - Implemented frontend simulation test to validate complete flow from backend to frontend. - Created various test scripts to ensure robust testing of ask_question tool functionality.
1 line
12 KiB
JavaScript
1 line
12 KiB
JavaScript
"use strict";(globalThis.webpackChunkccw_docs=globalThis.webpackChunkccw_docs||[]).push([[142],{1149(e,n,i){i.r(n),i.d(n,{assets:()=>c,contentTitle:()=>r,default:()=>h,frontMatter:()=>o,metadata:()=>s,toc:()=>d});const s=JSON.parse('{"id":"commands/cli/cli-init","title":"/cli:cli-init","description":"Initialize CLI configuration for workspace with automatic technology detection","source":"@site/docs/commands/cli/cli-init.mdx","sourceDirName":"commands/cli","slug":"/commands/cli/cli-init","permalink":"/docs/docs/commands/cli/cli-init","draft":false,"unlisted":false,"editUrl":"https://github.com/ccw/docs/tree/main/docs/commands/cli/cli-init.mdx","tags":[],"version":"current","sidebarPosition":1,"frontMatter":{"title":"/cli:cli-init","sidebar_label":"/cli:cli-init","sidebar_position":1,"description":"Initialize CLI configuration for workspace with automatic technology detection"},"sidebar":"docs","previous":{"title":"issue:convert-to-plan","permalink":"/docs/docs/commands/issue/issue-convert-to-plan"},"next":{"title":"/cli:codex-review","permalink":"/docs/docs/commands/cli/codex-review"}}');var l=i(2540),t=i(1184);const o={title:"/cli:cli-init",sidebar_label:"/cli:cli-init",sidebar_position:1,description:"Initialize CLI configuration for workspace with automatic technology detection"},r="/cli",c={},d=[{value:"Overview",id:"overview",level:2},{value:"Features",id:"features",level:2},{value:"Usage",id:"usage",level:2},{value:"Generated Files",id:"generated-files",level:2},{value:"Configuration Directories",id:"configuration-directories",level:3},{value:"Ignore Files",id:"ignore-files",level:3},{value:"Supported Technology Stacks",id:"supported-technology-stacks",level:2},{value:"Frontend Technologies",id:"frontend-technologies",level:3},{value:"Backend Technologies",id:"backend-technologies",level:3},{value:"Configuration Files",id:"configuration-files",level:3},{value:"Command Options",id:"command-options",level:2},{value:"Execution Flow",id:"execution-flow",level:2},{value:"Examples",id:"examples",level:2},{value:"Basic Project Setup",id:"basic-project-setup",level:3},{value:"Technology Migration",id:"technology-migration",level:3},{value:"Tool-Specific Setup",id:"tool-specific-setup",level:3},{value:"Related Commands",id:"related-commands",level:2},{value:"Notes",id:"notes",level:2}];function a(e){const n={code:"code",h1:"h1",h2:"h2",h3:"h3",header:"header",li:"li",ol:"ol",p:"p",pre:"pre",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,t.R)(),...e.components};return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(n.header,{children:(0,l.jsxs)(n.h1,{id:"cli",children:["/cli",":cli-init"]})}),"\n",(0,l.jsx)(n.p,{children:"Initialize CLI tool configurations for the workspace by analyzing project structure and generating optimized configuration files."}),"\n",(0,l.jsx)(n.h2,{id:"overview",children:"Overview"}),"\n",(0,l.jsxs)(n.p,{children:["The ",(0,l.jsx)(n.code,{children:"/cli:cli-init"})," command analyzes your workspace to detect technology stacks and automatically generates CLI tool configurations for Gemini and Qwen with optimized ignore patterns."]}),"\n",(0,l.jsxs)(n.p,{children:[(0,l.jsx)(n.strong,{children:"Supported Tools"}),": gemini, qwen, all (default)"]}),"\n",(0,l.jsx)(n.h2,{id:"features",children:"Features"}),"\n",(0,l.jsxs)(n.ul,{children:["\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.strong,{children:"Automatic Technology Detection"})," - Analyzes project structure to identify tech stacks"]}),"\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.strong,{children:"Smart Ignore Rules"})," - Generates filtering patterns optimized for detected technologies"]}),"\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.strong,{children:"Configuration Generation"})," - Creates tool-specific settings files"]}),"\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.strong,{children:"Multi-Tool Support"})," - Configure Gemini, Qwen, or both simultaneously"]}),"\n"]}),"\n",(0,l.jsx)(n.h2,{id:"usage",children:"Usage"}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-bash",children:"# Initialize all CLI tools (Gemini + Qwen)\r\n/cli:cli-init\r\n\r\n# Initialize only Gemini\r\n/cli:cli-init --tool gemini\r\n\r\n# Initialize only Qwen\r\n/cli:cli-init --tool qwen\r\n\r\n# Preview what would be generated\r\n/cli:cli-init --preview\r\n\r\n# Generate in subdirectory\r\n/cli:cli-init --output=.config/\n"})}),"\n",(0,l.jsx)(n.h2,{id:"generated-files",children:"Generated Files"}),"\n",(0,l.jsx)(n.h3,{id:"configuration-directories",children:"Configuration Directories"}),"\n",(0,l.jsxs)(n.p,{children:[(0,l.jsx)(n.strong,{children:"For Gemini"})," (",(0,l.jsx)(n.code,{children:".gemini/"}),"):"]}),"\n",(0,l.jsxs)(n.ul,{children:["\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.code,{children:".gemini/settings.json"})," - Context file configuration"]}),"\n"]}),"\n",(0,l.jsxs)(n.p,{children:[(0,l.jsx)(n.strong,{children:"For Qwen"})," (",(0,l.jsx)(n.code,{children:".qwen/"}),"):"]}),"\n",(0,l.jsxs)(n.ul,{children:["\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.code,{children:".qwen/settings.json"})," - Context file configuration"]}),"\n"]}),"\n",(0,l.jsx)(n.h3,{id:"ignore-files",children:"Ignore Files"}),"\n",(0,l.jsxs)(n.ul,{children:["\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.code,{children:".geminiignore"})," - File filtering patterns for Gemini CLI"]}),"\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.code,{children:".qwenignore"})," - File filtering patterns for Qwen CLI"]}),"\n"]}),"\n",(0,l.jsx)(n.p,{children:"Both ignore files use gitignore syntax and include technology-specific rules."}),"\n",(0,l.jsx)(n.h2,{id:"supported-technology-stacks",children:"Supported Technology Stacks"}),"\n",(0,l.jsx)(n.h3,{id:"frontend-technologies",children:"Frontend Technologies"}),"\n",(0,l.jsxs)(n.ul,{children:["\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.strong,{children:"React/Next.js"})," - Ignores build artifacts, .next/, node_modules"]}),"\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.strong,{children:"Vue/Nuxt"})," - Ignores .nuxt/, dist/, .cache/"]}),"\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.strong,{children:"Angular"})," - Ignores dist/, .angular/, node_modules"]}),"\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.strong,{children:"Webpack/Vite"})," - Ignores build outputs, cache directories"]}),"\n"]}),"\n",(0,l.jsx)(n.h3,{id:"backend-technologies",children:"Backend Technologies"}),"\n",(0,l.jsxs)(n.ul,{children:["\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.strong,{children:"Node.js"})," - Ignores node_modules/, npm-debug.log*, package-lock.json"]}),"\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.strong,{children:"Python"})," - Ignores ",(0,l.jsx)(n.strong,{children:"pycache"}),"/, *.py[cod], .venv/, venv/"]}),"\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.strong,{children:"Java"})," - Ignores target/, .gradle/, *.class, *.jar"]}),"\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.strong,{children:"Go"})," - Ignores vendor/, *.exe, *.test"]}),"\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.strong,{children:"Rust"})," - Ignores target/, Cargo.lock"]}),"\n"]}),"\n",(0,l.jsx)(n.h3,{id:"configuration-files",children:"Configuration Files"}),"\n",(0,l.jsxs)(n.p,{children:["Both ",(0,l.jsx)(n.code,{children:".gemini/settings.json"})," and ",(0,l.jsx)(n.code,{children:".qwen/settings.json"})," are configured with:"]}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-json",children:'{\r\n "contextfilename": ["CLAUDE.md"]\r\n}\n'})}),"\n",(0,l.jsx)(n.h2,{id:"command-options",children:"Command Options"}),"\n",(0,l.jsxs)(n.table,{children:[(0,l.jsx)(n.thead,{children:(0,l.jsxs)(n.tr,{children:[(0,l.jsx)(n.th,{children:"Option"}),(0,l.jsx)(n.th,{children:"Description"}),(0,l.jsx)(n.th,{children:"Default"})]})}),(0,l.jsxs)(n.tbody,{children:[(0,l.jsxs)(n.tr,{children:[(0,l.jsx)(n.td,{children:(0,l.jsx)(n.code,{children:"--tool <name>"})}),(0,l.jsx)(n.td,{children:"Tool to configure (gemini, qwen, all)"}),(0,l.jsx)(n.td,{children:"all"})]}),(0,l.jsxs)(n.tr,{children:[(0,l.jsx)(n.td,{children:(0,l.jsx)(n.code,{children:"--output <path>"})}),(0,l.jsx)(n.td,{children:"Custom output directory"}),(0,l.jsx)(n.td,{children:"Current directory"})]}),(0,l.jsxs)(n.tr,{children:[(0,l.jsx)(n.td,{children:(0,l.jsx)(n.code,{children:"--preview"})}),(0,l.jsx)(n.td,{children:"Show what would be generated without creating files"}),(0,l.jsx)(n.td,{children:"false"})]})]})]}),"\n",(0,l.jsx)(n.h2,{id:"execution-flow",children:"Execution Flow"}),"\n",(0,l.jsxs)(n.ol,{children:["\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.strong,{children:"Workspace Analysis"})," - Runs ",(0,l.jsx)(n.code,{children:"get_modules_by_depth"})," to analyze project structure"]}),"\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.strong,{children:"Technology Detection"})," - Identifies tech stacks based on files and directories"]}),"\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.strong,{children:"Configuration Generation"})," - Creates tool-specific configuration directories"]}),"\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.strong,{children:"Ignore Rules Generation"})," - Creates organized ignore files with detected patterns"]}),"\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.strong,{children:"File Creation"})," - Writes all configuration files to disk"]}),"\n"]}),"\n",(0,l.jsx)(n.h2,{id:"examples",children:"Examples"}),"\n",(0,l.jsx)(n.h3,{id:"basic-project-setup",children:"Basic Project Setup"}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-bash",children:"# Initialize all CLI tools\r\n/cli:cli-init\r\n\r\n# Output:\r\n# Creating .gemini/ directory\r\n# Creating .qwen/ directory\r\n# Generating .geminiignore with 45 rules\r\n# Generating .qwenignore with 45 rules\r\n# Technology detected: Node.js, TypeScript, React\n"})}),"\n",(0,l.jsx)(n.h3,{id:"technology-migration",children:"Technology Migration"}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-bash",children:"# After adding Docker to project\r\n/cli:cli-init\r\n\r\n# Regenerates all config and ignore files with new Docker rules\n"})}),"\n",(0,l.jsx)(n.h3,{id:"tool-specific-setup",children:"Tool-Specific Setup"}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-bash",children:"# Gemini-only workflow\r\n/cli:cli-init --tool gemini\r\n\r\n# Creates only .gemini/ and .geminiignore\n"})}),"\n",(0,l.jsx)(n.h2,{id:"related-commands",children:"Related Commands"}),"\n",(0,l.jsxs)(n.ul,{children:["\n",(0,l.jsxs)(n.li,{children:[(0,l.jsxs)(n.strong,{children:["/cli",":codex-review"]})," - Code review using Codex CLI"]}),"\n",(0,l.jsxs)(n.li,{children:[(0,l.jsxs)(n.strong,{children:["/memory",":update-full"]})," - Full project memory update"]}),"\n",(0,l.jsxs)(n.li,{children:[(0,l.jsxs)(n.strong,{children:["/workflow",":lite-execute"]})," - Quick execution workflow"]}),"\n"]}),"\n",(0,l.jsx)(n.h2,{id:"notes",children:"Notes"}),"\n",(0,l.jsxs)(n.ul,{children:["\n",(0,l.jsx)(n.li,{children:"Backs up existing configuration files before overwriting"}),"\n",(0,l.jsx)(n.li,{children:"Auto-detects technology stacks from common indicators"}),"\n",(0,l.jsx)(n.li,{children:"Generated ignore patterns optimize CLI tool performance"}),"\n",(0,l.jsx)(n.li,{children:"Safe to run multiple times - preserves existing configurations"}),"\n"]})]})}function h(e={}){const{wrapper:n}={...(0,t.R)(),...e.components};return n?(0,l.jsx)(n,{...e,children:(0,l.jsx)(a,{...e})}):a(e)}},1184(e,n,i){i.d(n,{R:()=>o,x:()=>r});var s=i(3696);const l={},t=s.createContext(l);function o(e){const n=s.useContext(t);return s.useMemo(function(){return"function"==typeof e?e(n):{...n,...e}},[n,e])}function r(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(l):e.components||l:o(e.components),s.createElement(t.Provider,{value:n},e.children)}}}]); |