Skip to content

zpg6/swarmlord-examples

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Swarmlord Examples

Runnable examples for Swarmlord. Config-file agents you can deploy in minutes, plus TypeScript SDK primitives.

Setup

git clone https://github.com/zpg6/swarmlord-examples.git cd swarmlord-examples bun install

1. Get your API key

Sign up at swarmlord.ai and grab your API key from the dashboard.

Copy .env.example to .env and paste your key:

cp .env.example .env
SWARMLORD_API_KEY=slsk_your_key_here 

Bun loads .env automatically — no export needed.

2. Authenticate the CLI

swarmlord auth login

3. Deploy agents

The SDK examples reference deployed agents by name. Deploy the ones you need before running the corresponding examples:

# Required for the quickstart cd agents/data-analyst && swarmlord deploy && cd ../.. # Required for SDK primitives cd agents/coder && swarmlord deploy && cd ../.. # Required for the browser cookbook cd agents/browser-screenshots && swarmlord deploy && cd ../.. # Required for the repo cookbook cd agents/repo-reviewer && swarmlord deploy && cd ../.. # Required for the swarm cookbook cd agents/swarm-review && swarmlord deploy && cd ../..

4. Connect your services (optional)

If you want agents to interact with GitHub, Slack, or Linear:

Dashboard → Integrations → Connect

OAuth handles the rest — no webhook URLs, no tokens to manage.


Agents

Config-file agents — each is a self-contained project you can test and deploy with the CLI.

Agent What it does
data-analyst Analyze CSV data and produce styled charts and reports
coder General-purpose coding agent with full tool access
browser-screenshots Navigate pages and capture screenshots with headless Chromium
repo-reviewer Clone a repo, analyze recent commits, produce a structured review
swarm-review Review agent designed to run in parallel — one instance per repo

Test an agent

cd agents/browser-screenshots swarmlord run "Go to news.ycombinator.com and screenshot the front page to /workspace/hn.png"
cd agents/repo-reviewer swarmlord run "Clone https://github.com/pingdotgg/t3code and review it"

Deploy an agent

cd agents/repo-reviewer swarmlord deploy

Parallel swarm

Deploy swarm-review and trigger it once per repo. Each trigger creates a separate agent session that runs in parallel:

cd agents/swarm-review swarmlord deploy # Trigger via webhook for each repo (or use swarmlord run for testing) swarmlord run "Clone https://github.com/pingdotgg/t3code and review it" swarmlord run "Clone https://github.com/anthropics/anthropic-cookbook and review it" swarmlord run "Clone https://github.com/cloudflare/workers-sdk and review it"

SDK Primitives

TypeScript SDK examples for programmatic control. One file per capability.

All SDK examples reference deployed agents by name (e.g. client.agent("coder")). Make sure you've deployed the required agents first (see setup step 3).

Example What it shows
quickstart Zero to agent in 10 lines
sessions Persistent state, resume from ID, fork to explore alternatives
sandbox Direct shell + file access in an isolated Linux container
streaming Real-time SSE events — callbacks API and async iterator
attachments Upload files to agents, receive charts and reports back
artifacts Download everything the agent builds to your local machine
tasks Fire-and-forget background work, polling, webhooks
schedules List and inspect cron-triggered agent runs
bun src/quickstart.ts

SDK Cookbooks

Larger SDK examples that combine primitives into real workflows.

Example What it shows
browser Navigate pages, take screenshots, extract data
repo Clone a repo, analyze commits, generate a review
swarm Run parallel agents that each tackle a different repo
bun src/cookbooks/browser.ts

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors