Using Claude Code, Cursor, or another coding agent? Paste this into your prompt to run cross-browser and real-device tests, debug sessions, and wire up CI on the TestMu AI cloud:
kane-cli generate is built around a simple loop: generate → refine → save → run. Each command is one turn that exits when done; you move between turns with the request id. This page walks the loop end to end. For the feature overview and option reference, see Generating test cases with AI.
1. Generate
Start with a plain-language description of what you want covered:--memory to reuse relevant existing cases and avoid duplicating coverage you already have.
2. Refine
Refinement is a plain-language conversation. Each refine is a fresh command with--refine --req <id>:
When generation asks a question
Sometimes a turn ends by asking you something instead of finishing, for example, “Which environment should these target, staging or production?” This is a normal outcome, not a failure (the command exits0). Answer it by refining with your answer:
--agent (or rely on it being auto-on when stdin is not a TTY) and read the answer-needed signal from the NDJSON, then re-invoke the same way.)
3. Save
When you are happy with the set, save it.--save writes the functional cases as _test.md files:
<cwd>/.testmuai/tests:
--out, and name the suite with --name:
4. Run
The saved files are ordinary_test.md tests. Run any of them with testmd:
@import, and commit the output to git.
Automating it (agents / CI)
Pass--agent (auto-on when stdin is not a TTY) to get structured NDJSON on stdout instead of the human display, so a script or coding agent can drive the loop:
Exit codes
Invalid flag combinations exit
2 with a message explaining the fix, for example using --refine without --req, passing a description with --save, using --out without --save, or --req without --refine or --save.
Next steps
- Generating test cases with AI: overview, modes, and the full option reference.
- Running tests with testmd: run and replay the files
--saveproduces.