Search

Project overview

On this page

Go Version License: EUPL-1.2

A Go CLI tool for orchestrating AI agents (Claude, Gemini, Codex, GitHub Copilot, Mistral Vibe, OpenCode, OpenAI-Compatible APIs) through YAML-configured workflows with state machine execution.

Features

  • State Machine Execution - Define workflows as state machines with conditional transitions based on exit codes, command output, or custom expressions
  • Inline Error Handling - Specify error messages and exit codes directly on steps without creating separate terminal states
  • Agent Steps - Invoke AI agents via CLI tools (Claude, Codex, Gemini, GitHub Copilot, Mistral Vibe, OpenCode) or direct HTTP (OpenAI, Ollama, vLLM, Groq) with prompt templates, response parsing, and accurate token tracking
  • Output Formatting for Agent Steps - Automatically strip markdown code fences and validate JSON output; human-readable streaming display controlled by output_format field (text vs raw NDJSON); unified display-event abstraction across all 7 providers with optional verbose mode showing tool-use markers ([tool: Name(Arg)]); automatic state.Response population for structured JSON output (heuristic across all providers)
  • Agent Skills - Inject deterministic domain knowledge into agent steps via skills: declarations in workflow YAML; filesystem-based multi-directory discovery (project .awf/skills/, .agents/skills/, .claude/skills/, XDG global) with priority ordering; SKILL.md frontmatter stripping and agentskills.io-compliant <skill_content> structured wrapping with bundled resource enumeration; validated by awf validate
  • Agent Roles - Inject reusable personas into agent steps via role: field referencing AGENTS.md files; filesystem-based multi-directory discovery in a dedicated roles/ namespace (project .awf/roles/, .agents/roles/, $XDG_CONFIG_HOME/awf/roles/, ~/.agents/roles/) with priority ordering and AWF_ROLES_PATH exclusive override; AGENTS.md frontmatter stripping and system prompt injection with optional composition via inline system_prompt field; validated by awf validate
  • External Prompt Files - Load agent prompts from .md files with full template interpolation, helper functions, and local override support
  • External Script Files - Load commands from external script files with shebang-based interpreter dispatch, template interpolation, path resolution, and local override support
  • Conversation Mode - Multi-turn conversations with native session resume for CLI providers (claude, codex, gemini, opencode, github_copilot), automatic context window management for HTTP providers, mid-conversation context injection via inject_context field, and token tracking across all turns
  • MCP Proxy - Intercept and audit AI agent tool calls via Model Context Protocol (MCP); re-expose the 6 built-in tools (Read, Write, Edit, Bash, Glob, Grep) with full observability (OTel spans, structured logs); expose custom gRPC plugin operations as MCP tools; optional full interception or additive mode per step
  • OpenAI-Compatible Provider - Use any Chat Completions API (OpenAI, Ollama, vLLM, Groq) with native HTTP integration, accurate token reporting, and no CLI tool required
  • Parallel Execution - Run multiple steps concurrently with configurable strategies
  • Loop Constructs - For-each and while loops with full context access and handled failure transitions between steps in the same loop body
  • Sub-Workflows - Invoke workflows from other workflows with input/output mapping
  • Explicit Execution Timeouts - Omitted workflow, agent, plugin, and HTTP-operation timeouts do not impose hidden execution limits; set a positive timeout when a local deadline is required, or use 0 to disable an inherited step limit. See Timeouts.
  • Retry with Backoff - Automatic retry with exponential, linear, or constant backoff
  • Workflow Templates - Reusable step patterns with parameters
  • Input Validation - Type checking, patterns, enums, file validation
  • Dry-Run Mode - Preview execution plan without running commands
  • Interactive Mode - Step-by-step execution with prompts
  • Interactive Input Collection - Automatically prompt for missing required inputs in terminal sessions
  • Structured Error Codes - Hierarchical error taxonomy (USER.INPUT.MISSING_FILE) with awf error lookup command
  • Actionable Error Hints - Context-aware suggestions (“Did you mean?”) with fuzzy matching, suppressible via --no-hints
  • Audit Trail - Structured JSONL audit log with paired start/completion records for execution attempts, normalized non-zero codes for failures and cancellations, pre-execution validation and provider-readiness checks, consistent history/audit outcomes, secret masking, configurable path, bounded records, and serialized concurrent writes. See Audit Trail.
  • Canonical Agent Exchange Transcript - Append-only JSONL transcript per run (storage/transcripts/<run-id>.jsonl) capturing the full workflow lifecycle and agent exchange in one normalized stream; closed EventType vocabulary (run/step lifecycle, user/assistant messages, tool call/result) and typed ContentBlock (text, thinking, tool_use, tool_result, command, stream) with fidelity marker (router vs agent_emitted); per-provider normalization for Claude, Codex (with NUL byte tolerance), Gemini, Copilot, and OpenAI HTTP; tool capture at the tools.Router.CallTool seam covers builtin and plugin tools; sub-workflow linkage via child_run_id/parent_run_id with one file per run; bounded live fan-out with drop-newest policy keeps slow subscribers from stalling disk writes; atomic O_APPEND writes with 0o600 permissions and monotonic Seq ordering; coexists with audit.jsonl and DisplayEvent channels unchanged. See Agent Exchange Transcript.
  • Distributed Tracing - OpenTelemetry integration for visibility into workflow execution with spans for steps, agents, parallel/loop blocks, and shell commands; export to any OTLP-compatible backend (Jaeger, Grafana Tempo, Honeycomb) via --otel-exporter and --otel-service-name flags
  • Plugin System - Extend AWF with custom operations, validators, and step types via gRPC plugins (HashiCorp go-plugin); scaffold operation plugins with awf plugin init; automatic mutual TLS (AutoMTLS) encryption for all host-plugin communication with zero configuration; SHA-256 binary integrity verification at launch time blocks tampered or corrupted plugins; plugin subprocess log and stdout/stderr forwarding to AWF’s structured logger for crash diagnostics; validators run custom rules during awf validate, custom step types register new type: values for workflow steps; event system enables plugins to subscribe to core lifecycle events (workflow.*, step.*) and emit custom inter-plugin events with glob pattern matching, per-plugin buffered channels, and cycle detection; GRPCBroker enables plugins to emit events back to the host at runtime via a dedicated reverse channel with manifest-based permission enforcement; persistent gRPC streaming delivers events to plugins over long-lived connections with automatic fallback to unary RPCs for plugins that don’t support streaming; includes sdk.Serve() entry point for plugin authors, and install/update/remove from GitHub Releases with checksum verification
  • Workflow Packs - Share reusable workflows and prompts via awf workflow install owner/repo[@version] from GitHub Releases with manifest validation, checksum verification, and atomic installation; execute with awf run pack/workflow namespace syntax; {{.awf.prompts_dir}} and {{.awf.scripts_dir}} resolve context-aware with 3-tier resolution (user override → pack embedded → global); call_workflow within packs resolves relative to pack root; --global flag for user-level installation; awf workflow remove <pack> for cleanup; source metadata tracking and plugin dependency warnings
  • Built-in GitHub Plugin - Declarative GitHub operations (get_issue, create_pr, batch) with auth fallback and concurrent execution
  • Built-in HTTP Operation - Declarative REST API calls (GET, POST, PUT, DELETE) with optional explicit timeout, response capture, and retryable status codes
  • Built-in Notification Plugin - Workflow completion alerts via desktop and webhooks with configurable backends
  • Terminal User Interface (TUI) - Full-screen interactive dashboard (awf tui) with tab-based navigation for workflow browsing, real-time execution monitoring, history exploration, agent conversation rendering, and Claude Code session tailing; built on Bubble Tea with Lip Gloss styling and Glamour Markdown rendering
  • HTTP REST API Server - awf serve exposes workflow discovery, async execution, SSE event streaming, lifecycle control, and execution history over HTTP with auto-generated OpenAPI 3.1 spec and Swagger UI at /docs; built on Huma v2 + chi v5; defaults to 127.0.0.1:2511 (loopback-only) with --host/--port overrides
  • ACP Transparent Agent Server - awf acp-serve (hidden) exposes workflows as an ACP (Agent Client Protocol) agent over stdio, enabling ACP-compatible editors (Zed, acp.nvim) to spawn AWF as a transparent agent subprocess; full workflow execution per session/prompt (not single-provider passthrough) with multi-step progress projected as tool_call / tool_call_update notifications; workflow discovery via slash commands (available_commands_update); native session/request_permission for approval gates; mid-workflow user input via turn-boundary resume; session/cancel with 5s SIGTERM→SIGKILL grace; editor-provided mcpServers merged with per-step MCP proxy config (editor wins on collision); powered by the official github.com/coder/acp-go-sdk with infrastructure adapter pattern. See ADR-018 and ADR-020.

Installation

curl -fsSL https://raw.githubusercontent.com/awf-project/cli/main/scripts/install.sh | sh

Or via Go:

go install github.com/awf-project/cli/cmd/awf@latest

Or build from source:

git clone https://github.com/awf-project/cli.git
cd cli && make build && make install

See Installation Guide for details.

Quick Start

# Initialize AWF
awf init

# Run example workflow
awf run example

# Create your own workflow
cat > .awf/workflows/hello.yaml << 'EOF'
name: hello
version: "1.0.0"

inputs:
  - name: name
    type: string
    default: World

states:
  initial: greet
  greet:
    type: step
    command: echo "Hello, {{.inputs.name}}!"
    on_success: done
  done:
    type: terminal
    status: success
EOF

# Run with input
awf run hello --input name=World

See Quick Start Guide for more.

⚠️ Security & Risk Disclaimer

AWF is a powerful orchestration tool that grants AI agents and workflows direct access to your system’s shell. While this enables complex automation, it carries significant risks:

  1. Arbitrary Code Execution: Workflows behave like shell scripts. Never run a workflow definition (YAML) from an untrusted source without auditing it first.
  2. AI Non-Determinism: AI agents (LLMs) can produce incorrect, unexpected, or destructive output (“hallucinations”). A prompt that seems safe might generate a harmful command in a specific context.
  3. No Sandboxing: By default, AWF executes commands with the same privileges as the user running the CLI.

Best Practices for Safe Execution:

  • Audit Workflows: Always review the YAML and prompt files before execution.
  • Use Dry-Run: Preview the execution plan using awf run --dry-run.
  • Interactive Mode: Use awf run --interactive to approve commands step-by-step.
  • Isolate Execution: Run risky workflows or those from external sources within a sandboxed environment (e.g., Docker, VM).

Commands

CommandDescription
awf initInitialize AWF in current directory
awf run <workflow>Execute a workflow
awf validate <workflow>Validate workflow syntax
awf diagram <workflow>Generate workflow diagram (DOT format)
awf error [code]Lookup error codes with descriptions and resolutions
awf listList available workflows
awf list promptsList available prompt files
awf resume <id>Resume interrupted workflow with --from to jump to previous step, current (default), or specific step name
awf historyShow execution history
awf status <id>Check workflow status
awf config showDisplay project configuration
awf plugin disable <name>Disable a plugin
awf plugin enable <name>Enable a plugin
awf plugin init <name>Scaffold a new external plugin repository
awf plugin install <owner/repo[@version]>Install a plugin from GitHub Releases
awf plugin listList installed plugins
awf plugin remove <name>Remove an installed plugin
awf plugin search [query]Search for plugins on GitHub
awf plugin update [name]Update an installed plugin
awf plugin verify [name]Verify plugin binary integrity (check/update SHA-256 checksums)
awf workflow listList installed workflow packs
awf workflow info <name>Display detailed pack information
awf workflow install <owner/repo[@version]>Install a workflow pack from GitHub Releases
awf workflow update [name]Update an installed workflow pack
awf workflow remove <pack>Remove an installed workflow pack
awf workflow search [query]Search for workflow packs on GitHub
awf serveStart HTTP API server for remote workflow execution and monitoring
awf tuiLaunch the interactive terminal UI
awf upgrade [version]Upgrade AWF to the latest version or an exact SemVer release
awf --versionShow binary version information
awf completion <shell>Generate shell autocompletion

