CLI Commands
swarm
Run without arguments to launch the interactive menu.
swarm login
Authenticate with your Swarm account via browser.
The CLI initiates a device authorization flow — a code is displayed in your terminal and a browser window opens for confirmation.
swarm logout
Remove stored credentials.
swarm setup-tunnel
Retry or revoke your persistent localhost tunnel.
Persistent tunnels are normally provisioned automatically during
swarm login. Use this command when provisioning failed during login, when you need to rotate the tunnel token, or when a stale tunnel should be cleared.
Learn more in Persistent Tunnels.
swarm test
Run an AI-powered UX test against a URL.
Target & goal
Personas
Tunneling
Backend proxy
When
--backend is provided, Swarm starts a reverse proxy that routes API paths (/api/*, /auth/*, /graphql, /trpc/*) to your backend and everything else to your frontend — all through a single tunnel.
Authentication
Three modes:- Login — agents perform a username/password login against an existing account.
- Sign-up — no account exists yet; you supply one base email and each persona registers with a unique sub-aliased address (
local+<hash>@domain) so all confirmations land in your one inbox. - Cookies — inject session cookies and skip the login flow entirely.
--start-url to land the agent on a specific page after auth (or to pre-navigate to the sign-up form).
When you run swarm test interactively without any auth flags, the prompt offers all three. The CLI auto-suggests Sign-up when your goal text mentions “sign up”, “register”, “create account”, or “onboard”.
Login mode
Sign-up mode
How the alias works:
- You supply
you@yourdomain.com. - For each persona-run, the runtime generates
you+<base36(timestamp)+random>@yourdomain.com— a never-before-seen, never-replicates-in-the-future address. - The agent is told to type that exact alias verbatim into the sign-up form. The login pre-fill flow and the
perform_logintool are suppressed for sign-up runs (the agent fills the form itself). - The generated alias is persisted to the run record so you can correlate inbox emails back to a persona later.
Cookie injection mode
The cookies file must be a JSON array. Required fields per cookie:
name, value, domain. Optional: path, secure, httpOnly, sameSite (also accepts null). The easiest way to capture cookies is the Cookie-Editor browser extension — Export → JSON.
When the test runs against a tunneled localhost URL, cookie domains captured from a different host are automatically rewritten to match the test URL. Cookie names, values, and other attributes are preserved unchanged.
Shared
Advanced
Examples
Basic test:swarm list-swarms
List your saved persona swarms.
swarm test --swarm <id>.
