Skip to main content

CLI Quickstart Tutorial

This tutorial builds a working multi-agent workflow from scratch using only the CLI — no Python required until the final optional step. By the end you’ll have a reusable agent library, a YAML pipeline, and a one-command way to run it. You’ll build: a research → write → review pipeline that takes a topic and produces a polished briefing. Time: 15–20 minutes. Prerequisites: Python 3.10+, one provider API key (OpenAI or Anthropic).

Step 1 — Install and Initialize

The wizard prompts for a project directory, a workspace path, and your API keys. When it finishes, you’ll have:
Verify the install:
If every check passes, the CLI will print a “next step” tip suggesting a real first command. Follow it — or stay with this tutorial.

Step 2 — Pick a Model

Before configuring agents, decide which model you’ll use. Browse the catalog:
Pick one that fits your budget. Inspect details:
You’ll see context window, supported features, and per-million-token pricing. For this tutorial we’ll use:
  • claude-opus-4-7 for the writer (quality matters most)
  • gpt-4o for the researcher (good cost/quality tradeoff)
  • gpt-4o for the reviewer
If you only have one provider key, use that provider’s strongest model for all three. The pipeline still works.

Step 3 — Define the Agent Library (Markdown)

The most ergonomic way to define a reusable agent is a markdown file with YAML frontmatter. Create three files inside an agents/ folder: agents/researcher.md
agents/writer.md
agents/reviewer.md
Confirm they load:
You should see a table listing all three agents with their models and descriptions.

Step 4 — Run a Single Agent

Before chaining, sanity-check one agent in isolation:
--streaming-on shows tokens arriving in real time so you can tell whether the agent is on track without waiting for the full response.

Step 5 — Chain Them: YAML Pipeline

Create pipeline.yaml:
Run it:
Each agent receives the previous one’s output as context. The Researcher’s notes flow into the Writer’s brief, which flows into the Reviewer’s critique. Total cost on gpt-4o + claude-opus-4-7 will be a few cents.

Step 6 — Try a Different Architecture

The same agents can run as a Concurrent Workflow (all three see the same task in parallel) or as a Mixture of Agents (workers + aggregator). Try Concurrent for a different angle:
Run:
You get three independent perspectives in parallel rather than a chained refinement.

Step 7 — Auto-Generate a Swarm

When you don’t know which architecture fits, let the CLI design one:
--no-run writes the generated Python file without executing it, so you can inspect it first. Open generated_swarm.py — it’s plain swarms Python code you can edit, version-control, or rerun manually. To run it immediately, drop --no-run:

Step 8 — Deep Analysis with Heavy Swarm

For research-grade depth, heavy-swarm decomposes the task into specialist questions and runs each through a worker for multiple loops:
This costs more (3 loops × N workers × 1 question-generator) but produces noticeably deeper output than a single LLM call. Use sparingly.

Step 9 — Council Debate

When the task has multiple valid answers and you want disagreement surfaced:
Each council member responds independently; the chairman synthesizes, highlighting agreements and conflicts.

Step 10 — Save and Resume an Agent

For long-running tasks (autonomous research, ongoing chat with memory), persist state to disk:
The next time you run the same command pointing at ./helios.json, the agent picks up exactly where it left off — including everything you told it.

Step 11 — Use a Tip on Every Run

Run swarms tips whenever you want a quick reminder of a flag you might have forgotten:
Or print every CLI power-user trick:

Step 12 — When Things Break

If a command errors out, the CLI classifies the failure and prints targeted hints. Try these intentionally to see the error system at work:
You’ll see a “Could not load info” message with the closest model name suggestions.
You’ll see Did you mean swarms agent?.

What You Built

You now have:
  • A reusable agent library in agents/*.md
  • A repeatable sequential pipeline in pipeline.yaml
  • A concurrent variant in pipeline-concurrent.yaml
  • A fluency with the four most useful swarm-level commands (run-agents, autoswarm, heavy-swarm, llm-council)
  • A way to persist and resume long-running agents
Commit agents/ and pipeline.yaml to git — they’re plain text. Anyone who clones your repo can run your workflow with the same one-liner.

Next Steps

CLI Tutorial

The long-form CLI tour, including power-user tricks

Commands Reference

Every command, every flag, with examples

Configuration

YAML and markdown configuration formats in depth

Multi-Agent Architectures

Learn the architectures behind each swarm command