Skip to content

CLI Examples

The fastest way to get things done. Describe your task and SWEny builds a complete workflow:

Terminal window
sweny workflow create "generate SEO blog posts for each topic in our \
content calendar, run each through an LLM quality judge that checks \
readability, accuracy, and keyword density, loop back for rewrites \
if quality fails, then publish passing content"
Terminal window
sweny workflow create "scan recent commits for exposed secrets, review \
open PRs for security-sensitive changes, check dependency files for \
known vulnerabilities, compile a security posture report, and create \
Linear tickets for any critical findings"
Terminal window
sweny workflow create "research the top 5 competitors in our space, \
gather pricing models, key features, and target audience for each, \
synthesize a competitive analysis comparing them across dimensions, \
and produce an executive brief with strategic recommendations"
Terminal window
sweny workflow create "research recent product launches for lessons \
learned, draft launch copy with a tagline, 3 value props, and a tweet, \
create a launch checklist as Linear issues, and compile a launch brief"
Terminal window
# Add a quality gate with loop-back logic
sweny workflow edit .sweny/workflows/launch_planner.yml \
"add a quality gate after drafting copy that rejects taglines over \
10 words or vague value props — loop back to redraft if rejected"
# Add notification steps
sweny workflow edit .sweny/workflows/security_audit.yml \
"add a Slack notification after creating tickets"
Terminal window
# Run a workflow
sweny workflow run .sweny/workflows/my-workflow.yml
# Dry run (validate structure, don't execute)
sweny workflow run .sweny/workflows/my-workflow.yml --dry-run
# Validate without running
sweny workflow validate .sweny/workflows/my-workflow.yml
# Export a built-in workflow for customization
sweny workflow export triage > my-triage.yml
# List available skills
sweny workflow list

The fastest way to try the built-in triage workflow. Point it at a local log file and run entirely offline:

.sweny.yml
observability-provider: file
log-file: ./sample-errors.json
issue-tracker-provider: file
source-control-provider: file
notification-provider: file
output-dir: .sweny/output
.env
ANTHROPIC_API_KEY=sk-ant-...
Terminal window
sweny triage --dry-run

Output goes to .sweny/output/:

  • issues/LOCAL-1.md — issue tickets
  • prs/pr-1.md — PR descriptions
  • notifications/summary-*.md — run summaries

The most common production setup:

.sweny.yml
observability-provider: datadog
issue-tracker-provider: github-issues
source-control-provider: github
time-range: 4h
severity-focus: errors
.env
ANTHROPIC_API_KEY=sk-ant-...
DD_API_KEY=your-api-key
DD_APP_KEY=your-app-key
GITHUB_TOKEN=ghp_...
Terminal window
sweny triage
.sweny.yml
observability-provider: sentry
sentry-org: my-org
sentry-project: my-project
issue-tracker-provider: linear
linear-team-id: your-team-uuid
.env
ANTHROPIC_API_KEY=sk-ant-...
SENTRY_AUTH_TOKEN=sntrys_...
LINEAR_API_KEY=lin_api_...
GITHUB_TOKEN=ghp_...
Terminal window
sweny triage
.sweny.yml
observability-provider: datadog
source-control-provider: gitlab
issue-tracker-provider: jira
gitlab-base-url: https://gitlab.mycompany.com
.env
ANTHROPIC_API_KEY=sk-ant-...
DD_API_KEY=your-api-key
DD_APP_KEY=your-app-key
GITLAB_TOKEN=glpat-...
GITLAB_PROJECT_ID=my-group/my-project
JIRA_BASE_URL=https://mycompany.atlassian.net
JIRA_EMAIL=bot@mycompany.com
JIRA_API_TOKEN=your-token
Terminal window
sweny triage

Analyze errors without creating issues or PRs. Useful for validating your setup or reviewing what the agent would do:

Terminal window
sweny triage --dry-run

Only investigate errors from billing services in the last 4 hours:

Terminal window
sweny triage \
--service-filter 'billing-*' \
--time-range 4h \
--severity-focus errors

Give the agent more room to explore complex issues:

Terminal window
sweny triage \
--investigation-depth thorough \
--max-investigate-turns 100 \
--max-implement-turns 50 \
--time-range 7d

Point the triage workflow at an existing issue instead of scanning for new ones:

Terminal window
sweny triage \
--issue-override 'ENG-123' \
--additional-instructions 'Focus on the webhook handler timeout'

Run the implement workflow directly on a known issue — skips log scanning entirely:

Terminal window
sweny implement ENG-123

Pass additional guidance to the coding agent:

Terminal window
sweny implement ENG-123 \
--additional-instructions 'Add a null check before accessing event.payload.metadata'

Use a different base branch:

Terminal window
sweny implement ENG-456 --base-branch develop

Pipe structured output to other tools:

Terminal window
# Full JSON result
sweny triage --dry-run --json | jq .
# Extract specific fields
sweny triage --json | jq 'to_entries[] | select(.value.status == "success") | .key'

Execute a workflow defined in a YAML file:

Terminal window
sweny workflow run my-workflow.yml

Validate first without running:

Terminal window
sweny workflow run my-workflow.yml --dry-run

Describe what you want in plain English and let the LLM build the workflow:

Terminal window
sweny workflow create "check for slow database queries and file tickets"

The CLI generates the workflow, renders a DAG preview, and asks if you want to save, refine, or discard. Save it and run it:

Terminal window
sweny workflow run .sweny/workflows/check-slow-queries.yml

For non-interactive use (CI, scripts), pass --json:

Terminal window
sweny workflow create "monitor API latency and alert on regressions" --json > workflow.json

Modify an existing workflow without hand-editing YAML:

Terminal window
sweny workflow edit my-workflow.yml "add a Slack notification after creating tickets"

Or start an interactive session:

Terminal window
sweny workflow edit my-workflow.yml

Export a built-in workflow for customization

Section titled “Export a built-in workflow for customization”

Use a built-in workflow as a starting point:

Terminal window
sweny workflow export triage > my-triage.yml

Edit the exported file, then run it:

Terminal window
sweny workflow run my-triage.yml

Both triage and implement are available:

Terminal window
sweny workflow export implement > my-implement.yml

See what skills are available for workflow nodes:

Terminal window
sweny workflow list

Machine-readable output:

Terminal window
sweny workflow list --json | jq '.[].id'

Send triage results to a Slack channel:

.sweny.yml
notification-provider: slack
.env
NOTIFICATION_WEBHOOK_URL=https://hooks.slack.com/services/...
Terminal window
sweny triage

For one-off runs, pass credentials inline without editing .env:

Terminal window
SENTRY_AUTH_TOKEN=sntrys_... sweny triage \
--observability-provider sentry \
--sentry-org my-org \
--sentry-project my-project \
--time-range 6h \
--dry-run

Add a validation step to your CI pipeline:

Terminal window
sweny workflow validate .sweny/workflows/*.yml

With JSON output for programmatic checks:

Terminal window
sweny workflow validate my-workflow.yml --json
# {"valid": true, "errors": []}

Use --stream to emit NDJSON ExecutionEvent objects to stdout. This is how Studio connects to a running workflow:

Terminal window
sweny triage --stream 2>/dev/null | ws-broadcast

--stream works alongside the normal progress display — events go to stdout, the spinner goes to stderr:

Terminal window
sweny workflow run my-workflow.yml --stream > events.jsonl

You can also combine --stream with --json to get both the event stream during execution and the final results:

Terminal window
sweny implement ENG-123 --stream > events.jsonl

Ring the terminal bell when a long-running workflow finishes:

Terminal window
sweny triage --bell

Generate AI-driven end-to-end tests for any web app. No Playwright scripts — the AI agent drives a real browser.

Terminal window
sweny e2e init

The wizard asks which flows to test (registration, login, purchase, onboarding, upgrade, cancellation, custom), per-flow details, and whether to auto-cleanup test data. It generates workflow YAML files in .sweny/e2e/.

Terminal window
sweny e2e run

Executes every .yml in .sweny/e2e/ sequentially. Auto-generates test credentials (e2e-{timestamp}@yourapp.test), resolves template variables, and reports pass/fail per workflow.

Terminal window
sweny e2e run registration.yml
Terminal window
sweny e2e run --timeout 600000 # 10 minutes per workflow
.env
E2E_BASE_URL=https://staging.myapp.com
E2E_EMAIL=test@example.com
E2E_PASSWORD=secret
Terminal window
sweny e2e run

Full E2E guide — wizard details, template variables, cleanup backends, and generated workflow structure.