Skip to main content
kane-cli generate turns a plain-language description of what you want to test into structured test scenarios and test cases. You do not write them by hand, and no browser is launched. This page covers AI test-case generation from the command line and from the interactive Kane CLI TUI. A generation produces:
  • Test Scenarios: groups of related checks, such as “Login” or “Checkout”.
  • Test Cases: the individual checks inside each scenario, each typed Positive, Negative, or Edge.
You generate a set, review it, and refine it in plain language as often as you like. You can then save the functional cases as runnable _test.md files, which kane-cli testmd can run and replay.
The CLI takes a text description, optionally with local files attached through --files, and writes local _test.md files. For the full picture of AI test-case generation, including issue-link inputs, dashboards, and pushing cases into Test Manager or automation, see the AI test-case generation guide. See also Limits and scope.

Quick start

Each generation ends by printing a request id (23271 above). Pass it to later commands to continue the same request.

The three modes

From a script or a headless shell, generate runs one turn per command, then exits. To continue a request, run the command again with --req <id>. When you run it interactively, Kane CLI opens a live TUI session instead. See Interactive mode (TUI). --refine and --save both require --req. --refine needs a description of the change. --save takes no description.

Options

Attaching files for context

Give the generator more context by attaching local files with --files, a comma-separated list of paths. You can attach files to a new generation or a refine:
The files are sent with your description, and the generated scenarios and cases take them into account. For example, attach a spec, a screenshot of the UI, a PDF or Word document, or a CSV of inputs.
  • Supported types: documents (.txt, .md, .json, .xml, .csv, .pdf, .docx, .xlsx), images (.jpg, .jpeg, .png, .gif, .bmp, .webp), audio (.mp3, .wav, .m4a), and video (.mp4, .mov, .webm, .mpeg, .mpga).
  • Limits: up to 10 files, each 50 MB or smaller.
  • Checked before anything is sent: Kane CLI validates all paths together. If any file is missing, has an unsupported type, is too large, or exceeds the count, the command stops and lists the problem paths, so nothing is uploaded by mistake. Files outside the current directory are allowed, with a warning.
  • Not with --save: files attach to a generation or a refine, not to a save. Kane CLI rejects --files combined with --save.
In the interactive TUI, type @ in the generate prompt to attach a file inline instead of passing --files.

Interactive mode (TUI)

The commands above are for scripts. The Kane CLI TUI opens in Run mode, for running tests, by default. Switch to Generate mode with /generate, and back with /run. To go straight there, run kane-cli generate "<objective>" in a terminal without --agent. The TUI opens in Generate mode and submits your objective. Unlike the one-turn command line, the TUI is a live session. Generated scenarios stay pinned in a Scenarios box, where you refine and browse them in place: In the scenario browser, use ↑↓ to move, ↵ to open, ◂ ▸ for the previous or next sibling, x to remove a case, and ← or esc to go back. Non-functional cases (Security, Performance, and so on) show a gray ✓ with a “won’t be saved” note, because /save writes only functional cases. See Saving is functional-only. If generation asks a clarifying question, type your answer to continue. After /save, the files are ordinary _test.md tests under .testmuai/tests/. Run them with kane-cli testmd run.

How a result is shaped

Each generated case carries:
  • a title and steps,
  • a type: Positive (expected to pass), Negative (tests failure handling), or Edge (corner cases),
  • a category, such as Functional, Security, or Performance,
  • a priority.
Scenarios are sorted by importance. The full result is returned at the end of the turn, so you can review it before you refine or save.

Saving is functional-only

--save writes only test cases whose category is Functional, because only those translate into runnable _test.md tests. Non-functional cases (Security, Performance, and so on) are generated and shown, but they are not written to disk. If a request has no functional cases, --save writes nothing and tells you so. Saved files are ordinary _test.md tests in the standard format, the same as a hand-written test. Everything in the testmd docs applies to them: you can run them, edit them, replay them from cache, and commit them to git. The intended workflow is: generate writes the test cases, then testmd runs them.

Limits and scope

  • Input is a text description, optionally with attached files. Attach local files with --files, such as a spec, screenshot, PDF, or CSV, to give the generator more context. The CLI does not support issue-link inputs or the web product’s “Create / Create and Automate”.
  • Refinement applies to the whole request. You refine the request as a whole in plain language. The CLI does not support targeting an individual scenario or case.
  • Scenario and per-scenario counts are capped by --scenario-limit and --per-scenario-limit.

Next steps