A Docker-based GitHub Action for running iFlow CLI commands
Project: github.com/iflow-ai/iflow-cli-action
Pre-installed Node.js 22, npm, go, cargo, and uv
Configurable authentication with iFlow API
Support for MCP servers and custom configurations
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 }}
IFLOW_API_KEYname: '🏷️ 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)
| 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 | |
| Output | Description |
|---|---|
result |
Output from iFlow CLI execution |
exit_code |
Exit code from iFlow CLI execution |
- 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: 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 (Model Context Protocol)](https://modelcontextprotocol.io) allows iFlow CLI to connect to external tools and services, extending its capabilities beyond just AI model interactions.
- 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"
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
Enable verbose logging by setting environment variables:
env:
ACTIONS_STEP_DEBUG: true
iFlow CLI GitHub Action - Empowering Your GitHub Workflows
中文文档: README_zh.md
Deep Dive (中文): docs/DeepDive.md
Deep Dive (English): docs/DeepDive_en.md
Contributions are welcome! Please feel free to submit issues and pull requests. Start with Contributing Guide.
iFlow CLI GitHub Action | MIT License | GitHub Repository