🤖 iFlow CLI GitHub Action

Run iFlow CLI commands in your GitHub workflows

GitHub Repository

A Docker-based action with Node.js 22 and npm pre-installed for optimal performance

Features

Docker-based action with pre-installed Node.js 22 and npm
Configurable authentication with iFlow API
Support for custom models and API endpoints
Flexible command execution with timeout control
Works in any working directory
Built with Go for fast, reliable execution
GitHub Actions Summary integration for rich execution reports

Installation

Add the action to your workflow:

name: iFlow CLI Example
on: [push]

jobs:
  analyze-code:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      
      - name: Run iFlow CLI
        uses: vibe-ideas/iflow-cli-action@v1.2.0
        with:
          prompt: "Analyze this codebase and suggest improvements"
          api_key: $\{{ secrets.IFLOW_API_KEY }}

Basic Example

name: iFlow CLI Example
on: [push]

jobs:
  analyze-code:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      
      - name: Run iFlow CLI
        uses: vibe-ideas/iflow-cli-action@v1.2.0
        with:
          prompt: "Analyze this codebase and suggest improvements"
          api_key: $\{{ secrets.IFLOW_API_KEY }}

Advanced Example

name: Advanced iFlow CLI Usage
on: 
  pull_request:
    types: [opened, synchronize]

jobs:
  code-review:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      
      - name: Initialize Project Analysis
        uses: vibe-ideas/iflow-cli-action@v1.2.0
        with:
          prompt: "/init"
          api_key: $\{{ secrets.IFLOW_API_KEY }}
          model: "Qwen3-Coder"
          timeout: "600"
          working_directory: "."
      
      - name: Generate Technical Documentation
        uses: vibe-ideas/iflow-cli-action@v1.2.0
        with:
          prompt: "Generate technical documentation based on the codebase analysis"
          api_key: $\{{ secrets.IFLOW_API_KEY }}
          base_url: "https://apis.iflow.cn/v1"
          model: "DeepSeek-V3"
        id: docs
      
      - name: Display Results
        run: |
          echo "Documentation generated:"
          echo "$\{{ steps.docs.outputs.result }}"

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) ❌ No -
base_url Custom base URL for iFlow API ❌ No https://apis.iflow.cn/v1
model Model name to use ❌ No Qwen3-Coder
working_directory Working directory to run iFlow CLI from ❌ No .
timeout Timeout for iFlow CLI execution in seconds (1-86400) ❌ No 86400
extra_args Additional command line arguments to pass to iFlow CLI ❌ No

Outputs

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

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

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

Using Custom Settings

- name: Custom iFlow Configuration
  uses: vibe-ideas/iflow-cli-action@v1.2.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 }}",
        "customField": "customValue"
      }

Using MCP Servers

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

Example: Using DeepWiki MCP Server

- name: iFlow CLI with MCP Server
  uses: vibe-ideas/iflow-cli-action@v1.2.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"
    extra_args: "--debug"

Common Use Cases

Code Analysis and Review

- name: Code Review
  uses: vibe-ideas/iflow-cli-action@v1.2.0
  with:
    prompt: "Review this pull request for code quality, security issues, and best practices"
    api_key: $\{{ secrets.IFLOW_API_KEY }}

Documentation Generation

- name: Generate Documentation
  uses: vibe-ideas/iflow-cli-action@v1.2.0
  with:
    prompt: "/init && Generate comprehensive API documentation"
    api_key: $\{{ secrets.IFLOW_API_KEY }}
    timeout: "600"

Requirements

  • Runner: Linux-based GitHub Actions runners (ubuntu-latest recommended)
  • Permissions: Actions need internet access to download dependencies
  • Resources: Sufficient timeout for command execution (adjust based on complexity)

Troubleshooting

Common Issues

  • Command timeout: Increase the timeout value for complex operations
  • 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

Contributing

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

License

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

Related