The SMF Works Project — Where AI Meets Humanity

smf-forge CLI

Lightweight multi-agent orchestration — define, compose, and run AI agent pipelines from the terminal.

Installation

# From PyPI (when published)
pip install smf-forge
# From source
git clone https://github.com/smfworks/smf-multi-agent-orchestration-CLI.git
cd smf-multi-agent-orchestration-CLI
pip install -e ".[dev]"

Quickstart

# 1. Initialize a project
smf-forge init --name my-project
# 2. Edit forge.yaml to define agents and pipelines
vim forge.yaml
# 3. Validate your config
smf-forge validate
# 4. Run a pipeline
smf-forge run my-pipeline --prompt "Hello agents"

CLI Reference

smf-forge init

Initialize a new project with a forge.yaml template.

smf-forge init --name my-project [--directory .]

smf-forge run

Execute a named pipeline.

smf-forge run PIPELINE [options]
--prompt TEXT Input prompt for the pipeline
--config PATH Path to forge.yaml
--fail-fast/--continue-on-error Stop on first failure (default: fail-fast)
-v, --verbose Show step outputs

smf-forge agents

List configured agents and their types.

smf-forge agents [--config PATH]

smf-forge pipelines

List configured pipelines and their step dependencies.

smf-forge pipelines [--config PATH]

smf-forge validate

Validate forge.yaml without running anything. Checks agent types, pipeline DAGs, dependency cycles, and duplicate step names.

smf-forge validate [--config PATH]

Built-in Agent Types

TypeDescriptionKey Config
echoReturns the input prompt. Useful for testing pipelines.
httpCalls an OpenAI-compatible chat completions endpoint.model, base_url, api_key
shellRuns a shell command and returns stdout/stderr.options.command
transformApplies a Jinja2 template to context data.options.template

Configuration Reference

forge.yaml Structure

project: my-project
version: "0.1.0"

agents:
  researcher:
    type: http
    model: gpt-4
    base_url: ${OPENAI_BASE_URL:https://api.openai.com/v1}
    api_key: ${OPENAI_API_KEY}
    system_prompt: "You are a research assistant."
    temperature: 0.3
    max_tokens: 4096

  summarizer:
    type: http
    model: gpt-4
    base_url: ${OPENAI_BASE_URL:https://api.openai.com/v1}
    api_key: ${OPENAI_API_KEY}
    system_prompt: "Summarize the following text concisely."

pipelines:
  research-summarize:
    name: research-summarize
    steps:
      - name: research
        agent: researcher
        prompt: "{{ prompt }}"

      - name: summarize
        agent: summarizer
        prompt: "Summarize this research:\n{{ research.response }}"
        depends_on:
          - research

Environment Variables

Use ${VAR} to resolve from environment (raises error if not set), or ${VAR:default} to provide a fallback value.

api_key: ${OPENAI_API_KEY}               # Required — raises if not set
base_url: ${OPENAI_BASE_URL:https://api.openai.com/v1}  # Optional — defaults

Pipeline Execution Model

Pipelines execute as DAGs. Steps with no dependencies run in parallel. Step outputs are available as template variables in downstream steps via Jinja2 rendering.

# Parallel execution:
#   research ──┐
#              ├──→ summarize
#   validate ──┘

steps:
  - name: research
    agent: researcher
    prompt: "{{ prompt }}"
  - name: validate
    agent: echo
    prompt: "{{ prompt }}"
  - name: summarize
    agent: summarizer
    prompt: "Research: {{ research.response }}\nValidation: {{ validate.echo }}"
    depends_on:
      - research
      - validate

Error Handling

Fail-fast (default): When a step fails, all remaining steps are marked SKIPPED and the pipeline exits with code 1.

Continue-on-error: All steps attempt to run regardless of prior failures. Use --continue-on-error flag.

Next Steps