--for-agent
The --for-agent flag is a global flag available on every reposwarm command. It switches output to plain text optimized for AI agents and scripts.
What It Does
- Strips emoji, color codes, and box-drawing characters
- Replaces spinners and progress bars with plain status lines
- Prefixes errors with
ERROR:and warnings withWARN: - Skips interactive confirmation prompts
- Preserves all information — nothing is hidden, only reformatted
Usage
reposwarm <command> --for-agent
Position doesn't matter:
reposwarm --for-agent repos list reposwarm repos list --for-agent reposwarm repos --for-agent list
Output Comparison
reposwarm status
# default
✗ no API token configured: run 'reposwarm config init' or pass --api-token
# --for-agent
ERROR: no API token configured: run 'reposwarm config init' or pass --api-token
reposwarm doctor
# default
✓ API server reachable
✗ Temporal: connection refused
# --for-agent
PASS: API server reachable
FAIL: Temporal: connection refused
Combining with --json
--json outputs structured JSON. --for-agent ensures no decorative text leaks into stderr or progress output. They can be used together:
reposwarm repos list --for-agent --json
Output Modes Summary
| Flag | Output |
|---|---|
| (none) | Human-friendly: colors, emoji, tables, progress bars |
--for-agent |
Plain text: no decoration, consistent prefixes, no prompts |
--json |
Structured JSON |
--for-agent --json |
Structured JSON with clean stderr |