You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docs(skill): document --files attachments for kane-cli generate (#83)
Adds the `--files` flag (attach local files as generation context) to the
generate skill, references, user guide, and the Kiro integration. Docs-only —
no behavior change. Builds on the generate docs from #67 / #79.
- references/generate.md + SKILL.md section 6: the `--files` flag, an
"Attaching files" section (supported types, 10-file / 50 MB caps, atomic
up-front validation, new/refine-only, the `@` TUI hint), and the
`--files` + `--save` invalid combo.
- references/generate-parsing.md: the `generate_upload` NDJSON event (one per
file, before `generate_start`; `uploading` -> `done`/`failed`).
- .claude/ and .agents/ skill mirrors kept byte-identical to the source.
- docs/user-guide/generate-test-cases/{overview,workflow}: `--files` option,
an "Attaching files for context" section, the `@` TUI row, a workflow
example, and corrected the now-stale "files not part of the CLI" notes.
- Kiro power: `--files` in the kane-cli-generate steering file and the
maintenance mapping.
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: .agents/skills/kane-cli/SKILL.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -287,6 +287,8 @@ Then offer the next commands from the terminal line's Refine / Save hints (they
287
287
288
288
**Clarification → refine (do not skip):** if the turn ends with a clarification, that's **exit 0 — not an error**. Act on it: answer it yourself, or ask your own user, then **re-invoke**`kane-cli generate "<answer>" --refine --req <id> --agent`. Never drop a clarification.
289
289
290
+
**Attach files:**`--files a,b,c` adds local files (docs / images / PDF / CSV — up to 10, ≤ 50 MB each) as generation context on a **new** or **`--refine`** turn (not `--save`); each emits a `generate_upload` line before `generate_start`. Details in `references/generate.md`.
291
+
290
292
**Save is Functional-only:**`--save` writes only **Functional** cases to `_test.md` (under `<cwd>/.testmuai/tests` by default). Non-functional cases (Security, Performance, …) are generated and shown but not saved. Run saved files with **`kane-cli testmd run`** (`references/testmd.md`) — that's the generate → testmd pipeline.
291
293
292
294
Internal event/field names (`generate_snapshot`, `request_id`, …) are for parsing only — never show them to the user (§5 rule). Wire schema: `references/generate-parsing.md`.
|`generate_upload`|`file`, `index`, `total`, `status`| Only when `--files` is used. Emitted once per attached file **before `generate_start`**, while the file uploads; `status` goes `"uploading"` → `"done"` (or `"failed"`). Progress only — narrate "attaching <file>…" or ignore. A failed upload surfaces as an `error` + non-zero exit. |
26
27
|`generate_start`|`request_id`, `objective_chars`, `scenario_limit`, `per_scenario_limit`, `is_refine`| Turn began. **Capture `request_id`** — it's the handle for every later `--refine` / `--save`. `is_refine` distinguishes a new request from a continuation. |
27
28
|`generate_thinking`|`took_ms`| Liveness only. Narrate "thinking…" or ignore. |
28
29
|`generate_progress`|`pct`| Milestone (25 / 50 / 75 / 100). Optional progress display — not a completion signal. |
Copy file name to clipboardExpand all lines: .agents/skills/kane-cli/references/generate.md
+18-1Lines changed: 18 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,7 @@
6
6
7
7
**Use this whenever a task needs test cases or scenarios written — don't hand-author them in chat or a scratch file.** Reach for it to: turn a requirement / feature description into a test suite; expand or refine coverage (more edge cases, negative paths, a narrower or broader focus); or save the Functional cases as runnable `_test.md`. It is **not** for driving a browser — that's `kane-cli run` (§3 of SKILL.md).
8
8
9
-
> For the full web-product picture (richer inputs, dashboards), see the public docs: <https://www.testmuai.com/support/docs/generate-test-cases-with-ai/>. The CLI surface here is **text-objective only**.
9
+
> For the full web-product picture (dashboards, issue-link inputs), see the public docs: <https://www.testmuai.com/support/docs/generate-test-cases-with-ai/>. The CLI takes a **textobjective**, optionally with local files attached via **`--files`** (see "Attaching files" below).
10
10
11
11
## The three modes — one turn per invocation, then exit
12
12
@@ -30,11 +30,27 @@ There is **no interactive session**. Each invocation runs exactly one generation
30
30
|`--name <name>`| Names the run and the saved suite folder |
31
31
|`--scenario-limit <n>` / `--per-scenario-limit <n>`| Cap scenarios / cases-per-scenario |
32
32
|`--memory`| Use the memory layer — reuse relevant existing cases, reduce duplicates |
33
+
|`--files <paths>`| Comma-separated local files to attach as context (new / refine only — see "Attaching files") |
If neither `--project`/`--folder` nor a saved project/folder is set when generation starts, kane-cli auto-resolves one headlessly and emits a `project_folder_auto_defaulted` event before `generate_start`. Translate it to a one-line note for the user — full handling lives in `references/test-manager.md`.
37
38
39
+
## Attaching files
40
+
41
+
Pass local files as extra context with `--files <comma-separated paths>` on a **new** generation or a **`--refine`** (not `--save`). The generator reads them and reflects them in the scenarios + cases — attach a spec, a screenshot of the UI, a PDF / Word doc, or a CSV of inputs.
42
+
43
+
```bash
44
+
kane-cli generate "test the login flow described in the attached spec" --files ./login-spec.pdf,./wireframe.png --agent
-**Limits** — up to **10 files**, each **≤ 50 MB**.
49
+
-**Validated as a set, up front** — if any path is missing, an unsupported type, too large, or over the count, the whole command is rejected (exit `2`) **before anything is sent** and the offending paths are listed; fix and re-run. Files outside the current directory are allowed but flagged with a warning on stderr.
Under `--agent`, each file emits a `generate_upload` line (`status``uploading` → `done`) **before**`generate_start` — see `references/generate-parsing.md`. *(Interactively in the TUI, type `@` in the generate prompt to attach a file inline.)*
53
+
38
54
## Presenting a result (adaptive)
39
55
40
56
The terminal data carries the full scenarios + cases. **Present it based on size**:
@@ -114,6 +130,7 @@ Invalid flag combinations exit `2` with a message on stderr. The full set:
114
130
-`--save` without `--req`
115
131
-`--save` with a description (it takes none)
116
132
-`--out` without `--save`
133
+
-`--files` with `--save` (files attach to a new generation or a refine, not a save)
Copy file name to clipboardExpand all lines: .claude/skills/kane-cli/SKILL.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -287,6 +287,8 @@ Then offer the next commands from the terminal line's Refine / Save hints (they
287
287
288
288
**Clarification → refine (do not skip):** if the turn ends with a clarification, that's **exit 0 — not an error**. Act on it: answer it yourself, or ask your own user, then **re-invoke**`kane-cli generate "<answer>" --refine --req <id> --agent`. Never drop a clarification.
289
289
290
+
**Attach files:**`--files a,b,c` adds local files (docs / images / PDF / CSV — up to 10, ≤ 50 MB each) as generation context on a **new** or **`--refine`** turn (not `--save`); each emits a `generate_upload` line before `generate_start`. Details in `references/generate.md`.
291
+
290
292
**Save is Functional-only:**`--save` writes only **Functional** cases to `_test.md` (under `<cwd>/.testmuai/tests` by default). Non-functional cases (Security, Performance, …) are generated and shown but not saved. Run saved files with **`kane-cli testmd run`** (`references/testmd.md`) — that's the generate → testmd pipeline.
291
293
292
294
Internal event/field names (`generate_snapshot`, `request_id`, …) are for parsing only — never show them to the user (§5 rule). Wire schema: `references/generate-parsing.md`.
|`generate_upload`|`file`, `index`, `total`, `status`| Only when `--files` is used. Emitted once per attached file **before `generate_start`**, while the file uploads; `status` goes `"uploading"` → `"done"` (or `"failed"`). Progress only — narrate "attaching <file>…" or ignore. A failed upload surfaces as an `error` + non-zero exit. |
26
27
|`generate_start`|`request_id`, `objective_chars`, `scenario_limit`, `per_scenario_limit`, `is_refine`| Turn began. **Capture `request_id`** — it's the handle for every later `--refine` / `--save`. `is_refine` distinguishes a new request from a continuation. |
27
28
|`generate_thinking`|`took_ms`| Liveness only. Narrate "thinking…" or ignore. |
28
29
|`generate_progress`|`pct`| Milestone (25 / 50 / 75 / 100). Optional progress display — not a completion signal. |
Copy file name to clipboardExpand all lines: .claude/skills/kane-cli/references/generate.md
+18-1Lines changed: 18 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,7 @@
6
6
7
7
**Use this whenever a task needs test cases or scenarios written — don't hand-author them in chat or a scratch file.** Reach for it to: turn a requirement / feature description into a test suite; expand or refine coverage (more edge cases, negative paths, a narrower or broader focus); or save the Functional cases as runnable `_test.md`. It is **not** for driving a browser — that's `kane-cli run` (§3 of SKILL.md).
8
8
9
-
> For the full web-product picture (richer inputs, dashboards), see the public docs: <https://www.testmuai.com/support/docs/generate-test-cases-with-ai/>. The CLI surface here is **text-objective only**.
9
+
> For the full web-product picture (dashboards, issue-link inputs), see the public docs: <https://www.testmuai.com/support/docs/generate-test-cases-with-ai/>. The CLI takes a **textobjective**, optionally with local files attached via **`--files`** (see "Attaching files" below).
10
10
11
11
## The three modes — one turn per invocation, then exit
12
12
@@ -30,11 +30,27 @@ There is **no interactive session**. Each invocation runs exactly one generation
30
30
|`--name <name>`| Names the run and the saved suite folder |
31
31
|`--scenario-limit <n>` / `--per-scenario-limit <n>`| Cap scenarios / cases-per-scenario |
32
32
|`--memory`| Use the memory layer — reuse relevant existing cases, reduce duplicates |
33
+
|`--files <paths>`| Comma-separated local files to attach as context (new / refine only — see "Attaching files") |
If neither `--project`/`--folder` nor a saved project/folder is set when generation starts, kane-cli auto-resolves one headlessly and emits a `project_folder_auto_defaulted` event before `generate_start`. Translate it to a one-line note for the user — full handling lives in `references/test-manager.md`.
37
38
39
+
## Attaching files
40
+
41
+
Pass local files as extra context with `--files <comma-separated paths>` on a **new** generation or a **`--refine`** (not `--save`). The generator reads them and reflects them in the scenarios + cases — attach a spec, a screenshot of the UI, a PDF / Word doc, or a CSV of inputs.
42
+
43
+
```bash
44
+
kane-cli generate "test the login flow described in the attached spec" --files ./login-spec.pdf,./wireframe.png --agent
-**Limits** — up to **10 files**, each **≤ 50 MB**.
49
+
-**Validated as a set, up front** — if any path is missing, an unsupported type, too large, or over the count, the whole command is rejected (exit `2`) **before anything is sent** and the offending paths are listed; fix and re-run. Files outside the current directory are allowed but flagged with a warning on stderr.
Under `--agent`, each file emits a `generate_upload` line (`status``uploading` → `done`) **before**`generate_start` — see `references/generate-parsing.md`. *(Interactively in the TUI, type `@` in the generate prompt to attach a file inline.)*
53
+
38
54
## Presenting a result (adaptive)
39
55
40
56
The terminal data carries the full scenarios + cases. **Present it based on size**:
@@ -114,6 +130,7 @@ Invalid flag combinations exit `2` with a message on stderr. The full set:
114
130
-`--save` without `--req`
115
131
-`--save` with a description (it takes none)
116
132
-`--out` without `--save`
133
+
-`--files` with `--save` (files attach to a new generation or a refine, not a save)
Copy file name to clipboardExpand all lines: docs/user-guide/generate-test-cases/overview.md
+21-2Lines changed: 21 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,7 +9,7 @@ A generation produces:
9
9
10
10
You generate, review the result, **refine** it in plain language as many times as you like, and optionally **save** the functional cases as runnable `_test.md` files that [`kane-cli testmd`](../testmd/running.md) can execute and replay.
11
11
12
-
> For the full picture of AI test-case generation — including richer inputs (files, PDFs, issue links) and pushing cases into Test Manager or automation — see the docs at <https://www.testmuai.com/support/docs/generate-test-cases-with-ai/>. The **CLI here takes a text description** and writes local `_test.md` files. See [Limits and scope](#limits-and-scope).
12
+
> For the full picture of AI test-case generation — including issue-link inputs, dashboards, and pushing cases into Test Manager or automation — see the docs at <https://www.testmuai.com/support/docs/generate-test-cases-with-ai/>. The **CLI takes a text description** (optionally with local files attached via [`--files`](#attaching-files-for-context)) and writes local `_test.md` files. See [Limits and scope](#limits-and-scope).
13
13
14
14
## Quick start
15
15
@@ -52,10 +52,28 @@ The request id (`23271` above) is printed at the end of each generation and is h
52
52
|`--scenario-limit <n>`| Maximum number of scenarios to generate. |
53
53
|`--per-scenario-limit <n>`| Maximum test cases per scenario. |
54
54
|`--memory`| Use the **memory layer** — reuse relevant existing test cases and reduce duplicates. |
55
+
|`--files <paths>`| Comma-separated local files to attach as context (new generations and refines only). See [Attaching files for context](#attaching-files-for-context). |
|`--agent`| Emit structured NDJSON on stdout (auto-on when run non-interactively / piped). |
57
58
|`--env`, `--username`, `--access-key`| Environment and authentication — same as [`kane-cli run`](../running-tests.md). See [Authentication](../authentication.md). |
58
59
60
+
## Attaching files for context
61
+
62
+
Give the generator more to work from by attaching local files with `--files` — a comma-separated list of paths — on a **new** generation or a **refine**:
63
+
64
+
```bash
65
+
kane-cli generate "test the login flow described in the attached spec" --files ./login-spec.pdf,./wireframe.png
66
+
```
67
+
68
+
The files are sent along with your description and reflected in the generated scenarios and cases — attach a spec, a screenshot of the UI, a PDF or Word document, or a CSV of inputs.
-**Limits** — up to **10 files**, each **50 MB** or smaller.
72
+
-**Checked before anything is sent** — all paths are validated as a set; if any is missing, an unsupported type, too large, or over the count, the command stops and lists the offending paths so nothing is uploaded by mistake. Files outside the current directory are allowed but flagged with a warning.
73
+
-**Not with `--save`** — files attach to a generation or refine, not a save (`--files` with `--save` is rejected).
74
+
75
+
In the interactive TUI, type `@` in the generate prompt to attach a file inline instead of passing `--files`.
76
+
59
77
## Interactive mode (TUI)
60
78
61
79
The commands above are the scripted surface. The kane-cli TUI **launches in Run mode** (for running tests) by default — switch to **Generate mode** with **`/generate`**, and back with `/run`. Or jump straight in: running `kane-cli generate "<objective>"` in a terminal (without `--agent`) opens the TUI directly in Generate mode and submits your objective.
@@ -65,6 +83,7 @@ Unlike the one-turn command-line surface, the TUI is a **live session** — gene
65
83
| Input | Action |
66
84
|---|---|
67
85
|*(type any text)*|**Refine** — describe a change in plain language; the set updates in place |
86
+
|`@<file>`|**Attach a file** — type `@` to pick a local file to add as context (same files as `--files`) |
68
87
|`/view [S<n>]`| Open the **scenario browser** — drill scenarios → cases → case detail |
69
88
|`/save`| Save the functional cases to `<cwd>/.testmuai/tests/…`|
70
89
|`/cancel`| Cancel the current generation |
@@ -95,7 +114,7 @@ This is the intended path: **generate authors test cases → testmd runs them.**
95
114
96
115
## Limits and scope
97
116
98
-
-**Input is a text description.**File, PDF, audio, and issue-link inputs (and the web product's "Create / Create and Automate") are not part of the CLI.
117
+
-**Input is a text description, optionally with attached files.**Attach local files with `--files` (see [Attaching files for context](#attaching-files-for-context)); issue-link inputs and the web product's "Create / Create and Automate" are not part of the CLI.
99
118
-**Refinement is whole-request.** You refine the request as a whole in plain language; targeting an individual scenario or case from the CLI is not yet supported.
100
119
-**Scenario and per-scenario counts** are bounded by `--scenario-limit` / `--per-scenario-limit`.
Copy file name to clipboardExpand all lines: docs/user-guide/generate-test-cases/workflow.md
+8Lines changed: 8 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -38,6 +38,14 @@ kane-cli generate "checkout flow on a shopping site" --scenario-limit 4 --per-sc
38
38
39
39
Add `--memory` to reuse relevant existing cases and avoid duplicating coverage you already have.
40
40
41
+
Attach local files as context — a spec, a screenshot, a PDF or CSV — with `--files` (on a new generation or a refine):
42
+
43
+
```bash
44
+
kane-cli generate "cover the flows described in the attached spec" --files ./spec.pdf,./flows.csv
45
+
```
46
+
47
+
Up to 10 files, each 50 MB or smaller (documents, images, audio, video); all paths are validated before anything is sent. See [Attaching files for context](./overview.md#attaching-files-for-context).
48
+
41
49
## 2. Refine
42
50
43
51
Refinement is a plain-language conversation. Each refine is a fresh command with `--refine --req <id>`:
0 commit comments