CLI Quick Start
The SWEny CLI is how you build, run, and iterate on AI workflows from your terminal. Describe what you want done in plain English, and SWEny generates a full DAG with the right tools wired up at each step.
Install
Section titled “Install”npm install -g @sweny-ai/coreThe binary is called sweny. You can also run it directly with npx:
npx @sweny-ai/core --helpBuild your first workflow
Section titled “Build your first workflow”1. Add your API key to .env:
# .env (gitignored)ANTHROPIC_API_KEY=sk-ant-...The CLI auto-loads .env at startup — no external dotenv tooling required.
2. Create a workflow from a description:
sweny workflow create "analyze our codebase for common security \ anti-patterns, compile a report, and create tickets for critical findings"SWEny generates a full workflow with nodes, conditional routing, and structured output schemas. It renders an ASCII DAG and prompts you to save, refine, or discard:
Save to .sweny/workflows/security_audit.yml? [Y/n/refine]Type a refinement instruction to iterate on the design, or press Y to save.
3. Run it:
sweny workflow run .sweny/workflows/security_audit.yml4. Refine it later:
sweny workflow edit .sweny/workflows/security_audit.yml \ "add a quality gate that rejects vague findings"That’s it. No YAML to write by hand, no boilerplate to configure.
Try the built-in triage workflow
Section titled “Try the built-in triage workflow”SWEny also ships production-ready workflows for SRE triage. No external services needed for a quick test — just an API key and a log file.
1. Create a config file:
sweny newThis runs the interactive picker and writes a starter .sweny.yml. Uncomment the local-only block:
observability-provider: filelog-file: ./sample-errors.jsonissue-tracker-provider: filesource-control-provider: filenotification-provider: file2. Run a dry-run triage:
sweny triage --dry-runSWEny reads .sweny.yml, loads secrets from .env, analyzes your logs, and writes results to .sweny/output/ without creating any real issues or PRs.
Live progress display
Section titled “Live progress display”When running on an interactive terminal, the CLI renders a live progress display that updates in place as each node executes:
⠹ [2/5] Investigate errors 1m 42s ↳ Calling sentry.list_issues ↳ Calling github.search_code ↳ Analyzing stack tracesThe progress block shows a spinner, step counter, node name, and elapsed time. Below it, the last few activity messages stream in as the agent works. When a node finishes, the block is replaced with a completion line:
✓ [1/5] Fetch errors 12s ↳ Found 3 unresolved issues ✓ [2/5] Investigate errors 2m 14s ↳ Root cause identified in webhook handler ⠹ [3/5] Create issues 4sNon-TTY environments (CI, pipes) get simple periodic status lines instead of animated output.
NDJSON streaming
Section titled “NDJSON streaming”Pass --stream to emit raw ExecutionEvent objects as newline-delimited JSON to stdout. This is how Studio’s Live Mode connects to a running workflow:
sweny triage --stream | studio-consumer--stream can be combined with the normal progress display — structured events go to stdout while the spinner renders to stderr.
Config priority
Section titled “Config priority”Settings resolve in this order (highest wins):
CLI flag > environment variable > .sweny.yml > defaultUse flags for one-off overrides without editing your config file:
sweny triage --dry-run --time-range 1h --service-filter 'billing-*'Config file reference
Section titled “Config file reference”.sweny.yml uses flat kebab-case keys that map 1:1 to CLI flags. You can copy any flag from --help directly into the YAML:
# .sweny.yml -- commit this file. Secrets go in .env.
# Providersobservability-provider: datadogissue-tracker-provider: github-issuessource-control-provider: githubcoding-agent-provider: claudenotification-provider: console
# Investigationtime-range: 24hseverity-focus: errorsservice-filter: "*"investigation-depth: standard
# PR / branchbase-branch: mainpr-labels: agent,triage,needs-review
# Pathsservice-map-path: .github/service-map.ymllog-file: ./logs/errors.json
# Cachecache-dir: .sweny/cachecache-ttl: 86400Secrets (API keys, tokens) are never read from the config file — always use environment variables or .env.
Connecting providers
Section titled “Connecting providers”Once local-only mode works, swap in real providers. Set the provider in .sweny.yml and add credentials to .env:
observability-provider: sentrysentry-org: my-orgsentry-project: my-projectissue-tracker-provider: linearlinear-team-id: your-team-uuidSENTRY_AUTH_TOKEN=sntrys_...LINEAR_API_KEY=lin_api_...GITHUB_TOKEN=ghp_...Verify credentials before running a full workflow:
sweny checkSee the Commands Reference for all supported providers and their options.
What’s next?
Section titled “What’s next?”- E2E Testing — generate and run AI-driven browser tests
- Commands Reference — every command, flag, and option
- Examples — common configurations and real-world workflows