πŸ€– iFlow CLI GitHub Action

Docker-based GitHub Action for running iFlow CLI commands in workflows

View on GitHub

πŸ“‹ Overview

A GitHub Action that enables you to run iFlow CLI commands within your GitHub workflows. This Docker-based action comes with Node.js 22, npm, and uv (ultra-fast Python package manager) pre-installed for optimal performance.

🐳

Docker-based

Pre-installed with Node.js 22, npm, and uv for optimal performance

⚑

Fast Execution

Built with Go for fast, reliable execution

✨ Key Features

πŸ”

Configurable Authentication

Support for iFlow API authentication with custom models and endpoints

⏱️

Timeout Control

Flexible command execution with configurable timeout (1-86400 seconds)

πŸ“

Flexible Working Directory

Works in any working directory with customizable paths

πŸ“Š

GitHub Actions Integration

Rich execution reports in PR summaries with step summaries

πŸ”§

PR/Issue Integration

Seamless integration with GitHub comments and PR reviews

πŸš€ Basic Usage Example

Issue triage with iFLOW CLI:

name: '🏷️ iFLOW CLI Automated Issue Triage'

on:
  issues:
    types: ['opened', 'reopened']
  issue_comment:
    types: ['created']

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

      - name: 'Run iFlow CLI Issue Triage'
        uses: iflow-ai/iflow-cli-action@v1.4.0
        with:
          api_key: ${{ secrets.IFLOW_API_KEY }}
          timeout: "3600"
          extra_args: "--debug"
          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.

βš™οΈ Input Parameters

Input Description Required Default
prompt The prompt to execute with iFlow CLI βœ… Yes -
api_key iFlow API key for authentication βœ… Yes -
settings_json Complete settings.json content (JSON string) ❌ No -
base_url Custom base URL for iFlow API ❌ No https://apis.iflow.cn/v1
model Model name to use ❌ No Qwen3-Coder
timeout Timeout in seconds (1-86400) ❌ No 86400

πŸ“€ Output Parameters

πŸ“„

result

Output from iFlow CLI execution

πŸ”’

exit_code

Exit code from iFlow CLI execution

- name: Use analysis results
  run: |
    echo "Exit code: ${{ steps.analysis.outputs.exit_code }}"
    echo "Results: ${{ steps.analysis.outputs.result }}"

πŸ”‘ Authentication

Getting an iFlow API Key

  1. Register for an iFlow account at iflow.cn
  2. Go to your profile settings or click here to 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

Available Models

  • Qwen3-Coder (default) - Excellent for code analysis and generation
  • Kimi-K2 - Good for general AI tasks and longer contexts
  • DeepSeek-V3 - Advanced reasoning and problem-solving
  • Custom models supported via OpenAI-compatible APIs

πŸ”§ Custom Configuration

Using Extra Arguments

The extra_args input allows you to pass additional command-line arguments directly to the iFlow CLI:

- name: iFlow with Custom Arguments
  uses: iflow-ai/iflow-cli-action@v1.4.0
  with:
    prompt: "Analyze this codebase with debug output"
    api_key: ${{ secrets.IFLOW_API_KEY }}
    extra_args: "--debug --max-tokens 3000"

Examples of Extra Arguments:

  • --debug - Enable iFLOW CLI debug mode
  • --max-tokens 3000 - Set maximum token limit
  • --verbose - Enable verbose output

πŸ› οΈ Pre-Execution Commands

The precmd input allows you to run shell commands before executing the iFlow CLI:

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

Multi-line Commands

You can specify multiple commands by separating them with newlines:

precmd: |
  npm ci
  npm run build
  echo "Environment ready"

βš™οΈ Custom Settings JSON

For advanced users who need complete control over the iFlow configuration:

- name: Custom iFlow Configuration
  uses: iflow-ai/iflow-cli-action@v1.4.0
  with:
    prompt: "Analyze this codebase with custom configuration"
    api_key: ${{ secrets.IFLOW_API_KEY }}
    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 }}"
      }
πŸ’‘

Note

When settings_json is provided, it takes precedence over individual configuration inputs. The api_key input is still required for validation.

πŸ”§ Custom Tool Versions

Specify custom versions of GitHub CLI and iFlow CLI:

- name: iFlow CLI with Custom Versions
  uses: iflow-ai/iflow-cli-action@v1.4.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"
πŸ™

GitHub CLI

Specify exact version for GitHub CLI compatibility

πŸš€

iFlow CLI

Use specific iFlow CLI versions with new features

πŸ”— MCP Servers

MCP (Model Context Protocol) allows iFlow CLI to connect to external tools and services:

Example: DeepWiki MCP Server

- name: iFlow CLI with MCP Server
  uses: iflow-ai/iflow-cli-action@v1.4.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",
        "mcpServers": {
          "deepwiki": {
            "command": "npx",
            "args": ["-y", "mcp-deepwiki@latest"]
          }
        }
      }

🎯 Common Use Cases

πŸ”

Code Analysis and Review

Automated code review workflows for pull requests

πŸ“š

Documentation Generation

Automatically generate technical documentation from codebase

πŸ§ͺ

Automated Testing Suggestions

Generate test cases and testing recommendations

🏷️

Issue Management

Automatic issue triage, labeling, and feature implementation

πŸ—οΈ

Architecture Analysis

Analyze code architecture and provide improvement suggestions

πŸ”§ 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

🀝 Contributing

Contributions are welcome! Please feel free to submit issues and pull requests.

πŸ›

Report Issues

Submit bug reports and feature requests on GitHub

πŸ”€

Pull Requests

Contribute code improvements and new features

πŸ“–

Documentation

Help improve documentation and examples

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ”— Related Resources

πŸš€

iFlow CLI

The underlying CLI tool

πŸ“š

iFlow Platform

Official documentation

πŸ™

GitHub Actions

GitHub Actions Documentation

β™Š

Gemini CLI Action

Similar tool by Google

πŸ“– Documentation

Docs Site: https://iflow-ai.github.io/iflow-cli-action/

πŸ™ Thank You

Start using iFlow CLI GitHub Action today!

Get Started

Made with ❀️ by the iFlow AI team

For support, please visit our GitHub Issues