iFlow CLI GitHub Action

A Docker-based GitHub Action for running iFlow CLI commands

Project: github.com/iflow-ai/iflow-cli-action

🚀 Docker-Based

Pre-installed Node.js 22, npm, go, cargo, and uv

🔒 Secure Auth

Configurable authentication with iFlow API

⚙️ Flexible

Support for MCP servers and custom configurations

✨ Features

  • ✅ Docker-based action with pre-installed Node.js 22, npm, go, cargo, and uv
  • ✅ Configurable authentication with iFlow API
  • ✅ Support for MCP servers
  • Agent Client Protocol: use Rust ACP Websocket client to communicate with iFlow CLI
  • ✅ Support for custom models and API endpoints
  • ✅ Flexible command execution with timeout control
  • ✅ Works in any working directory
  • ✅ Built with Rust for fast, reliable execution
  • GitHub Actions Summary integration: Rich execution reports in PR summaries
  • ✅ PR/Issue Integration: Works seamlessly with GitHub comments and PR reviews

📦 Installation & Setup

Basic Usage

Add to your GitHub workflow:

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

Authentication

  1. Register for an iFlow account at iflow.cn
  2. Go to your profile settings or get your API key
  3. Click "Reset" in the pop-up dialog to generate a new API key
  4. Add the API key to your GitHub repository secrets as IFLOW_API_KEY

💡 Usage Example

Issue Triage with iFLOW CLI

name: '🏷️ iFLOW CLI Automated Issue Triage'

on:
  issues:
    types: ['opened', 'reopened']
  issue_comment:
    types: ['created']
  workflow_dispatch:
    inputs:
      issue_number:
        description: 'issue number to triage'
        required: true
        type: 'number'

concurrency:
  group: '${{ github.workflow }}-${{ github.event.issue.number }}'
  cancel-in-progress: true

defaults:
  run:
    shell: 'bash'

permissions:
  contents: 'read'
  issues: 'write'
  statuses: 'write'

jobs:
  triage-issue:
    if: |-
      github.event_name == 'issues' ||
      github.event_name == 'workflow_dispatch' ||
      (
        github.event_name == 'issue_comment' &&
        contains(github.event.comment.body, '@iflow-cli /triage') &&
        contains(fromJSON('["OWNER", "MEMBER", "COLLABORATOR"]'), github.event.comment.author_association)
      )
    runs-on: 'ubuntu-latest'
    steps:
      - name: Checkout repository
        uses: actions/checkout@v4

      - name: 'Run iFlow CLI Issue Triage'
        uses: iflow-ai/iflow-cli-action@v2.0.0
        id: 'iflow_cli_issue_triage'
        env:
          GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
          ISSUE_TITLE: '${{ github.event.issue.title }}'
          ISSUE_BODY: '${{ github.event.issue.body }}'
          ISSUE_NUMBER: '${{ github.event.issue.number }}'
          REPOSITORY: '${{ github.repository }}'
        with:
          api_key: ${{ secrets.IFLOW_API_KEY }}
          timeout: "3600"
          debug: "true"
          prompt: |
            ## Role

            You are an issue triage assistant. Analyze the current GitHub issue
            and apply the most appropriate existing labels. Use the available
            tools to gather information; do not ask for information to be
            provided.

            ## Steps

            1. Run: `gh label list` to get all available labels.
            2. Review the issue title and body provided in the environment
               variables: "${ISSUE_TITLE}" and "${ISSUE_BODY}".
            3. Classify issues by their kind (bug, enhancement, documentation,
               cleanup, etc) and their priority (p0, p1, p2, p3). Set the
               labels according to the format `kind/*` and `priority/*` patterns.
            4. Apply the selected labels to this issue using:
               `gh issue edit "${ISSUE_NUMBER}" --add-label "label1,label2"`
            5. If the "status/needs-triage" label is present, remove it using:
               `gh issue edit "${ISSUE_NUMBER}" --remove-label "status/needs-triage"`

            ## Guidelines

            - Only use labels that already exist in the repository
            - Do not add comments or modify the issue content
            - Triage only the current issue
            - Assign all applicable labels based on the issue content
            - Reference all shell variables as "${VAR}" (with quotes and braces)

