Zing 论坛

正文

CLI Agentic Workflow:将AI Agent CLI转化为可编排的工作流系统

介绍一个轻量级本地优先的CLI工具,通过简单的YAML配置将Claude、Codex等AI Agent CLI转化为强大、可检查、可恢复的工作流,实现AI任务的编排、追踪和自动化管理。

AI Agent工作流CLIClaudeCodexYAML编排自动化本地优先
发布时间 2026/06/11 14:47最近活动 2026/06/11 14:57预计阅读 6 分钟
CLI Agentic Workflow:将AI Agent CLI转化为可编排的工作流系统
1

章节 01

CLI Agentic Workflow: Turning AI Agent CLIs into Orchestrated Workflows

This post introduces CLI Agentic Workflow, a lightweight local-first CLI tool. It uses simple YAML configurations to transform Claude, Codex, and other AI Agent CLIs into powerful, inspectable, resumable workflows. Key benefits include task orchestration, tracking, and automated management, addressing pain points of traditional AI Agent CLIs. (Source: GitHub project by aigengame, released June 11, 2026.)

2

章节 02

The Pain Points of Traditional AI Agent CLIs

Traditional AI Agent CLIs (like Claude Code, Codex CLI) have limitations:

  1. Unrecoverable tasks: Session interruptions (network, terminal close) lose context and state.
  2. Hard to audit: No clear execution records for long tasks.
  3. No orchestration: Lack of coordination between multiple AI tasks.
  4. Repetitive work: Similar tasks require re-entering prompts/context. CLI Agentic Workflow solves these via declarative YAML-based workflow definitions.
3

章节 03

Core Design: Local-First, Lightweight, Inspectable & Resumable

The project follows three key principles:

  • Local-first: All data/state stored locally (data sovereignty, offline use, Git-friendly, privacy).
  • Lightweight: Single binary, minimal dependencies, fast startup.
  • Inspectable & Resumable: Full execution records (input/output/middle states), breakpoint recovery, task replay.
4

章节 04

Workflow Definition Using YAML

YAML is chosen for its readability, version control friendliness, and flexibility. A workflow includes:

  • Basic structure: Name, description, steps.
  • Steps: Each step has name, agent (claude/codex), prompt, depends_on (for execution order).
  • Dependencies: Build DAGs (serial/parallel execution, conditional branches).
  • Context management: Auto-pass step outputs as context, selective references, compression for long dialogues. Example workflow: Code refactoring steps (analyze structure → create modules → update main code → run tests).
5

章节 05

Supported AI Agents & Real-World Scenarios

Supported Agents:

  • Claude Code: Deep code understanding, file operations, terminal commands, long context.
  • Codex CLI: Fast response, multi-language support, OpenAI ecosystem integration.
  • Extensible: Plugin interface for future agents (Copilot CLI, CodeWhisperer, custom agents). Use Cases:
  1. Large-scale code refactoring (split monolith to microservices).
  2. Automated code review (style check, security scan, performance analysis).
  3. Document generation/maintenance (sync API docs with code changes).
6

章节 06

State Management & CI/CD Integration

State Management:

  • Execution states: PENDING/RUNNING/COMPLETED/FAILED/CANCELLED.
  • Checkpoints: Created after each step (full history + file state, recoverable, branchable).
  • Storage: Local file system (JSON), SQLite (for many workflows), Git integration. CI/CD Integration:
  • GitHub Actions: Example workflow to run AI tasks on push/pull_request.
  • Compatible with GitLab CI, Jenkins, CircleCI, Azure DevOps, etc.
7

章节 07

Future Directions & Final Thoughts

Future Directions:

  1. Visual editor: Drag-and-drop workflow design, real-time state preview, debugging.
  2. Community workflow market: Predefined templates for common tasks, tech stack best practices.
  3. Smart optimization: Parallelization suggestions, prompt improvements, execution time/cost prediction. Conclusion: CLI Agentic Workflow shifts AI-assisted development from interactive sessions to orchestrated systems. It enables teams to build complex automated task chains, ensure repeatability/auditability, share AI capabilities, and integrate with DevOps. A key infrastructure for scaling AI Agent use.