See Command Reference for all options.

BREAKING: Use --verbose instead of -v. Version selection now follows standard CLI conventions: awf --version, awf upgrade [version], awf plugin install owner/repo[@version], and awf workflow install owner/repo[@version].

Example Workflow

name: code-review
version: "1.0.0"

inputs:
  - name: file
    type: string
    required: true
    validation:
      file_exists: true

states:
  initial: read

  read:
    type: step
    command: cat "{{.inputs.file}}"
    on_success: analyze
    on_failure: {message: "File not found: {{.inputs.file}}", status: 1}

  analyze:
    type: agent
    provider: claude
    prompt: |
      Review this code for bugs, security issues, and improvements:
      {{.states.read.Output}}
    output_format: json
    options:
      model: claude-sonnet-4-20250514
    timeout: 120
    on_success: report
    on_failure: {message: "Analysis failed: {{.states.analyze.Output}}"}

  report:
    type: step
    command: echo "Severity: {{.states.analyze.JSON.severity}} — {{.states.analyze.JSON.summary}}"
    on_success: done

  done:
    type: terminal
    status: success
awf run code-review --input file=main.go

See Examples for more workflows.

Documentation

📖 Browse the documentation site — searchable, with dark mode.

Or read locally:

SectionDescription
Getting StartedInstallation and first steps
User GuideCommands, workflow syntax, templates
ReferenceExit codes, error codes, interpolation, validation
DevelopmentArchitecture, contributing, testing

Architecture

AWF follows hexagonal (clean) architecture:

Interfaces (CLI) → Application (Services) → Domain (Entities, Ports)
                                                    ↑
                        Infrastructure (YAML, JSON, Shell) ─┘

See Architecture for details.

Development

make build          # Build binary
make test           # Run all tests
make lint           # Run linter
make lint-arch      # Check architecture constraints
make test-coverage  # Generate coverage report
make quality        # Run all quality checks
make proto-gen      # Regenerate protobuf Go code
make docs           # Build documentation site
make docs-serve     # Serve documentation site locally
make docs-clean     # Clean documentation build artifacts

See Testing Guide for conventions.

Contributing

Contributions welcome! Please read CONTRIBUTING.md first.

  1. Fork the repository
  2. Create a feature branch
  3. Write tests for your changes
  4. Submit a Pull Request

Support the Project

AWF is maintained by Alexandre Balmes and relies on community support to ensure continued development, maintenance, and reliability.

Why Sponsor?

Your support helps:

  • Maintenance: Bug fixes, security updates, dependency upgrades
  • Improvements: New features, performance optimizations
  • Quality: Documentation, testing, code reviews
  • Reliability: CI/CD, release management, long-term support

How to Support

Direct sponsorship:

Commercial engagement:

Hiring services from the author’s companies directly funds AWF development:

All commercial clients receive a free commercial license for AWF.

License

Open Source License

This project is licensed under the EUPL-1.2 (European Union Public License).

  • Individuals: Free to use, modify, and distribute
  • Companies: Free to use under EUPL-1.2 terms (copyleft - modifications must be shared)
  • GPL Compatibility: EUPL-1.2 is compatible with GPL

Commercial License

Companies seeking exemption from copyleft obligations can obtain a commercial license.

Free commercial license for:

Contact: awf@alexandre.vanoix.com

View original on GitHub