### Start Agent Installation Wizard Source: https://github.com/iflow-ai/iflow-cli/blob/main/docs_cn/examples/subagent.md Initiate the guided installation process for new agents by running the '/agents install' command. ```bash # Start the Agent installation wizard /agents install ``` -------------------------------- ### Project Initialization and Dependency Installation Source: https://github.com/iflow-ai/iflow-cli/blob/main/docs_en/examples/basic-usage.md Demonstrates initializing a project with `/init` and then installing dependencies using `!npm install`. The AI can then analyze the project based on the installed dependencies. ```bash User: /init AI: I'll analyze your project structure... User: !npm install AI: Dependencies installed successfully. Based on your package.json, this is a React application. Would you like me to check for any configuration issues? ``` -------------------------------- ### Browse and Install Commands from Marketplace Source: https://context7.com/iflow-ai/iflow-cli/llms.txt Discover and install new slash commands from the marketplace using `iflow commands` CLI commands. Use IDs or names to get details and install commands to your project or globally. ```bash /commands online ``` ```bash /commands get 123 ``` ```bash /commands add 123 ``` ```bash /commands add commit --scope global ``` -------------------------------- ### Full settings.json Example Source: https://github.com/iflow-ai/iflow-cli/blob/main/docs_en/configuration/settings.md A comprehensive example demonstrating various configuration options within the settings.json file. ```json { "selectedAuthType": "iflow", "apiKey": "sk-xxx", "baseUrl": "https://apis.iflow.cn/v1", "modelName": "Qwen3-Coder", "theme": "GitHub", "sandbox": "docker", "toolDiscoveryCommand": "bin/get_tools", "toolCallCommand": "bin/call_tool", "mcpServers": { "mainServer": { "command": "bin/mcp_server.py" }, "anotherServer": { "command": "node", "args": ["mcp_server.js", "--verbose"] } }, "telemetry": { "enabled": true, "target": "local", "otlpEndpoint": "http://localhost:4317", "logPrompts": true }, "usageStatisticsEnabled": true, "hideTips": false, "hideBanner": false, "maxSessionTurns": 10, "summarizeToolOutput": { "run_shell_command": { "tokenBudget": 100 } } } ``` -------------------------------- ### View Available Agents Source: https://github.com/iflow-ai/iflow-cli/blob/main/docs_cn/examples/subagent.md Use these commands to list local agents, view their descriptions, browse the online market, or start the installation wizard. ```bash /agents list /agents list desc /agents online /agents install ``` -------------------------------- ### Run Local Observability Setup Source: https://github.com/iflow-ai/iflow-cli/blob/main/docs_en/features/telemetry.md Execute this command in the repository root to automate the setup of local observability pipelines, including installing OpenTelemetry Collector and Jaeger, starting services, and configuring workspace settings. ```bash npm run telemetry -- --target=local ``` -------------------------------- ### Manual Agent Installation Steps Source: https://github.com/iflow-ai/iflow-cli/blob/main/docs_cn/examples/subagent.md Manually install a custom agent by creating its directory and configuration file, then restarting the CLI. ```bash # Create Agent directory mkdir -p ~/.iflow/agents # Create a new Agent file nano ~/.iflow/agents/my-agent.md # Restart CLI to load new Agent iflow ``` -------------------------------- ### Image Processing Examples Source: https://github.com/iflow-ai/iflow-cli/blob/main/docs_en/features/interactive.md Examples demonstrating how to prompt for image analysis and code generation based on visual input. ```bash > [Pasted image #1] Please analyze the design issues of this user interface ``` ```bash > [Pasted image #2] Which of these two interface layouts is better? ``` ```bash > Help me write the corresponding CSS code based on [Pasted image #1] this design draft ``` -------------------------------- ### Install iFlow CLI on Windows Source: https://github.com/iflow-ai/iflow-cli/blob/main/docs_en/quickstart.md Install iFlow CLI on Windows by first installing Node.js, then running the npm install command in a restarted terminal. ```shell npm install -g @iflow-ai/iflow-cli@latest ``` -------------------------------- ### React Project Configuration Example Source: https://github.com/iflow-ai/iflow-cli/blob/main/docs_en/configuration/iflow.md An example IFLOW.md file for a React project, outlining technology stack, code style, and file structure conventions. ```markdown # React Project Configuration ## Project Type This is a modern React application using TypeScript and Vite. ## Development Standards - Prioritize functional components and Hooks - State management using Zustand - Styling using Tailwind CSS - Testing using Jest + Testing Library ## Code Style - Component files use PascalCase naming - Hook files start with use - Constants use UPPER_SNAKE_CASE - Interfaces start with I (e.g., IUser) ## File Structure Conventions ``` src/ ├── components/ # Reusable components ├── pages/ # Page components ├── hooks/ # Custom hooks ├── stores/ # Zustand stores ├── services/ # API calls ├── types/ # TypeScript types └── utils/ # Utility functions ``` ## Special Requirements - All components must have TypeScript type declarations - Asynchronous operations use React Query - Routing uses React Router v6 ``` -------------------------------- ### Install MCP Server from Marketplace Source: https://context7.com/iflow-ai/iflow-cli/llms.txt Use the `iflow mcp add-json` command to install MCP servers from the marketplace. Specify the server name and its JSON configuration, including the command and arguments. ```bash iflow mcp add-json 'playwright' '{"command":"npx","args":["-y","@iflow-mcp/playwright-mcp@0.0.32"]}' ``` -------------------------------- ### Simple File Import Example Source: https://github.com/iflow-ai/iflow-cli/blob/main/docs_en/features/memory-import.md Demonstrates importing multiple files into a main configuration document. ```markdown # Main configuration file Welcome to my project! @./getting-started.md ## Features @./features/overview.md ``` -------------------------------- ### UI Design Analysis Example Source: https://github.com/iflow-ai/iflow-cli/blob/main/docs_en/features/interactive.md Example of providing an image for UI/UX analysis. ```bash > [Pasted image #1] Please analyze the user experience issues of this login page ``` -------------------------------- ### File Analysis Example Source: https://github.com/iflow-ai/iflow-cli/blob/main/docs_en/features/interactive.md Example of combining file references with specific analysis requests. ```bash > Please analyze the performance issues of @src/components/Header.tsx and provide optimization suggestions ``` -------------------------------- ### Install iFlow CLI Source: https://context7.com/iflow-ai/iflow-cli/llms.txt Choose an installation method based on your operating system and package manager. Node.js 22+ is required for npm installation. Verify installation with `iflow --version`. ```bash bash -c "$(curl -fsSL https://cloud.iflow.cn/iflow-cli/install.sh)" ``` ```bash brew tap iflow-ai/iflow-cli brew install iflow-cli ``` ```bash npm i -g @iflow-ai/iflow-cli@latest ``` ```bash iflow --version ``` ```bash npm uninstall -g @iflow-ai/iflow-cli ``` -------------------------------- ### Install and Manage Workflows Source: https://context7.com/iflow-ai/iflow-cli/llms.txt Commands for adding workflows from the marketplace and initializing the iFlow environment. ```bash # Install workflow from marketplace iflow workflow add "ppt-generator-v3-OzctqA" # Start iFlow in project directory iflow # Execute workflow command /ppt-generator # Flowchart drawing workflow iflow workflow add "excalidraw-OzctqA" /excalidraw your drawing topic # Workflow directory structure after installation: # project/ # ├── .iflow/ # │ ├── agents/ # Agent configurations # │ ├── commands/ # Command implementations # │ ├── IFLOW.md # Workflow documentation # │ └── settings.json # MCP configurations # └── IFLOW.md # Root workflow config ``` -------------------------------- ### Backend Developer Quick Start Source: https://github.com/iflow-ai/iflow-cli/blob/main/docs_en/scenarios.md Commands for initializing API project analysis and performing database-related operations. ```bash # 1. API project analysis cd my-api-project iflow > /init > Analyze the architecture of this API project and generate interface documentation # 2. Database-related operations > Design user table structure based on business requirements > Optimize the performance of this SQL query > Generate database migration scripts ``` -------------------------------- ### Launch iFlow CLI Source: https://github.com/iflow-ai/iflow-cli/blob/main/README.md Command to start the iFlow CLI after installation. Navigate to your workspace in the terminal and run this command. ```shell iflow ``` -------------------------------- ### Install iFlow CLI Source: https://github.com/iflow-ai/iflow-cli/blob/main/IFLOW.md Execute this command in your terminal to download and run the installation script. ```bash bash -c "$(curl -fsSL https://cloud.iflow.cn/iflow-cli/install.sh)" ``` -------------------------------- ### Install MCP tools via Marketplace Source: https://github.com/iflow-ai/iflow-cli/blob/main/docs_en/examples/mcp.md Use the add-json command to install MCP tools from the marketplace. Commands can be executed at the project level or with the ! prefix inside the iFlow CLI. ```bash # Basic syntax iflow mcp add-json 'server-name' '{JSON configuration}' # Example: Install Playwright automation tool iflow mcp add-json 'playwright' '{"command":"npx","args":["-y","@iflow-mcp/playwright-mcp@0.0.32"]}' # When executing in iFlow CLI (add ! prefix), manually refresh mcp list !iflow mcp add-json 'playwright' '{"command":"npx","args":["-y","@iflow-mcp/playwright-mcp@0.0.32"]}' /mcp refresh ``` ```bash iflow mcp add-json --scope user 'server-name' '{JSON configuration}' ``` -------------------------------- ### Install iFlow CLI via One-Click Script Source: https://github.com/iflow-ai/iflow-cli/blob/main/docs_en/quickstart.md Execute a one-click installation script to install iFlow CLI and all required dependencies. ```shell bash -c "$(curl -fsSL https://gitee.com/iflow-ai/iflow-cli/raw/main/install.sh)" ``` -------------------------------- ### Project-Specific Memory Examples Source: https://github.com/iflow-ai/iflow-cli/blob/main/docs_cn/configuration/iflow.md Examples of tailored IFLOW.md configurations for different project types and team workflows. ```markdown # React 项目配置 ## 项目类型 这是一个现代 React 应用,使用 TypeScript 和 Vite。 ## 开发规范 - 优先使用函数组件和 Hooks - 状态管理使用 Zustand - 样式使用 Tailwind CSS - 测试使用 Jest + Testing Library ## 代码风格 - 组件文件使用 PascalCase 命名 - Hook 文件以 use 开头 - 常量使用 UPPER_SNAKE_CASE - 接口以 I 开头(如 IUser) ## 文件结构约定 ``` src/ ├── components/ # 可复用组件 ├── pages/ # 页面组件 ├── hooks/ # 自定义 hooks ├── stores/ # Zustand stores ├── services/ # API 调用 ├── types/ # TypeScript 类型 └── utils/ # 工具函数 ``` ## 特殊要求 - 所有组件必须有 TypeScript 类型声明 - 异步操作使用 React Query - 路由使用 React Router v6 ``` ```markdown # Node.js 后端项目 ## 技术栈 - Framework: Express.js - Database: PostgreSQL + Prisma ORM - Authentication: JWT - Validation: Zod - Testing: Jest + Supertest ## 架构模式 采用分层架构:Controller -> Service -> Repository -> Database ## API 规范 - RESTful API 设计 - 统一错误处理中间件 - 请求参数验证使用 Zod - 响应格式:`{ success: boolean, data?: any, error?: string }` ## 安全要求 - 所有路由需要适当的认证和授权 - 敏感信息使用环境变量 - 输入数据必须验证和清理 - 错误信息不暴露内部实现 ## 部署配置 - 使用 Docker 容器化 - 环境变量通过 .env 文件管理 - 生产环境使用 PM2 进程管理 ``` ```markdown # 团队开发规范 ## 代码提交规范 - 使用 Conventional Commits 格式 - 提交前必须通过 lint 和 test - 每个 PR 必须有代码审查 - 重要变更需要技术方案讨论 ## 分支策略 - main: 生产环境代码 - develop: 开发环境代码 - feature/*: 功能分支 - hotfix/*: 紧急修复分支 ## 代码审查要点 1. 代码逻辑正确性 2. 性能考虑 3. 安全性检查 4. 测试覆盖度 5. 文档完整性 ## 沟通协作 - 重大架构变更先讨论再实现 - 遇到问题及时在群里沟通 - 定期进行技术分享 - 保持代码和文档同步更新 ``` -------------------------------- ### Code Debugging Example Source: https://github.com/iflow-ai/iflow-cli/blob/main/docs_en/features/interactive.md Example of providing an image screenshot for debugging purposes. ```bash > [Pasted image #1] How to solve the problem shown in this error screenshot? ``` -------------------------------- ### Generated Memory Content Example Source: https://github.com/iflow-ai/iflow-cli/blob/main/docs_cn/configuration/iflow.md An example of the content structure generated by the /init command. ```markdown # 项目上下文 ## 项目概述 这是一个基于 TypeScript + React + Node.js 的全栈应用。 ## 技术栈 - 前端:React 18, TypeScript, Vite - 后端:Node.js, Express, TypeScript - 数据库:PostgreSQL - 测试:Jest, React Testing Library ## 项目结构 ``` src/ ├── components/ # React 组件 ├── services/ # API 服务 ├── utils/ # 工具函数 └── types/ # TypeScript 类型定义 ``` ## 开发规范 - 使用 TypeScript 严格模式 - 组件采用函数式写法 - 使用 ESLint + Prettier 代码格式化 - 提交前运行 pre-commit hooks ``` -------------------------------- ### Install iFlow CLI SDK Source: https://github.com/iflow-ai/iflow-cli/blob/main/docs_en/sdk/sdk-python.md Install the required Python package via pip. ```bash pip install iflow-cli-sdk ``` -------------------------------- ### Start New Project with iFlow CLI Source: https://github.com/iflow-ai/iflow-cli/blob/main/README.md Initiate a new project by describing your desired creation in the terminal after navigating to your project directory. ```shell cd new-project/ iflow > Create a web-based Minecraft game using HTML ``` -------------------------------- ### Main IFLOW.md Configuration Source: https://github.com/iflow-ai/iflow-cli/blob/main/docs_en/configuration/iflow.md Example of a main IFLOW.md file that imports other documentation files and includes project-specific instructions. ```markdown # Project Overall Configuration @./.iflow/architecture.md @./.iflow/coding-style.md @./.iflow/deployment.md ## Project-Specific Instructions Please follow the above architecture and coding standards when working on this project. ``` -------------------------------- ### IFLOW.md Context File Example Source: https://context7.com/iflow-ai/iflow-cli/llms.txt Example of an IFLOW.md context file used for project-specific instructions to the AI. This markdown file defines general instructions, coding style, and project structure. ```markdown # Project: E-Commerce Platform ## General Instructions - Use TypeScript for all new code with strict mode enabled - Follow existing coding patterns and conventions - Ensure all functions have JSDoc documentation - Write unit tests for new functionality ## Coding Style - Use 2 spaces for indentation - Interface names prefixed with `I` (e.g., `IUserService`) - Private members prefixed with underscore - Use strict equality (`===`) ## Project Structure - `src/api/` - REST API endpoints - `src/services/` - Business logic - `src/models/` - Data models - `src/utils/` - Helper functions ``` -------------------------------- ### Conditional Import Configuration Source: https://github.com/iflow-ai/iflow-cli/blob/main/docs_en/features/memory-import.md Example of importing different configuration files based on the environment. ```markdown # Development environment configuration @./configs/development.md # Production environment configuration @./configs/production.md ``` -------------------------------- ### Initialize and Configure Frontend Development Environment Source: https://github.com/iflow-ai/iflow-cli/blob/main/docs_en/scenarios.md Commands to initialize a project and install the Playwright MCP tool for frontend tasks. ```bash # 1. Project initialization cd my-react-project iflow > /init # 2. Install frontend-related MCP tools !iflow mcp add-json 'playwright' '{"command":"npx","args":["-y","@iflow-mcp/playwright-mcp"]}' # 3. Common task examples > Create a responsive user card component with dark mode support > Help me optimize the rendering performance of this React component > Analyze accessibility issues on the current page ``` -------------------------------- ### Large Text Input Examples Source: https://github.com/iflow-ai/iflow-cli/blob/main/docs_en/features/interactive.md Examples of pasting large text blocks into the CLI for analysis or refactoring. ```bash > Please help me refactor this code: [Pasted text #1 +45 lines] > Analyze the errors in this log file: [Pasted text #2 +120 lines] ``` -------------------------------- ### Learn React Hooks and Docker Source: https://github.com/iflow-ai/iflow-cli/blob/main/docs_en/scenarios.md Initiate learning plans for technologies like React Hooks and understand concepts like Docker with practical examples. ```bash # Technology learning iflow > I want to learn React Hooks, please give me a complete learning plan > Explain what Docker is and provide practical examples > Compare the pros and cons of Vue and React ``` -------------------------------- ### Install Global MCP Server Source: https://context7.com/iflow-ai/iflow-cli/llms.txt Install an MCP server globally using the `--scope user` flag, making it available to all projects. This is useful for shared development tools. ```bash iflow mcp add-json --scope user 'server-name' '{"command":"node","args":["server.js"]}' ``` -------------------------------- ### Frontend Project Ignore Rules Source: https://github.com/iflow-ai/iflow-cli/blob/main/docs_en/configuration/iflowignore.md Example configuration for a React or Vue project. ```bash # .iflowignore for React/Vue project # Build output build/ dist/ .next/ # Dependencies node_modules/ # Logs and cache *.log .cache/ .parcel-cache/ # Environment variable files .env.local .env.production # Test coverage coverage/ # IDE configuration (but keep .vscode) .idea/ *.swp *.swo ``` -------------------------------- ### Node.js Backend Project Example Source: https://github.com/iflow-ai/iflow-cli/blob/main/docs_en/configuration/iflow.md An example IFLOW.md file for a Node.js backend project, detailing the technology stack, architecture, API standards, and security requirements. ```markdown # Node.js Backend Project ## Technology Stack - Framework: Express.js - Database: PostgreSQL + Prisma ORM - Authentication: JWT - Validation: Zod - Testing: Jest + Supertest ## Architecture Pattern Uses layered architecture: Controller -> Service -> Repository -> Database ## API Standards - RESTful API design - Unified error handling middleware - Request parameter validation using Zod - Response format: `{ success: boolean, data?: any, error?: string }` ## Security Requirements - All routes need appropriate authentication and authorization - Sensitive information uses environment variables - Input data must be validated and sanitized - Error messages should not expose internal implementation ## Deployment Configuration - Use Docker for containerization - Environment variables managed through .env files - Production environment uses PM2 for process management ``` -------------------------------- ### Absolute Path Import Source: https://github.com/iflow-ai/iflow-cli/blob/main/docs_en/configuration/iflow.md Shows how to reference files using an absolute path starting from the root. ```markdown @/absolute/path/to/file.md ``` -------------------------------- ### Example Generated IFLOW.md Content Source: https://github.com/iflow-ai/iflow-cli/blob/main/docs_en/configuration/iflow.md A sample structure of an IFLOW.md file generated by the /init command. ```markdown # Project Context ## Project Overview This is a full-stack application based on TypeScript + React + Node.js. ## Technology Stack - Frontend: React 18, TypeScript, Vite - Backend: Node.js, Express, TypeScript - Database: PostgreSQL - Testing: Jest, React Testing Library ## Project Structure ``` src/ ├── components/ # React components ├── services/ # API services ├── utils/ # Utility functions └── types/ # TypeScript type definitions ``` ## Development Standards - Use TypeScript strict mode - Components use functional approach - Use ESLint + Prettier for code formatting - Run pre-commit hooks before committing ``` -------------------------------- ### Example Natural Language Prompts for iFlow CLI Source: https://github.com/iflow-ai/iflow-cli/blob/main/README.md Illustrative examples of natural language prompts for various tasks, including information gathering, file management, data analysis, development support, and workflow automation. ```text > Help me find the best-rated restaurants in Los Angeles and create a 3-day food tour itinerary. ``` ```text > Search for the latest iPhone price comparisons and find the most cost-effective purchase option. ``` ```text > Organize the files on my desktop by file type into separate folders. ``` ```text > Batch download all images from this webpage and rename them by date. ``` ```text > Analyze the sales data in this Excel spreadsheet and generate a simple chart. ``` ```text > Extract customer information from these CSV files and merge them into a unified table. ``` ```text > Analyze the main architectural components and module dependencies of this system. ``` ```text > I'm getting a null pointer exception after my request, please help me find the cause of the problem. ``` ```text > Create a script to periodically backup my important files to cloud storage. ``` ```text > Write a program that downloads stock prices daily and sends me email notifications. ``` -------------------------------- ### Install Commands Source: https://github.com/iflow-ai/iflow-cli/blob/main/docs_en/examples/subcommand.md Add commands to the CLI using the add command, with options to specify project or global scope. ```bash # Basic syntax iflow commands add [--scope project|global] # Install to project (default) iflow commands add 123 iflow commands add 123 --scope project # Install to global iflow commands add commit --scope global # Actual examples iflow commands add 456 --scope project # Code review tool iflow commands add docs --scope global # General documentation generation tool # View more details iflow commands -h ``` -------------------------------- ### Install Agents via CLI Source: https://context7.com/iflow-ai/iflow-cli/llms.txt Install agents using the `iflow agent add` command, specifying the agent name and scope (project or global). List and remove agents with corresponding commands. ```bash iflow agent add python-expert --scope project ``` ```bash iflow agent add code-reviewer --scope global ``` ```bash iflow agent list ``` ```bash iflow agent remove ``` -------------------------------- ### Streaming Response Example with IFlowQuery in Kotlin Source: https://github.com/iflow-ai/iflow-cli/blob/main/docs_cn/sdk/sdk-android.md This example demonstrates how to handle streaming responses from iFlow using the queryStream method. It prints chunks of text as they are received and indicates when the stream is complete. ```kotlin import com.iflow.sdk.query.IFlowQuery fun streamExample() { // 流式响应 IFlowQuery.queryStream( text = "解释一下什么是升华现象", onChunk = { chunk -> print(chunk) }, onComplete = { reason -> println("\n完成!") } ) } ``` -------------------------------- ### DevOps Engineer Quick Start Source: https://github.com/iflow-ai/iflow-cli/blob/main/docs_en/scenarios.md Commands for optimizing deployment scripts and configuring infrastructure monitoring. ```bash # 1. Deployment script optimization iflow > Analyze existing Docker configuration and provide optimization suggestions > Create CI/CD pipeline configuration > Design monitoring and alerting strategies ``` -------------------------------- ### Agent Collaboration Example Source: https://github.com/iflow-ai/iflow-cli/blob/main/docs_en/examples/subagent.md Demonstrates how multiple agents can be chained together to perform sequential tasks, such as code review, performance optimization, and documentation generation. ```bash # First perform code review $code-reviewer Check current code for security issues # Then optimize performance $performance-expert Optimize code performance based on review results # Finally generate documentation $doc-writer Generate complete documentation for the optimized code ``` -------------------------------- ### Manage Agent Installations Source: https://github.com/iflow-ai/iflow-cli/blob/main/docs_en/examples/subagent.md Commands for adding, listing, removing, and inspecting agents at project or global scopes. ```bash # Add project-level Agent iflow agent add --scope project # Add user-level Agent (global scope) iflow agent add --scope global # Actual examples iflow agent add python-expert --scope project iflow agent add code-reviewer --scope global # Other management commands iflow agent list # List all configured Agents iflow agent remove # Remove specified Agent iflow agent get # View Agent details iflow agent online # Browse online Agent marketplace ``` -------------------------------- ### Frontend Development Use Case Source: https://github.com/iflow-ai/iflow-cli/blob/main/docs_en/examples/subagent.md Example of using the '$frontend-developer' agent to create a responsive user login component with form validation. ```bash $frontend-developer Create a responsive user login component with form validation ``` -------------------------------- ### Configuration Format Source: https://github.com/iflow-ai/iflow-cli/blob/main/docs_en/examples/hooks.md Details how to add the `hooks` configuration item in the `settings.json` file and provides an example of the overall structure. ```APIDOC ## Configuration Format ### Description Add the `hooks` configuration item in the `settings.json` file. ### Example Configuration ```json { "hooks": { "PreToolUse": [ { "matcher": "tool_pattern", "hooks": [ { "type": "command", "command": "your_command", "timeout": 30 } ] } ], "PostToolUse": [ { "matcher": "another_pattern", "hooks": [ { "type": "command", "command": "cleanup_command" } ] } ], "SetUpEnvironment": [ { "hooks": [ { "type": "command", "command": "python ~/.iflow/hooks/env_enhancer.py", "timeout": 30 } ] } ], "Stop": [ { "hooks": [ { "type": "command", "command": "echo 'Session ended'" } ] } ], "SubagentStop": [ { "hooks": [ { "type": "command", "command": "cleanup_subagent.sh" } ] } ], "SessionStart": [ { "matcher": "startup", "hooks": [ { "type": "command", "command": "echo 'Session initialized'" } ] } ], "SessionEnd": [ { "hooks": [ { "type": "command", "command": "python ~/.iflow/hooks/session_summary.py" } ] } ], "UserPromptSubmit": [ { "matcher": ".*sensitive.*", "hooks": [ { "type": "command", "command": "python ~/.iflow/hooks/content_filter.py" } ] } ], "Notification": [ { "matcher": ".*permission.*", "hooks": [ { "type": "command", "command": "logger 'iFlow permission request'" } ] } ] } } ``` ``` -------------------------------- ### Data Analyst Quick Start Source: https://github.com/iflow-ai/iflow-cli/blob/main/docs_en/scenarios.md Commands for analyzing data files and generating reports or visualizations. ```bash # 1. Data file analysis iflow > @data/sales_2024.csv Analyze this sales data and identify main trends > Generate Python script for monthly sales reports > Create interactive data visualization charts ``` -------------------------------- ### Global Command Directory Structure Source: https://github.com/iflow-ai/iflow-cli/blob/main/docs_en/examples/subcommand.md Example of the directory structure for global iFlow CLI commands, showing TOML configuration files. ```bash # Global command directory ~/.iflow/commands/ ├── my-command.toml ├── code-reviewer.toml └── project-analyzer.toml ``` -------------------------------- ### Initialize Project Documentation Source: https://github.com/iflow-ai/iflow-cli/blob/main/docs_en/examples/basic-usage.md Use the `/init` command to automatically analyze your codebase and generate project documentation. It identifies project type, tech stack, dependencies, and configuration files. ```bash /init ``` -------------------------------- ### Combine Initialization and Build Commands Source: https://github.com/iflow-ai/iflow-cli/blob/main/docs_en/examples/basic-usage.md Illustrates combining the `/init` command for project setup with `!npm run build` for building the project, followed by a natural language request for AI analysis if issues arise. ```bash # First initialize the project /init # Then execute related operations !npm run build # If encountering issues, let AI help analyze Please help me analyze the cause of the build failure ``` -------------------------------- ### Documentation Writing Scenario Source: https://github.com/iflow-ai/iflow-cli/blob/main/docs_cn/examples/subagent.md Generate detailed technical documentation and usage examples for an API endpoint using the '$doc-writer' agent. ```bash $doc-writer Write detailed technical documentation and usage examples for this API endpoint ``` -------------------------------- ### Project Initialization Workflow Source: https://github.com/iflow-ai/iflow-cli/blob/main/docs_en/examples/best-practices.md Use this sequence to provide the AI with project context and establish a development plan. ```bash # Standard project start process /init # Analyze project structure !git status # Check current status Please help me create a development plan for this project ``` -------------------------------- ### Initialize Project Context Source: https://github.com/iflow-ai/iflow-cli/blob/main/docs_en/configuration/iflow.md Run the /init command to automatically analyze the project and generate an IFLOW.md file. ```bash # Execute in project root directory $ iflow > /init # Example output Empty IFLOW.md created. Now analyzing the project to populate it. Analyzing project structure... Generating customized context... IFLOW.md has been successfully populated with project-specific information. ``` -------------------------------- ### Install iFlow CLI using npm Source: https://github.com/iflow-ai/iflow-cli/blob/main/README.md Install the iFlow CLI globally using npm. This command also installs all necessary dependencies for your terminal. ```shell npm i -g @iflow-ai/iflow-cli ``` -------------------------------- ### Install iFlow CLI via npm Source: https://github.com/iflow-ai/iflow-cli/blob/main/docs_en/quickstart.md Install the latest version of iFlow CLI globally using npm, assuming Node.js 22+ is already installed. ```shell npm i -g @iflow-ai/iflow-cli@latest ``` -------------------------------- ### Browse Interactive Marketplace Source: https://github.com/iflow-ai/iflow-cli/blob/main/docs_en/examples/subcommand.md Enter the interactive marketplace mode to browse, search, and install commands using keyboard shortcuts. ```bash # Enter interactive command marketplace /commands online # Operation examples during browsing # 1. Use j/k or arrow keys to browse command list # 2. Press Enter to view details of interesting commands # 3. Press i key to directly install commands # 4. Press / key to search for commands with specific functionality ``` -------------------------------- ### List Available Agents Source: https://github.com/iflow-ai/iflow-cli/blob/main/docs_cn/examples/subagent.md Use the '/agents list' command to view all installed Agents and their configurations. This is useful for verifying Agent availability and troubleshooting. ```bash /agents list ``` -------------------------------- ### Install iFlow CLI using Homebrew Source: https://github.com/iflow-ai/iflow-cli/blob/main/README.md Install the iFlow CLI on macOS using the Homebrew package manager. This involves tapping the repository and then installing the package. ```shell brew tap iflow-ai/iflow-cli brew install iflow-cli ``` -------------------------------- ### List and Manage Installed Commands Source: https://context7.com/iflow-ai/iflow-cli/llms.txt Manage your installed slash commands using `iflow commands` commands. List all commands, remove project-specific commands, or remove globally installed commands. ```bash /commands list ``` ```bash /commands remove code-reviewer ``` ```bash /commands remove code-reviewer --scope global ``` -------------------------------- ### Initialize Existing Project with iFlow CLI Source: https://github.com/iflow-ai/iflow-cli/blob/main/README.md Use the `/init` command in an existing project to help iFlow understand the codebase, generate documentation, and implement solutions based on requirements. ```shell cd project1/ iflow > /init > Analyze the requirements according to the PRD document in requirement.md file, and output a technical document, then implement the solution. ``` -------------------------------- ### Start and Use iFlow CLI Source: https://context7.com/iflow-ai/iflow-cli/llms.txt Initiate the iFlow CLI in your project directory. Interact using natural language, shell commands prefixed with '!', or slash commands prefixed with '/'. File references use the '@' prefix. ```bash cd your-project/ iflow ``` ```bash > /init # Analyze and document project structure > Help me optimize this React component # Natural language request > !npm test # Execute shell command and analyze output > @src/App.tsx Fix the bug in this file # Reference files with @ prefix > /clear # Clear conversation history > /quit # Exit CLI ``` ```bash iflow --prompt "Generate a Python script that calculates Fibonacci" ``` ```bash iflow -i "explain this code" ``` ```bash iflow --yolo ``` -------------------------------- ### Verify iFlow CLI Installation Source: https://github.com/iflow-ai/iflow-cli/blob/main/docs_en/quickstart.md Run this command to confirm that the iFlow CLI has been successfully installed. ```shell iflow --version ``` -------------------------------- ### Manage MCP configurations Source: https://github.com/iflow-ai/iflow-cli/blob/main/docs_en/examples/mcp.md View help documentation or add MCP servers using JSON configuration files. ```bash iflow mcp --help ``` ```bash # Basic syntax iflow mcp add-json '' # Example: Weather API server iflow mcp add-json weather-api '{ "type": "stdio", "command": "/path/to/weather-cli", "args": ["--api-key", "abc123"], "env": {"CACHE_DIR": "/tmp"} }' # Verify installation iflow mcp get weather-api ``` -------------------------------- ### List Installed Commands Source: https://github.com/iflow-ai/iflow-cli/blob/main/docs_en/examples/subcommand.md Display all currently installed commands using the list command or its aliases. ```bash # List all installed commands /commands list /commands show # Alias /commands local # Alias # Example output: # Installed commands: # # 🌍 Global Commands (2): ``` -------------------------------- ### Initialize Project Memory Source: https://github.com/iflow-ai/iflow-cli/blob/main/docs_cn/configuration/iflow.md Use the /init command to automatically analyze the project and generate a tailored IFLOW.md file. ```bash # 在项目根目录执行 $ iflow > /init # 输出示例 Empty IFLOW.md created. Now analyzing the project to populate it. Analyzing project structure... Generating customized context... IFLOW.md has been successfully populated with project-specific information. ``` -------------------------------- ### Dynamic Configuration Loading Source: https://github.com/iflow-ai/iflow-cli/blob/main/docs_en/configuration/iflow.md Demonstrates loading different configuration files based on the environment using relative paths. ```markdown # Environment-Related Configuration @./config/development.md @./config/production.md ``` -------------------------------- ### Example Markdown Command with Context Source: https://github.com/iflow-ai/iflow-cli/blob/main/docs_en/examples/subcommand.md An example of a Markdown file for a git commit command, including context derived from git commands. ```markdown --- description: Create a git commit --- ## Context - Current git status: !`git status` - Current git diff (staged and unstaged changes): !`git diff HEAD` - Current branch: !`git branch --show-current` - Recent commits: !`git log --oneline -10` ## Your task Based on the above changes, create a single git commit. ``` -------------------------------- ### Frontend Development Scenario Source: https://github.com/iflow-ai/iflow-cli/blob/main/docs_cn/examples/subagent.md Create a responsive user login component with form validation using the '$frontend-developer' agent. ```bash $frontend-developer Create a responsive user login component, supporting form validation ``` -------------------------------- ### Quick Call Examples Source: https://github.com/iflow-ai/iflow-cli/blob/main/docs_en/examples/subagent.md Illustrates how to use the '$' symbol to quickly call different types of agents for specific tasks. Ensure the agent type is valid and the task description is clear. ```bash $code-reviewer Perform code review on the current project ``` ```bash $frontend-developer Create a responsive navigation component ``` ```bash $python-expert Optimize this algorithm's performance ``` ```bash $data-scientist Analyze trends in this dataset ``` -------------------------------- ### Install Commands via CLI Source: https://context7.com/iflow-ai/iflow-cli/llms.txt Install commands directly using the `iflow commands add` command, specifying the command name or ID and the scope (project or global). ```bash iflow commands add --scope project ``` ```bash iflow commands add --scope global ``` -------------------------------- ### Run Project Analysis Source: https://github.com/iflow-ai/iflow-cli/blob/main/docs_en/quickstart.md Initializes project analysis within a directory. ```shell # In any code project directory cd your-project/ iflow > /init > Analyze the structure and main features of this project ``` -------------------------------- ### Import Modular Configuration Files Source: https://github.com/iflow-ai/iflow-cli/blob/main/docs_en/configuration/iflow.md Use the @ syntax to include external markdown files for modular configuration management. ```markdown # Main IFLOW.md file @./shared/coding-standards.md @./project-specific/architecture.md @../global/personal-preferences.md ``` -------------------------------- ### Agent Management Commands Source: https://context7.com/iflow-ai/iflow-cli/llms.txt Manage installed agents using slash commands within the CLI. Commands include listing agents, viewing descriptions, browsing the marketplace, and initiating installation. ```bash /agents list ``` ```bash /agents list desc ``` ```bash /agents online ``` ```bash /agents install ``` ```bash /agents refresh ``` -------------------------------- ### Create .iflowignore File Source: https://github.com/iflow-ai/iflow-cli/blob/main/docs_en/configuration/iflowignore.md Initialize a new .iflowignore file in the project root directory. ```bash touch .iflowignore ``` -------------------------------- ### Initialize Command Directory Source: https://github.com/iflow-ai/iflow-cli/blob/main/docs_en/examples/subcommand.md Create the necessary directory structure to store custom command configuration files. ```bash # Create command directory mkdir -p ~/.iflow/commands ``` -------------------------------- ### Initialize iFlow CLI Source: https://github.com/iflow-ai/iflow-cli/blob/main/IFLOW.md Run this command within a project directory to scan the codebase and generate the IFLOW.md documentation file. ```text iflow > /init ``` -------------------------------- ### AgentInfo Parsing Example Source: https://github.com/iflow-ai/iflow-cli/blob/main/docs_en/sdk/sdk-python.md Parse detailed information from an iFlow agent ID using the AgentInfo class. This example shows how to extract agent ID, task ID, agent index, and timestamp. ```python from iflow_sdk import AgentInfo # Parse information from agent ID agent_id = "subagent-task-abc123-2-1735123456789" agent_info = AgentInfo.from_agent_id_only(agent_id) if agent_info: print(f"Agent ID: {agent_info.agent_id}") print(f"Task ID: {agent_info.task_id}") print(f"Agent Index: {agent_info.agent_index}") print(f"Timestamp: {agent_info.timestamp}") ``` -------------------------------- ### Team Collaboration Standards Example Source: https://github.com/iflow-ai/iflow-cli/blob/main/docs_en/configuration/iflow.md An example IFLOW.md file outlining team development standards, including code commit conventions, branching strategy, code review points, and communication guidelines. ```markdown # Team Development Standards ## Code Commit Standards - Use Conventional Commits format - Must pass lint and test before committing - Each PR must have code review - Important changes require technical proposal discussion ## Branching Strategy - main: Production environment code - develop: Development environment code - feature/*: Feature branches - hotfix/*: Emergency fix branches ## Code Review Points 1. Code logic correctness 2. Performance considerations 3. Security checks 4. Test coverage 5. Documentation completeness ## Communication and Collaboration - Discuss major architectural changes before implementation - Communicate issues promptly in the team chat - Conduct regular technical sharing sessions - Keep code and documentation synchronized ``` -------------------------------- ### Configure IFlowClient Source: https://github.com/iflow-ai/iflow-cli/blob/main/docs_en/sdk/sdk-python.md Demonstrates using default settings versus custom IFlowOptions for connection management. ```python from iflow_sdk import IFlowClient, IFlowOptions # Use default configuration (auto-manage process) async with IFlowClient() as client: await client.send_message("Your question") async for message in client.receive_messages(): # Handle messages pass # Use custom configuration options = IFlowOptions( url="ws://localhost:8090/acp", # WebSocket URL auto_start_process=True, # Auto-start iFlow timeout=30.0 # Timeout (seconds) ) async with IFlowClient(options) as client: await client.send_message("Your question") async for message in client.receive_messages(): # Handle messages pass ``` -------------------------------- ### Verify Installation Requirements Source: https://github.com/iflow-ai/iflow-cli/blob/main/docs_en/quickstart.md Checks Node.js version and network connectivity. ```shell # Check Node.js version node --version # Requires 22+ # Check network connection curl -I https://apis.iflow.cn/v1 ``` -------------------------------- ### Python Project Ignore Rules Source: https://github.com/iflow-ai/iflow-cli/blob/main/docs_en/configuration/iflowignore.md Example configuration for a Python project. ```bash # .iflowignore for Python project # Python cache __pycache__/ *.pyc *.pyo *.pyd # Virtual environments venv/ env/ .venv/ # Build files build/ dist/ *.egg-info/ # Jupyter Notebook checkpoints .ipynb_checkpoints/ # Testing and coverage .pytest_cache/ .coverage htmlcov/ ``` -------------------------------- ### Troubleshooting - Connection Issues Source: https://github.com/iflow-ai/iflow-cli/blob/main/docs_en/sdk/sdk-python.md Guide to resolving connection issues with iFlow. ```APIDOC ## Troubleshooting - Connection Issues ### Description Steps to diagnose and resolve common connection problems when using iFlow. ### Checks 1. **Is iFlow installed** ```bash iflow --version ``` 2. **Is the port occupied** ```bash # Linux/Mac lsof -i :8090 # Windows netstat -an | findstr :8090 ``` 3. **Manual connection testing** ```bash iflow --experimental-acp --port 8090 ``` ``` -------------------------------- ### Troubleshooting Guide Source: https://github.com/iflow-ai/iflow-cli/blob/main/docs_en/features/slash-commands.md Common issues, solutions, and diagnostic steps for the CLI. ```APIDOC ## Troubleshooting ### Common Issues and Solutions | Issue | Possible Cause | Solution | |---|---|---| | Command not recognized | Spelling error or command doesn't exist | Check spelling, use `/help` to view available commands | | Invalid parameters | Incorrect parameter format | View command help information, use Tab completion | | Network connection failed | Network issues or server unavailable | Check network connection, retry later | | Insufficient permissions | Missing necessary system permissions | Check file permissions or system settings | | Configuration file error | Incorrect configuration file format | Reconfigure or restore default settings | ### Diagnostic Steps 1. **Basic Check**: Confirm command spelling, use `/help`, check parameter format. 2. **Network Connection**: Verify network, check firewall, confirm server accessibility. 3. **Configuration Verification**: Use `/about`, check config files, re-run configuration commands. 4. **Error Troubleshooting**: View detailed error info, use `/log`, use `/bug` to report issues. ### Platform Compatibility | Platform | Support Level | Special Considerations | |---|---|---| | Windows | Full support | Paths use backslashes | | macOS | Full support | May need system permission authorization | | Linux | Full support | Depends on terminal environment configuration | ``` -------------------------------- ### Directory Reference Examples Source: https://github.com/iflow-ai/iflow-cli/blob/main/docs_en/features/interactive.md Usage of the @directorypath syntax to reference entire directories. ```bash > Analyze the utility functions in the @src/utils directory > Refactor the component structure in the @src/components directory ``` -------------------------------- ### Quick iFlow CLI Experience Source: https://github.com/iflow-ai/iflow-cli/blob/main/docs_en/scenarios.md Run this command for a quick experience of the iFlow CLI and to analyze the current directory. ```bash iflow` then enter `> Hello, help me analyze the current directory` ``` -------------------------------- ### Execute Task in iFlow Source: https://github.com/iflow-ai/iflow-cli/blob/main/docs_en/features/suspending-resuming.md Example of providing an instruction to the iFlow interactive session. ```text >>> "Write a python hello world" ``` -------------------------------- ### Effective Questioning Methods Source: https://github.com/iflow-ai/iflow-cli/blob/main/docs_en/examples/best-practices.md Examples of how to structure queries for better AI responses. ```text I encountered an issue while implementing user authentication. Here's my code: [paste relevant code] When running tests, I get the following error: [paste complete error message] I'm using Node.js + Express + JWT, please help me analyze the problem and provide solutions. ``` ```text Code doesn't work, please fix it ``` -------------------------------- ### Create and Configure a New Command Source: https://github.com/iflow-ai/iflow-cli/blob/main/docs_en/examples/subcommand.md Steps to create a new custom command by making a TOML file in the `.iflow/commands` directory and defining its description and prompt. ```bash mkdir -p ./.iflow/commands touch ./.iflow/commands/my-command.toml ``` ```toml description = "Test command" prompt = "This is a test command" ``` -------------------------------- ### SessionStart Hook Configuration Source: https://github.com/iflow-ai/iflow-cli/blob/main/docs_en/examples/hooks.md Configure a SessionStart hook to run a command when a session begins, matching specific start sources like 'startup'. This can initialize the environment or set up logging. ```json { "hooks": { "SessionStart": [ { "matcher": "startup", "hooks": [ { "type": "command", "command": "echo 'New session started'" } ] } ] } } ``` -------------------------------- ### Generate Docker Configuration Files Source: https://github.com/iflow-ai/iflow-cli/blob/main/docs_en/scenarios.md Configure deployment environments by generating Docker configuration files, creating Kubernetes deployment scripts, and setting up monitoring rules. ```bash # Deployment configuration iflow > Generate Docker configuration files > Create Kubernetes deployment scripts > Configure monitoring and alerting rules ``` -------------------------------- ### Flowchart Drawing Workflow Source: https://github.com/iflow-ai/iflow-cli/blob/main/docs_en/examples/workflow.md Commands to install and execute the Excalidraw-based flowchart generation workflow. ```shell iflow workflow add "excalidraw-OzctqA" ``` ```shell iflow ``` ```shell /excalidraw your drawing topic ``` -------------------------------- ### AI PPT Generation Workflow Source: https://github.com/iflow-ai/iflow-cli/blob/main/docs_en/examples/workflow.md Commands to install and execute the PPT generator workflow. ```shell iflow workflow add "ppt-generator-v3-OzctqA" ``` ```shell iflow ``` ```shell /ppt-generator ```