iFlow CLI GitHub Action

A Docker-based GitHub Action for running iFlow CLI commands

iFlow Logo

GitHub: iflow-ai/iflow-cli-action

功能特性

Docker-based Action with pre-installed Node.js 22, npm, go, cargo, and uv

Configurable Authentication with iFlow API

MCP Server Support for enhanced capabilities

Agent Client Protocol using Rust ACP Websocket client

Custom Models and API endpoints support

GitHub Actions Summary integration for rich reports

安装指南

  1. 在 GitHub 仓库中注册 iFlow API 账户
  2. 获取 API 密钥并添加到仓库 Secrets
  3. 在工作流中添加 iFlow CLI Action
  4. 配置所需的输入参数
  5. 运行工作流以执行 iFlow 命令

详细安装指南请参阅 Authentication Section

使用示例

基础配置示例


name: 'iFLOW CLI Basic Example'

on:
  workflow_dispatch:

jobs:
  basic-example:
    runs-on: 'ubuntu-latest'
    steps:
      - name: Checkout repository
        uses: actions/checkout@v4

      - name: 'Run iFlow CLI'
        uses: iflow-ai/iflow-cli-action@v2.0.0
        with:
          api_key: ${{ secrets.IFLOW_API_KEY }}
          prompt: "Analyze this codebase for security issues"

高级功能

MCP 服务器配置


- name: iFlow CLI with MCP Server
  uses: iflow-ai/iflow-cli-action@v2.0.0
  with:
    prompt: "use @deepwiki to search how to use Skynet to build a game"
    api_key: ${{ secrets.IFLOW_API_KEY }}
    settings_json: |
      {
        "selectedAuthType": "iflow",
        "apiKey": "${{ secrets.IFLOW_API_KEY }}",
        "baseUrl": "https://apis.iflow.cn/v1",
        "modelName": "Qwen3-Coder",
        "searchApiKey": "${{ secrets.IFLOW_API_KEY }}",
        "mcpServers": {
          "deepwiki": {
            "command": "npx",
            "args": ["-y", "mcp-deepwiki@latest"]
          }
        }
      }
    model: "Qwen3-Coder"
    timeout: "1800"
    debug: "true"

高级功能(续)

预执行命令


- name: iFlow with Pre-Execution Commands
  uses: iflow-ai/iflow-cli-action@v2.0.0
  with:
    prompt: "Analyze this codebase after installing dependencies"
    api_key: ${{ secrets.IFLOW_API_KEY }}
    precmd: |
      npm install
      git fetch origin main

自定义工具版本


- name: iFlow CLI with Custom Versions
  uses: iflow-ai/iflow-cli-action@v2.0.0
  with:
    prompt: "Analyze this codebase with specific tool versions"
    api_key: ${{ secrets.IFLOW_API_KEY }}
    gh_version: "2.76.2"
    iflow_version: "0.2.4"

常见用例

  • 代码分析与审查 - 自动审查 PR 并提供改进建议
  • 文档生成 - 从代码库自动生成技术文档
  • 自动化测试建议 - 提供测试用例建议
  • 问题管理 - 自动标记和分类 GitHub Issues
  • 架构分析 - 分析代码库架构并提供改进方案

查看 examples 目录 获取详细示例

输入输出参数

输入参数

输入 描述 必需 默认值
prompt 要执行的 iFlow CLI 提示 -
api_key iFlow API 认证密钥 -
timeout 执行超时时间(秒) 86400
precmd 执行前的 shell 命令

输入输出参数(续)

输出参数

输出 描述
result iFlow CLI 执行结果
exit_code iFlow CLI 执行退出码

支持的模型

  • Qwen3-Coder (默认) - 优秀的代码分析和生成
  • kimi-k2-0905 - 通用 AI 任务和长上下文
  • glm-4.6 - 高级推理和问题解决
  • 通过 OpenAI 兼容 API 支持自定义模型

故障排除

常见问题

  • 命令超时: 增加 timeout 值以处理复杂操作
    
    timeout: "900"  # 15 minutes
    
  • API 认证失败: 验证 API 密钥是否正确设置在仓库 Secrets 中
  • 工作目录未找到: 确保路径存在并使用了 checkout action

调试模式


env:
  ACTIONS_STEP_DEBUG: true

致谢与贡献

感谢您关注 iFlow CLI GitHub Action!

贡献: 欢迎提交 Issues 和 Pull Requests

文档: 贡献指南

深入学习: Deep Dive 文档

许可证: MIT License

项目地址: iflow-ai/iflow-cli-action

相关资源