Version: 2.0.0 (2026-03-16)
Status: Stable
Expertise: CLI Automation, Error Recovery, Tool Chain Management
ai-cli-orchestrator is a meta-skill that integrates multiple AI CLI tools (such as Gemini CLI, Cursor Agent, Claude Code) to build a highly available automation workflow. It intelligently identifies the AI toolchain in the current environment, allocates the optimal tool based on task type, and achieves seamless task context transfer with automatic fallback when the primary tool encounters rate limits, API failures, or logical bottlenecks.
gemini, cursor-agent, claude, etc.).tool --version or simple echo tests to verify API key validity..ai-config.yaml or .env from project root for permission config.text
🤖 AI Assistant Initialization
Detected AI CLI tools:
✅ gemini - Installed
❌ cursor-agent - Not detected
✅ claude - Installed
Select tools to enable (multi-select):
[1] gemini
[2] cursor-agent
[3] claude
[4] Add custom...
text
Enter command name: kimi
Enter test command: kimi --version
Enter description: Moonshot AI
text
Priority (lower number = higher priority):
1. gemini
2. claude
text
Choose AI response strategy:
[1] AI CLI First
- When receiving questions, automatically use AI CLI to search for answers first
[2] Direct Response
- Use model capabilities directly
[3] Hybrid Mode
- Simple questions answered directly, complex questions use AI CLI
Create .ai-cli-orchestrator.yaml in project root:
yaml
version: "2.0"
settings:
default_strategy: "balanced" # options: speed, quality, economy
auto_fallback: true
max_retries: 2
tools:
gemini:
priority: 1
alias: "gemini"
capabilities: ["long-context", "multimodal", "fast-search"]
cursor-agent:
priority: 2
alias: "cursor"
capabilities: ["codebase-indexing", "surgical-edit"]
claude-code:
priority: 3
alias: "claude"
capabilities: ["logic-reasoning", "unit-testing"]
strategies:
balanced:
primary: "gemini"
secondary: "cursor-agent"
emergency: "claude-code"
Error TypeDetectionResponseRate Limit429 Too Many RequestsRecord offset, switch to next tool, delay 30s then reset.Logic LoopSame File Edit 3 timesForce interrupt, output context, request higher-level tool.Auth Failed401 UnauthorizedTry local backup .env; if failed, skip and notify user.Network TimeoutETIMEDOUTRetry once; if still fails, switch to offline mode or backup CLI.Command Not Foundcommand not foundSkip this tool, switch to next available tool.Stalled > 30sTimeoutForce interrupt, switch tool and retry.
Each task associates:
ScenarioActionSame taskKeep long conversation, don't create new sessionDifferent taskCreate new sessionReturn to previous taskSwitch to corresponding session
When switching back to old task:
PriorityToolPurposeFallback1geminiPrimary Q&A/SearchAuto-switch to 22cursor-agentCode tasksAuto-switch to 33claude-codeEmergency fallbackError and notify user
git diff or latest summary.md to the接管 tool.npm test or ruff regardless of which AI tool is used.ai-cli-orchestrator init: Interactive configuration of toolchain and priority.ai-cli-orchestrator run "<task>": Execute task based on strategy and manage lifecycle.ai-cli-orchestrator status: View availability report of all AI services.ai-cli-orchestrator session switch <id>: Manually migrate data between different AI sessions.Support integrating new AI CLIs by writing simple adapters. Just provide:
detect(): How to find the tool.execute(prompt, context): How to call and get output.parse_error(): How to parse its unique error types.This skill requires reading shell and project configuration files to:
.ai-config.yaml, .env)