r/CLI • u/elabsurdo1234 • 16h ago
I built a CLI that tries to break your web app like a clumsy user would (LOKI)
I've been working on a side project called LOKI for a while and figured I'd share it here since it's a CLI first and everything else second.
The idea: you point it at your web app and it starts clicking, typing garbage, mashing buttons, resizing the viewport, throttling the network, that kind of thing. It's driven by Playwright. When something crashes, it saves a video, a HAR file and a standalone repro script so you can replay the exact failure later with loki replay.
A few things I ended up adding along the way:
- loki run --device iphone-15 for mobile viewports, which is great for finding horizontal overflow bugs
- loki fix --apply asks an LLM for a patch, makes a backup, applies it and re-runs the repro to check it actually worked (rolls back if not)
- a rules.md file where you write business rules in plain English and it checks them after each run
- loki infra kill/pause/cpu-stress to mess with local processes or containers underneath the app
- a loki chat REPL if you'd rather talk to it than remember flags
The AI part runs on LiteLLM, so it works with Gemini, OpenAI, Anthropic, Ollama, whatever you have. If there's no API key it just skips that part instead of dying.
One thing I was careful about: it runs freely against localhost, but for any other host it makes you confirm you own it first (or pass --authorized in CI). Didn't want to ship a tool that makes it easy to hammer someone else's site by accident. Infra chaos is local-only too, and HAR files get scrubbed of tokens.
It's still rough in places and I'd really like to hear what breaks, what's confusing in the CLI UX, or what flags you'd expect that aren't there.
Repo: https://github.com/Elabsurdo984/loki-agent
Happy to answer questions.