🔧 Inputs

Input Description Required Default
prompt The prompt to execute with iFlow CLI ✅ Yes -
api_key iFlow API key for authentication ✅ Yes -
settings_json Complete ~/.iflow/settings.json content (JSON string). If provided, this will override other configuration options. ❌ No -
base_url Custom base URL for iFlow API ❌ No https://apis.iflow.cn/v1
model Model name to use ❌ No qwen3-coder-plus
working_directory Working directory to run iFlow CLI from ❌ No .
timeout Timeout for iFlow CLI execution in seconds (1-86400) ❌ No 86400
precmd Shell command(s) to execute before running iFlow CLI (e.g., "npm install", "git fetch") ❌ No
gh_version Version of GitHub CLI to install (e.g., "2.76.2"). If not specified, uses the pre-installed version. ❌ No
iflow_version Version of iFlow CLI to install (e.g., "0.2.4"). If not specified, uses the pre-installed version. ❌ No

📤 Outputs

Output Description
result Output from iFlow CLI execution
exit_code Exit code from iFlow CLI execution

⚡ Advanced Features

Pre-Execution Commands

- 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

Custom Settings

- name: Custom iFlow Configuration
  uses: iflow-ai/iflow-cli-action@v2.0.0
  with:
    prompt: "Analyze this codebase with custom configuration"
    api_key: ${{ secrets.IFLOW_API_KEY }}  # Still required for basic validation
    settings_json: |
      {
        "theme": "Dark",
        "selectedAuthType": "iflow",
        "apiKey": "${{ secrets.IFLOW_API_KEY }}",
        "baseUrl": "https://custom-api.example.com/v1",
        "modelName": "custom-model",
        "searchApiKey": "${{ secrets.SEARCH_API_KEY }}",
        "customField": "customValue"
      }

🌐 MCP Servers

[MCP (Model Context Protocol)](https://modelcontextprotocol.io) allows iFlow CLI to connect to external tools and services, extending its capabilities beyond just AI model interactions.

Example: Using DeepWiki MCP Server

- 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-plus",
        "searchApiKey": "${{ secrets.IFLOW_API_KEY }}",
        "mcpServers": {
          "deepwiki": {
            "command": "npx",
            "args": ["-y", "mcp-deepwiki@latest"]
          }
        }
      }
    model: "qwen3-coder-plus"
    timeout: "1800"
    debug: "true"

When to Use MCP Servers

  • Enhanced code search and documentation lookup capabilities
  • Integration with external tools and services
  • Access to specialized knowledge bases or databases
  • Custom tooling that extends the iFlow CLI functionality

🎯 Common Use Cases

Code Analysis and Review

Documentation Generation

Issue Management

  • Issue Killer - Automatically implements features based on GitHub issues
  • Issue Triage - Automatically labels new GitHub issues

🛠️ Troubleshooting

Common Issues

Command timeout: Increase the timeout value for complex operations

timeout: "900"  # 15 minutes

API authentication failed: Verify your API key is correctly set in repository secrets

Working directory not found: Ensure the path exists and checkout action is used

Debug Mode

Enable verbose logging by setting environment variables:

env:
  ACTIONS_STEP_DEBUG: true

Thank You! 🙏

iFlow CLI GitHub Action - Empowering Your GitHub Workflows

📖 Documentation

中文文档: README_zh.md

Deep Dive (中文): docs/DeepDive.md

Deep Dive (English): docs/DeepDive_en.md

🤝 Contributing

Contributions are welcome! Please feel free to submit issues and pull requests. Start with Contributing Guide.

🔗 Related Projects

iFlow CLI - The underlying CLI tool

iFlow Platform - Official documentation