@ywldan/kiro 0.2.10 → 0.2.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,45 +1,38 @@
1
1
  # Kiro
2
2
 
3
- A small terminal-based AI coding agent, in the spirit of Codex CLI and Claude Code. Kiro streams model output into an Ink TUI, calls tools to read, edit, and run code in your working directory, and asks before doing anything destructive.
3
+ Kiro is a small coding agent for the terminal. It streams replies from any OpenAI-compatible endpoint into an Ink TUI, reads and edits files, runs shell commands, and asks before it changes anything.
4
4
 
5
- Phase 1 (MVP) supports OpenAI-compatible chat-completions endpoints: OpenAI itself, OpenRouter, Ollama, LM Studio, vLLM, and anything else that speaks `POST {baseUrl}/chat/completions` with SSE streaming and tool calls. A built-in model workflow (`kiro model`) discovers models from the endpoint, tests the connection, and stores keys outside the config file.
5
+ OpenAI, OpenRouter, Ollama, LM Studio, vLLM, and other servers that implement `POST {baseUrl}/chat/completions` with SSE streaming and tool calls all work. `kiro model` discovers the endpoint's models, tests the connection, and keeps keys out of the config file.
6
6
 
7
7
  ## Requirements
8
8
 
9
- - Node.js 20 or newer
10
- - pnpm, only when building from source (npm works too, but the lockfile and scripts assume pnpm)
11
- - An OpenAI-compatible endpoint and, if the endpoint requires one, an API key
9
+ - Node.js 20 or newer.
10
+ - An OpenAI-compatible endpoint, plus an API key if the server needs one.
11
+ - pnpm when building from source. npm works too, but the lockfile and scripts use pnpm.
12
12
 
13
13
  ## Install
14
14
 
15
- From npm:
16
-
17
15
  ```bash
18
16
  npm install -g @ywldan/kiro
19
17
  ```
20
18
 
21
- Then run `kiro` from any project directory.
19
+ Then run `kiro` from a project directory.
22
20
 
23
21
  From source:
24
22
 
25
23
  ```bash
26
24
  pnpm install
27
25
  pnpm build
28
-
29
- # pnpm 11+
30
- pnpm add -g .
31
-
32
- # pnpm 9/10
33
- # pnpm link --global
26
+ pnpm add -g . # pnpm 11+
27
+ # pnpm link --global # pnpm 9/10
34
28
  ```
35
29
 
36
- If `kiro` is not found after a pnpm global install, pnpm's global bin directory is not on your `PATH`; run `pnpm setup` once, add `~/.local/share/pnpm/bin` to `PATH`, or invoke the binary by its full path.
30
+ If `kiro` is missing after a global install, pnpm's bin directory is not on `PATH`. Run `pnpm setup` once, add `~/.local/share/pnpm/bin` to `PATH`, or call the binary by its full path.
37
31
 
38
- You can also run it without linking:
32
+ You can also run it without installing:
39
33
 
40
34
  ```bash
41
35
  node dist/index.js
42
- # or, during development:
43
36
  pnpm dev
44
37
  ```
45
38
 
@@ -47,50 +40,39 @@ pnpm dev
47
40
 
48
41
  ```bash
49
42
  cd ~/src/my-project
50
- kiro model # choose "Add a new model", pick a provider, paste your key
51
- kiro # start talking to it
43
+ kiro model # add a model, pick a provider, paste the key
44
+ kiro # start the session
52
45
  ```
53
46
 
54
- The wizard fetches the endpoint's model list, stores the key in `~/.kiro/.env` (mode `0600`), verifies that a real chat completion works, and can make the new profile active immediately. `~/.kiro/config.json` is created on first use and never contains the key itself.
47
+ The wizard saves the key to `~/.kiro/.env` (mode `0600`), fetches the model list, sends a test completion, and can activate the new profile right away. `~/.kiro/config.json` is created on first use and never stores the key.
55
48
 
56
- In a terminal the wizard runs on the alternate screen and redraws in place: you always see the current step only, with a breadcrumb of what you already answered (`Choose a provider: Custom endpoint · Base URL: https://…`) across the top. Each entry is labelled with the menu's own title rather than the generic `Choose`, and pressing Enter on a default records the value that was kept instead of `(default)`; `Esc` clears the breadcrumb, and errors from an abandoned step do not follow you into the next one. Long lists are trimmed to the window height so the prompt never scrolls off, and each step replaces the previous menu instead of adding to the scrollback. When a list is longer than the window, a dim indicator shows how much is hidden and you can move through it while the prompt is active: `↑`/`↓` one line, `PgUp`/`PgDn` a page, `Home` the first entry, `End` back to the newest; any new message jumps back to the bottom. When you quit, the screen is restored and the results (saved profile, active profile, where the key went) are printed once. Piped or non-interactive output falls back to plain sequential printing.
49
+ The wizard runs on the alternate screen and redraws one step at a time, with a breadcrumb of the answers so far. Long menus scroll with `↑`/`↓`, `PgUp`/`PgDn`, `Home`, and `End`, and a dim counter shows how many entries are hidden. `Esc` clears the breadcrumb; quitting restores the screen and prints the saved result. Piped output falls back to plain prompts.
57
50
 
58
- Prefer no prompts?
51
+ To skip the wizard:
59
52
 
60
53
  ```bash
61
54
  export OPENROUTER_API_KEY="sk-or-..."
62
55
  kiro model add --name openrouter --base-url https://openrouter.ai/api/v1 \
63
56
  --model anthropic/claude-sonnet-4 --api-key-env OPENROUTER_API_KEY --set-active
64
- kiro
65
57
  ```
66
58
 
67
- Set `KIRO_CONFIG_PATH` to use a different config file (useful for testing).
59
+ Set `KIRO_CONFIG_PATH` to use a different config file.
68
60
 
69
61
  ## Managing models
70
62
 
71
- Kiro keeps named connection profiles. `kiro model` opens a guided menu:
72
-
73
- ```
74
- Model workflow
75
- 1. Select the active model
76
- 2. Add a new model
77
- 3. Edit a model
78
- 4. Remove a model
79
- 5. Quit
80
- ```
63
+ Kiro keeps named connection profiles. `kiro model` opens a menu with select, add, edit, remove, and quit.
81
64
 
82
65
  ### Adding a model
83
66
 
84
- 1. Pick a preset or **Custom endpoint**.
85
- 2. Confirm or edit the base URL.
86
- 3. Confirm or edit the environment variable that will hold the key, then paste the key (input is masked). Local presets skip both steps.
87
- 4. Kiro requests `GET {baseUrl}/models` and shows the result. Enter a number, type part of an id to filter, or enter `0` to type the id manually. If discovery fails or returns an empty list, Kiro explains why and asks for the model id.
88
- 5. Accept the suggested profile name or type your own. Names use letters, digits, `-`, and `_`, and must be unique.
89
- 6. Optionally set `temperature`, `maxTokens`, and `contextWindow` (defaults `0.2`, `4096`, and `128000`).
90
- 7. Kiro sends a tiny non-tool chat completion ("Reply with OK"). It reports success and latency, or the exact error (auth, 404, rate limit, timeout, bad JSON, unreachable host). A failure offers **Retry**, **Edit connection fields**, **Save anyway**, or **Cancel**.
91
- 8. Confirm **Set as active profile?** (`Y/n`).
67
+ 1. Pick a preset or a custom endpoint.
68
+ 2. Confirm the base URL and the environment variable for the key, then paste the key. Local presets skip these steps.
69
+ 3. Kiro calls `GET {baseUrl}/models`. Pick a number, type part of an id to filter, or enter `0` to type the id yourself. If discovery fails, Kiro explains why and asks for the id.
70
+ 4. Accept the suggested profile name or type your own. Names use letters, digits, `-`, and `_`, and must be unique.
71
+ 5. Optionally set `temperature`, `maxTokens`, and `contextWindow` (defaults `0.2`, `4096`, `128000`).
72
+ 6. Kiro sends a small test completion ("Reply with OK") and reports the latency or the exact error. On failure you can retry, edit the connection, save anyway, or cancel.
73
+ 7. Confirm whether the new profile should become active.
92
74
 
93
- `Esc` or `Ctrl+C` cancels any step. Cancelling leaves both `config.json` and `.env` untouched.
75
+ `Esc` or `Ctrl+C` cancels a step and leaves `config.json` and `.env` untouched.
94
76
 
95
77
  ### Presets
96
78
 
@@ -105,7 +87,7 @@ Model workflow
105
87
  | LM Studio (local) | `http://localhost:1234/v1` | none |
106
88
  | Custom endpoint | you enter it | optional |
107
89
 
108
- Presets only prefill the base URL and the suggested variable name; every field remains editable.
90
+ Presets only fill in the base URL and a suggested variable name. Every field stays editable.
109
91
 
110
92
  ### Scripted commands
111
93
 
@@ -121,39 +103,39 @@ kiro model add --name <name> --base-url <url> --model <id> \
121
103
  [--temperature <0-2>] [--max-tokens <n>] [--set-active] [--no-test]
122
104
  ```
123
105
 
124
- `--flag=value` works as well. `add` validates the URL, name, model, and numbers before saving; a failed connection test saves nothing (use `--no-test` to skip the test). Success exits `0`; validation, network, and test failures exit non-zero with a clear message on stderr.
106
+ `--flag=value` also works. `add` validates the URL, name, model, and numbers before saving, and a failed connection test saves nothing (use `--no-test` to skip it). Success exits `0`; validation, network, and test failures exit non-zero with a message on stderr.
125
107
 
126
- Key handling for `kiro model add`:
108
+ Keys for `kiro model add`:
127
109
 
128
- - `--api-key <key>` writes the key to `~/.kiro/.env` under `--api-key-env`, or under a generated `KIRO_<PROFILE_NAME>_API_KEY`.
129
- - `--api-key-env <VAR>` with no key stores nothing; it references the variable, which must already be set in the environment or in `~/.kiro/.env`.
130
- - Omitting both creates a profile with no key, suitable for local servers.
110
+ - `--api-key <key>` writes the key to `~/.kiro/.env` under `--api-key-env`, or under a generated `KIRO_<PROFILE>_API_KEY`.
111
+ - `--api-key-env <VAR>` stores nothing; the variable must already exist in the environment or in `~/.kiro/.env`.
112
+ - With neither flag, the profile has no key, which is fine for local servers.
131
113
 
132
- ### Staying up to date
114
+ ### Updates
133
115
 
134
116
  ```bash
135
- kiro check # installed version vs the latest on npm
136
- kiro update # npm install -g @ywldan/kiro@latest
117
+ kiro check # installed version vs npm
118
+ kiro update # npm install -g @ywldan/kiro@latest
137
119
  ```
138
120
 
139
- `check` exits `0` when current, `1` when an update is available, `2` when the registry cannot be reached. `update` shows the npm output and needs the same permissions as a global npm install.
121
+ `check` exits `0` when current, `1` when an update exists, and `2` when the registry cannot be reached. `update` prints npm's output and needs the permissions of a global install.
140
122
 
141
123
  ### Where keys live
142
124
 
143
- The config file contains only `apiKeyEnv`, the *name* of a variable. Values live in the environment or in `~/.kiro/.env`:
125
+ `config.json` stores only `apiKeyEnv`, the name of a variable. Values live in the environment or in `~/.kiro/.env`:
144
126
 
145
127
  ```
146
128
  # ~/.kiro/.env
147
129
  OPENROUTER_API_KEY=sk-or-...
148
130
  ```
149
131
 
150
- - The file is created on demand with mode `0600`; its directory uses `0700` (best effort on platforms without POSIX modes).
151
- - At startup Kiro loads `~/.kiro/.env` first, then real environment variables override it.
152
- - Updating a key rewrites only that line, preserving comments and other variables. Removing a profile leaves its secret in `.env` so another profile can reuse it.
153
- - Keys are never written to `config.json`, sessions, logs, or the TUI. Kiro shows `set via $VAR`, `missing ($VAR)`, or a mask such as `sk-…abcd`.
154
- - Values in `.env` and every profile's `apiKeyEnv` are also withheld from the environment of `run_command` and redacted from tool output, so `env`, `printenv`, or `cat ~/.kiro/.env` cannot copy a key into the transcript, the model's context, or a saved session.
132
+ - The file is created on demand with mode `0600`; the directory uses `0700` where the platform supports it.
133
+ - Kiro loads `~/.kiro/.env` at startup, and real environment variables win.
134
+ - Updating a key rewrites only that line. Removing a profile leaves its secret in `.env` so other profiles can reuse it.
135
+ - Keys are not written to `config.json`, sessions, logs, or the TUI. Kiro shows `set via $VAR`, `missing ($VAR)`, or a mask such as `sk-…abcd`.
136
+ - Values from `.env` and every profile's `apiKeyEnv` are removed from `run_command`'s environment and redacted from tool output, so `env` or `cat ~/.kiro/.env` cannot copy a key into the transcript or a saved session.
155
137
 
156
- Set `KIRO_ENV_PATH` to use a different `.env` file (useful for testing).
138
+ Set `KIRO_ENV_PATH` to use a different `.env` file.
157
139
 
158
140
  ## Configuration
159
141
 
@@ -184,16 +166,16 @@ Set `KIRO_ENV_PATH` to use a different `.env` file (useful for testing).
184
166
 
185
167
  | Field | Required | Meaning |
186
168
  | --- | --- | --- |
187
- | `type` | yes | Provider type. Only `openai` is implemented in Phase 1. |
169
+ | `type` | yes | Provider type. Only `openai` is implemented. |
188
170
  | `baseUrl` | yes | API base URL including the version segment, e.g. `https://api.openai.com/v1`. Kiro appends `/chat/completions`. |
189
171
  | `apiKeyEnv` | no | Name of the environment variable holding the API key. Omit for local servers that need no auth. |
190
172
  | `model` | yes | Model name sent to the endpoint. |
191
173
  | `models` | no | Model ids the `/model` picker offers for this profile. Filled by discovery; the model in use is always included. |
192
174
  | `temperature` | no | Sampling temperature. |
193
175
  | `maxTokens` | no | Maximum response tokens. |
194
- | `contextWindow` | no | Approximate model context window in tokens, at least 1000. Defaults to `128000`; drives the ctx meter and automatic compaction. |
176
+ | `contextWindow` | no | Approximate context window in tokens, at least 1000. Defaults to `128000`; drives the ctx meter and compaction. |
195
177
 
196
- `activeProfile` selects the profile used at startup. `/model <name>` switches at runtime; `--profile` switches per run.
178
+ `activeProfile` selects the profile used at startup. `/model <name>` switches at runtime and `--profile` switches for one run.
197
179
 
198
180
  ### Example endpoints
199
181
 
@@ -207,7 +189,7 @@ kiro model add --name openrouter \
207
189
  --api-key-env OPENROUTER_API_KEY --set-active
208
190
  ```
209
191
 
210
- **Ollama** (no key; discovery normally works, but a manually pulled tag can be entered instead)
192
+ **Ollama** (no key; discovery normally works, but you can enter a manually pulled tag)
211
193
 
212
194
  ```bash
213
195
  kiro model add --name ollama \
@@ -215,21 +197,20 @@ kiro model add --name ollama \
215
197
  --model qwen2.5-coder:14b --set-active
216
198
  ```
217
199
 
218
- **LM Studio / vLLM / another OpenAI-compatible server**
200
+ **LM Studio, vLLM, or another local server**
219
201
 
220
202
  ```bash
221
203
  kiro model add --name local \
222
204
  --base-url http://localhost:1234/v1 \
223
205
  --model local-model --set-active
224
206
 
225
- # A server without GET /models: skip discovery by naming the model directly,
226
- # and skip the test if it is not running yet.
207
+ # A server without GET /models: name the model directly.
227
208
  kiro model add --name vllm \
228
209
  --base-url http://gpu-box:8000/v1 \
229
210
  --model my-model --no-test
230
211
  ```
231
212
 
232
- If you prefer hand-editing, the JSON form above is still supported; `kiro model` → **Edit a model** can also update fields afterwards and re-test.
213
+ The JSON form above still works if you prefer editing by hand. `kiro model` then **Edit a model** can update fields and re-test.
233
214
 
234
215
  ## CLI options
235
216
 
@@ -256,11 +237,11 @@ kiro [options]
256
237
  kiro update Install the latest version from npm globally
257
238
  ```
258
239
 
259
- `--flag=value` works as well. CLI overrides last for the current process only.
240
+ `--flag=value` works too. CLI overrides last for the current process only.
260
241
 
261
242
  ## Headless mode
262
243
 
263
- `kiro -p "…"` runs a single turn without Ink, for scripts, cron jobs, and CI:
244
+ `kiro -p "…"` runs one turn without Ink, for scripts, cron jobs, and CI:
264
245
 
265
246
  ```bash
266
247
  kiro -p "explain what this repo does" # read-only answers work immediately
@@ -270,11 +251,11 @@ kiro -p "continue" --continue # continue this directory
270
251
  echo "summarize README.md" | kiro -p - > summary.md # "-" reads stdin
271
252
  ```
272
253
 
273
- Assistant text goes to **stdout**; tool calls, reasoning, compaction notices, and errors go to **stderr**, so `kiro -p … > out.md` stays clean. The turn uses the same provider, tools, system prompt, compaction, and session store as the TUI, and the session is saved when it finishes.
254
+ Assistant text goes to stdout; tool calls, reasoning, compaction notices, and errors go to stderr, so `kiro -p … > out.md` stays clean. The turn uses the same provider, tools, system prompt, compaction, and session store as the TUI.
274
255
 
275
- Approvals are denied in headless mode unless you pass `--yolo`: a piped run never performs an unsupervised write or command. When a read-only tool is enough, leave `--yolo` off.
256
+ Approvals are denied unless you pass `--yolo`, so a piped run cannot write or execute anything unsupervised. Leave `--yolo` off when read-only tools are enough.
276
257
 
277
- Exit codes: `0` success, `1` model/tool/session error, `2` usage error (including a missing prompt), `130` cancelled with Ctrl+C. Prompt history is not recorded for headless runs. Set `KIRO_STREAM_IDLE_MS` to change the stall timeout (default 120000 ms; `0` disables it).
258
+ Exit codes: `0` success, `1` model/tool/session error, `2` usage error, `130` cancelled with Ctrl+C. Headless runs do not record prompt history. `KIRO_STREAM_IDLE_MS` changes the stall timeout (default 120000 ms; `0` disables it).
278
259
 
279
260
  ## Using the TUI
280
261
 
@@ -293,33 +274,33 @@ Exit codes: `0` success, `1` model/tool/session error, `2` usage error (includin
293
274
  | `Ctrl+W` | Delete the previous word |
294
275
  | Left / Right / Home / End | Move the cursor |
295
276
 
296
- The status bar shows the active profile and model, the working directory, the context meter (`ctx 42k/128k`), the number of queued messages, and the current state (`ready`, `thinking…`, `replying…`, `running <tool>…`, `approval needed`, `cancelling…`, `Ctrl+C again to quit`) with a spinner and the elapsed seconds for the current turn (`replying… · 12s`). A long profile name is shortened in the middle, so the model and directory stay readable. On a wide terminal the context meter moves into the Usage card described below, leaving more room for the profile and path.
277
+ The status bar shows the profile, model, working directory, context meter (`ctx 42k/128k`), queued message count, and state (`ready`, `thinking…`, `replying…`, `running <tool>…`, `approval needed`, `cancelling…`, `Ctrl+C again to quit`). Long profile names are shortened in the middle. On wide terminals the context meter moves into the Usage card.
297
278
 
298
- The input stays enabled while the agent works: type the next prompt and press Enter to queue it, and it runs as soon as the current turn ends. Queued prompts appear in the transcript right away, the status bar shows `N queued`, and Ctrl+C clears the queue together with the running turn. Slash commands typed while busy are queued the same way.
279
+ You can type while the agent works. The prompt is queued, shown in the transcript, and runs when the current turn ends; the status bar shows `N queued`. Ctrl+C clears the queue with the running turn, and slash commands queue the same way.
299
280
 
300
- Pressing Ctrl+C while idle does not exit immediately: the status bar shows `Ctrl+C again to quit` for two seconds, and a second press within that window leaves. This makes an accidental Ctrl+C harmless. `/exit` still quits right away, and a running turn is cancelled by the first press.
281
+ Ctrl+C while idle waits two seconds for a second press before exiting. `/exit` quits immediately. During a turn, the first press cancels it.
301
282
 
302
- Prompt history is stored per working directory in `~/.kiro/history/` (mode `0600`, up to 200 entries). With an empty input, `↑` recalls the most recent prompt, `↓` walks forward again, and editing the recalled text leaves history mode. Registered API-key values are redacted before a prompt is written. Set `KIRO_HISTORY_DIR` to store the files elsewhere.
283
+ Prompt history is stored per directory in `~/.kiro/history/` (mode `0600`, 200 entries). `↑` recalls with an empty input, `↓` moves forward, and editing leaves history mode. Keys are redacted before a prompt is written. Set `KIRO_HISTORY_DIR` to change the location.
303
284
 
304
- Reasoning models stream their thinking traces live as a dim `thinking…` block. Once the visible answer starts, the trace collapses to a single `reasoning (done, not saved)` line: traces are display-only and are never written to sessions or `/export`. While the model is producing text the status bar switches from `thinking…` to `replying…`; tool execution shows `running <tool>…`.
285
+ Reasoning traces stream as a dim block and collapse to `reasoning (done, not saved)` when the answer starts. They are not written to sessions or `/export`.
305
286
 
306
- Each finished assistant round shows how long it took and, when the endpoint reports usage, its output throughput: `· 8.4s · 23 tok/s`. The countdown in the status bar and the per-reply timing are wall-clock (including network time), are display-only, and are not stored in saved sessions; resumed replies and replies from servers without usage simply omit them.
287
+ Each finished reply shows its duration and, when the endpoint reports usage, output throughput (`8.4s · 23 tok/s`). Both are display-only and are not stored in sessions.
307
288
 
308
- When the terminal is at least 110 columns wide and the transcript has room for 9 rows, a **Usage card** sits in its own column to the right of the conversation, anchored to the bottom just above the input, and stays there while you chat. It shows the session's token totals (`↑` sent, `↓` received) and API request count, a context gauge with the current window, and the duration and throughput of the last timed reply. Totals come from endpoint `usage` reports, accumulate across tool rounds, are saved with the session, and continue after `/resume`; compaction requests are not counted. A `~` before the context number means it is estimated because no usage has been reported since the last resume or compaction. Below 110 columns the card hides so the transcript keeps its width and the `ctx` meter returns to the status bar; `/context` prints the session totals at any width. `/usage` toggles the card; while it is hidden the transcript gets the full width.
289
+ On terminals at least 110 columns wide with room for 9 transcript rows, a Usage card sits to the right of the conversation. It shows session token totals (`↑` sent, `↓` received), API requests, a context gauge, and the last reply's timing. Totals come from endpoint usage, accumulate across tool rounds, and survive `/resume`; compaction requests are not counted. A `~` marks an estimated context number. Below 110 columns the card hides and `ctx` returns to the status bar. `/usage` toggles it, and `/context` prints the totals at any width.
309
290
 
310
- Assistant replies are rendered as Markdown: headings, bold/italic, inline code, bullet and numbered lists, task checkboxes, blockquotes, links, fenced code blocks, and tables. Table columns are sized to their contents, honour `:---`/`---:`/`:---:` alignment, and wrap cells inside the available width; a table too wide to be readable falls back to its plain rows. Unknown or incomplete markers fall back to their literal text, so streaming never breaks the layout.
291
+ Replies render as Markdown: headings, emphasis, inline code, lists, task checkboxes, blockquotes, links, code blocks, and tables. Table columns size to their content, honour alignment markers, and wrap; a table too wide to read falls back to plain rows. Unknown markers stay literal, so streaming never breaks the layout.
311
292
 
312
- Typing `/` opens a command palette. It is drawn over the bottom of the transcript instead of resizing it, so the conversation does not jump when the menu opens or closes. It filters as you type, `↑`/`↓` select a command, `Enter` runs it, and `Tab` completes it. `Esc` clears the input.
293
+ Typing `/` opens the command palette over the bottom rows of the transcript, so the conversation does not move. It filters as you type; `↑`/`↓` select, `Enter` runs, `Tab` completes, and `Esc` clears.
313
294
 
314
- `/model` opens its picker as a centered overlay: the transcript, Usage card, and input row keep their places, and the input stays visible but disabled while the picker has focus. The list uses the frame's full height and reports hidden entries (`↑ 5 more · 6-15 of 30 · ↓ 15 more`) so long model lists are never silently cut off. On terminals narrower than 60 columns or shorter than 18 rows it falls back to the inline panel, which temporarily gives up transcript rows.
295
+ `/model` opens a centered picker over the transcript. The list uses the full height and reports hidden entries (`↑ 5 more · 6-15 of 30 · ↓ 15 more`). On terminals narrower than 60 columns or shorter than 18 rows it falls back to an inline panel.
315
296
 
316
- On a real TTY, `kiro` switches to the terminal's alternate screen: you get a clean page instead of the TUI drawing underneath the command you just ran. When Kiro exits — `/exit`, `Ctrl+C` twice, or an error — the terminal restores the previous shell contents and prompt. Redirected output (pipes, CI logs) is left untouched. Pass `--no-alt-screen` to stay on the normal screen instead.
297
+ On a TTY, Kiro uses the alternate screen. When it exits, through `/exit`, a double Ctrl+C, or an error, the shell contents come back. Pipes and CI logs are untouched. `--no-alt-screen` stays on the normal screen.
317
298
 
318
- Mouse reporting is **on by default**, so the wheel scrolls the transcript. The cost is that the terminal hands clicks to Kiro instead of starting a text selection: to copy text, hold Shift while dragging (or your terminal's equivalent), or run `/mouse` — or start with `--no-mouse` — to get plain click-drag selection back, scrolling with `PgUp`/`PgDn` instead. `/mouse` toggles it at any time.
299
+ Mouse reporting is on by default, so the wheel scrolls the transcript. Hold Shift while dragging to select text, or run `/mouse` (or start with `--no-mouse`) to restore plain click-drag selection and scroll with `PgUp`/`PgDn`.
319
300
 
320
- Tool results are shown as a one-line summary. `Ctrl+O` expands the most recent one inline — full text, scrollable with `PgUp`/`PgDn` — and `/export` writes the whole conversation, including complete tool arguments and results, to a Markdown file you can open and copy from.
301
+ Tool results are one-line summaries. `Ctrl+O` expands the latest result inline; `PgUp`/`PgDn` scroll it. `/export` writes the whole conversation, including full tool arguments and results, to a Markdown file.
321
302
 
322
- Slash commands:
303
+ ### Slash commands
323
304
 
324
305
  | Command | Action |
325
306
  | --- | --- |
@@ -335,6 +316,7 @@ Slash commands:
335
316
  | `/usage` | Show or hide the Usage card, giving the transcript the full width |
336
317
  | `/skills` | List installed skills, their source, and any skipped entries |
337
318
  | `/skill <name> [request]` | Load a skill, optionally with your request in the same line |
319
+ | `/<skill name> [request]` | Call an installed skill directly, e.g. `/anti-slop rewrite this paragraph` |
338
320
  | `/compact` | Summarize older turns now, keeping the last four user turns verbatim |
339
321
  | `/sessions` | List saved sessions for this working directory |
340
322
  | `/resume <n\|id>` | Resume a session by list number or id (prefixes work) |
@@ -346,19 +328,19 @@ Slash commands:
346
328
  | `/allow clear` | Ask for approval again for every tool |
347
329
  | `/exit` | Quit |
348
330
 
349
- `/model` opens a two-step picker. The first step lists profiles grouped by endpoint (the active one is marked `*`); `Enter` opens that profile's models. The second step lists the ids stored in the profile's `models` field with the one in use marked `*`; `Enter` applies it, switches to that profile, and saves the choice to `config.json`. On the model step, type to filter (case-insensitive; space-separated terms must all match), `Backspace` edits the query, `Esc` clears the query first and then goes back, and `↑`/`↓` move through the filtered list. `Ctrl+R` refetches `GET /models` from that endpoint and stores the result; later switches need no network. `Ctrl+C` closes the picker. A profile with no stored list still shows its current model, and adding a profile through the wizard stores whatever discovery returned for it.
331
+ `/model` has two steps. The first lists profiles grouped by endpoint, with the active one marked `*`; `Enter` opens the models. The second lists stored model ids with the current one marked `*`; `Enter` applies it and saves the choice. On the model step, type to filter (all space-separated terms must match), `Esc` clears the query and then goes back, and `Ctrl+R` refetches `GET /models`. `Ctrl+C` closes the picker.
350
332
 
351
333
  ## Sessions
352
334
 
353
- Kiro saves the conversation automatically. Each working directory gets its own directory under `~/.kiro/sessions/`, keyed by a hash of the absolute path:
335
+ Kiro saves each conversation under `~/.kiro/sessions/`, in a directory named from a hash of the working directory:
354
336
 
355
337
  ```
356
338
  ~/.kiro/sessions/<cwd-hash>/<session-id>.json
357
339
  ```
358
340
 
359
- A session stores the user, assistant, and tool messages, the title (the first prompt), the creation/update times, and the profile/model in use. System prompts are not stored; they are rebuilt for the current directory on every turn. Writes are atomic (temp file plus rename), the directory is created with mode `0700`, and session files are written with mode `0600`.
341
+ Sessions store user, assistant, and tool messages, the title, timestamps, and the profile and model in use. System prompts are rebuilt for the current directory every turn, so they are not stored. Writes are atomic, the directory uses `0700`, and files use `0600`.
360
342
 
361
- Saving happens after the user message is accepted and again when a turn finishes, so a crash loses at most the in-flight response. Ctrl+C and `/exit` wait for the pending save before leaving. Set `KIRO_SESSIONS_DIR` to store sessions somewhere other than `~/.kiro/sessions`.
343
+ Saving happens after each user message and again when a turn ends, so a crash loses at most the in-flight response. Ctrl+C and `/exit` wait for the save. Set `KIRO_SESSIONS_DIR` to store sessions elsewhere.
362
344
 
363
345
  Resume with:
364
346
 
@@ -367,23 +349,23 @@ kiro --continue # most recent session for this directory
367
349
  kiro --resume <id> # a specific session
368
350
  ```
369
351
 
370
- or from inside the TUI with `/sessions` and `/resume <n|id>`. Resuming restores the visible transcript and continues the same conversation; `/clear` starts a fresh session without deleting the old one. There is no auto-resume: without a flag, Kiro always starts a new session.
352
+ `/sessions` and `/resume <n|id>` do the same from inside the TUI. `/clear` starts a new session without deleting the old one. Kiro does not auto-resume; without a flag it starts fresh.
371
353
 
372
- Session files are plaintext and contain your prompts, code snippets returned by tools, and command output. They never contain API keys (keys live only in `~/.kiro/.env` or the environment), but treat them like shell history.
354
+ Session files are plaintext and contain prompts, code from tools, and command output. They never contain API keys, but treat them like shell history.
373
355
 
374
356
  ## Context and compaction
375
357
 
376
- Kiro tracks how much of the model's context window the conversation is using. The OpenAI provider sends `stream_options: { include_usage: true }` and uses the endpoint's reported `usage` when it arrives. Servers that ignore the option still work: Kiro falls back to an estimate of roughly four characters per token. The status bar shows `ctx <used>/<window>` (or the Usage card on a wide terminal), and `/context` breaks the total down by message role and prints the session's cumulative token totals.
358
+ Kiro tracks how much of the context window the conversation uses. The OpenAI provider requests `stream_options: { include_usage: true }` and uses the endpoint's numbers when they arrive. Servers that ignore the option still work through a rough estimate of four characters per token. The status bar shows `ctx <used>/<window>` (or the Usage card on wide terminals), and `/context` breaks the total down by role and prints cumulative totals.
377
359
 
378
- Each profile may set `contextWindow` (default `128000`). At about 80% of that window, before the next model request, Kiro compacts the conversation automatically:
360
+ Each profile may set `contextWindow` (default `128000`). At about 80% of the window, Kiro compacts before the next request:
379
361
 
380
- - the system prompt is kept;
381
- - the last four user turns, together with their assistant and tool messages, stay verbatim;
382
- - older turns become a structured summary covering the goal, files touched, decisions, current state, and open TODOs;
383
- - very large old tool results are replaced by a short placeholder before summarizing, so the summarizer is not flooded;
384
- - the cut is always made at a user-message boundary, so an assistant tool-call round is never separated from its tool results.
362
+ - the system prompt stays;
363
+ - the last four user turns stay verbatim, with their assistant and tool messages;
364
+ - older turns become a summary of the goal, files touched, decisions, current state, and open TODOs;
365
+ - very large old tool results become short placeholders first, so the summarizer is not flooded;
366
+ - the cut always falls on a user-message boundary, so a tool-call round is never split.
385
367
 
386
- Compaction appears as a notice in the transcript and is written into the session, so resuming continues from the compacted history. `/compact` runs the same pass on demand. If the summary request fails, the turn continues with the uncompacted context and an error notice. Counts are approximate; server-reported usage corrects them after each response.
368
+ Compaction shows a notice and is written to the session, so a resumed conversation continues from the compacted history. `/compact` runs the same pass on demand. If the summary fails, the turn continues with the uncompacted context and an error notice. Counts are approximate and corrected when the endpoint reports usage.
387
369
 
388
370
  ## Tools and safety
389
371
 
@@ -399,40 +381,40 @@ Compaction appears as a notice in the transcript and is written into the session
399
381
  | `apply_patch(patch)` | Applies a unified diff to one or more files after validating every hunk | always (except `--yolo`) |
400
382
  | `run_command(command, timeout_seconds?)` | Runs a shell command in the working directory | always (except `--yolo`) |
401
383
 
402
- Search first, then read: `grep` and `glob` keep large repositories manageable, and `read_file` supports paging for the files that matter. `multi_edit` is the right choice for several changes in one file; `apply_patch` handles coordinated multi-file changes and validates the whole patch before writing anything. `apply_patch` supports creating files but rejects deletions and renames.
384
+ `grep` and `glob` keep large repositories manageable, and `read_file` pages through long files. Use `multi_edit` for several changes in one file and `apply_patch` for coordinated changes across files; `apply_patch` validates the whole patch before writing and rejects deletions and renames.
403
385
 
404
- Approval prompts show a diff for writes, edits, multi-edits, and patches, or the exact command for shell runs, and offer:
386
+ Approvals show a diff, or the exact command, and offer:
405
387
 
406
388
  - `[y]` allow once
407
- - `[a]` always allow this tool for the rest of the session (the status bar then shows `auto:<tool>`, and `/allow clear` takes it back)
408
- - `[n]` deny (the denial is returned to the model, which can try another approach)
389
+ - `[a]` allow this tool for the rest of the session (the status bar shows `auto:<tool>`; `/allow clear` revokes it)
390
+ - `[n]` deny and return the refusal to the model
409
391
 
410
- Paths are resolved relative to the working directory. Symlinks and `..` tricks that escape it are detected with `realpath`; reads, listings, searches, and listings outside the workspace are refused, while writes, edits, and patches outside it require an explicit approval warning. `run_command` has a default 60-second timeout (maximum 600), kills the whole process group on timeout or cancel, and truncates output to roughly 20k characters, keeping the head and tail. `read_file` defaults to 400 lines (maximum 2000) and points the model at the next offset when there is more. `glob`/`grep` honour `.gitignore`, always skip `node_modules`, `.git`, `dist`, and `build`, and cap their output with a note telling the model how to narrow the search. As a last resort, every tool result is capped at 60k characters with a note and a hint about narrower requests, so a single call cannot flood the context.
392
+ Paths resolve against the working directory. Symlinks and `..` escapes are caught with `realpath`: reads, listings, and searches outside the workspace are refused, while writes, edits, and patches outside it need an explicit approval warning. `run_command` times out after 60 seconds by default (maximum 600), kills the process group on timeout or cancel, and truncates output to about 20k characters, keeping the head and tail. `read_file` returns 400 lines by default (maximum 2000) and points at the next offset. `glob` and `grep` honour `.gitignore`, always skip `node_modules`, `.git`, `dist`, and `build`, and cap their output with a hint on narrowing the search. Every tool result is also capped at 60k characters.
411
393
 
412
- Read-only tools (`read_file`, `list_dir`, `glob`, `grep`) that the model requests in one response run in parallel; results are appended in the original call order. Any write, edit, patch, or command breaks the batch and runs sequentially with its approval prompt.
394
+ Read-only tools (`read_file`, `list_dir`, `glob`, `grep`) in one response run in parallel, and results are appended in call order. A write, edit, patch, or command breaks the batch and runs with an approval prompt.
413
395
 
414
- `--yolo` skips all approvals: the status bar shows a red `YOLO` badge, the first line of the transcript warns about it, and `/help` reminds you. It cannot be turned off from inside the session — restart without the flag. Use it only in a directory you trust.
396
+ `--yolo` skips all approvals. The status bar shows a red `YOLO` badge, the transcript warns once, and `/help` repeats it. It cannot be turned off inside the session; restart without the flag. Use it only in directories you trust.
415
397
 
416
398
  ### Undo and checkpoints
417
399
 
418
- Before every `write_file`, `edit_file`, `multi_edit`, or `apply_patch`, Kiro copies the affected files into `~/.kiro/checkpoints/<cwd-hash>/` (mode `0700`, backups `0600`). `/undo` restores the most recent call: edited files get their previous bytes back, and files the call created are deleted. Running `/undo` again steps further back through the 30 most recent calls.
400
+ Before each `write_file`, `edit_file`, `multi_edit`, and `apply_patch`, Kiro copies the affected files to `~/.kiro/checkpoints/<cwd-hash>/` (directory `0700`, backups `0600`). `/undo` restores the latest call: edited files get their previous bytes, created files are removed. Running it again steps back through the 30 most recent calls.
419
401
 
420
- Checkpoints are best effort: if a snapshot cannot be taken, the tool still runs. `run_command` is **not** checkpointed, because a shell command can touch anything; commit before letting Kiro run destructive commands. Set `KIRO_CHECKPOINTS_DIR` to store snapshots elsewhere. The manifest records backup paths, not file contents, so it stays small even in large repositories.
402
+ Snapshots are best effort; if one fails, the tool still runs. `run_command` is not checkpointed because a command can touch anything, so commit before running destructive commands. Set `KIRO_CHECKPOINTS_DIR` to change the location. The manifest stores paths, not contents, so it stays small.
421
403
 
422
404
  ## AGENTS.md
423
405
 
424
- If an `AGENTS.md` file exists in the working directory, its contents are appended to the system prompt for every turn, so project-specific instructions apply immediately, including after edits.
406
+ If `AGENTS.md` exists in the working directory, its contents are appended to the system prompt every turn, including after edits.
425
407
 
426
408
  ## Skills
427
409
 
428
- A skill is a folder of instructions that Kiro loads only when it is needed. Kiro looks in four places, in this order, and the first definition of a name wins:
410
+ A skill is a folder of instructions that Kiro loads when it is needed. Kiro checks four places in order, and the first definition of a name wins:
429
411
 
430
412
  1. `<cwd>/.kiro/skills/`
431
- 2. `<cwd>/.claude/skills/`, so skills installed for Claude Code work unchanged
413
+ 2. `<cwd>/.claude/skills/` (Claude Code skills work unchanged)
432
414
  3. `~/.kiro/skills/`
433
415
  4. `~/.claude/skills/`
434
416
 
435
- Each skill is a directory with a `SKILL.md`:
417
+ Each skill is a directory with `SKILL.md`:
436
418
 
437
419
  ```md
438
420
  ---
@@ -443,49 +425,40 @@ description: Remove AI-slop patterns from prose before answering.
443
425
  Delete "delve", "tapestry", and stacked em dashes. Prefer concrete nouns.
444
426
  ```
445
427
 
446
- Only `name` and `description` are read from the frontmatter; `allowed-tools`, `license`, and any other key are ignored, and a skill can never skip an approval prompt. A folder is a skill when it holds `SKILL.md`, searched two levels deep, so `skills/<name>/SKILL.md` and `skills/<group>/<name>/SKILL.md` both work, and symlinked skill folders are followed (loops are detected). Supporting files inside the folder — references, templates, scripts — are read or run like any other file, so `read_file` and `run_command` rules still apply.
428
+ Only `name` and `description` are read. Other keys such as `allowed-tools` and `license` are ignored, and a skill can never skip an approval. A folder counts as a skill when it holds `SKILL.md`, two levels deep, so `skills/<name>/SKILL.md` and `skills/<group>/<name>/SKILL.md` both work. Symlinked folders are followed with loop detection. Supporting files (references, templates, scripts) are read or run like any other file, with the same rules.
429
+
430
+ The system prompt gets only names and descriptions. Up to 30 skills keep a full description; beyond that descriptions are clipped to 60 characters; very large collections fall back to bare names, so the prompt stays bounded. When a request matches, the model calls `read_skill` to load the body. The tool is read-only, needs no approval, runs alongside other reads, and reports whether the skill came from the project or the user folder.
447
431
 
448
- Only the name and description reach the system prompt. Every installed skill is listed by name: up to 30 keep a full description, more than that clip theirs to 60 characters, and an enormous collection falls back to bare names so the prompt always stays bounded. When a request matches, the model calls `read_skill` to load the body, so fifty installed skills cost a few hundred tokens instead of their full text. `read_skill` is read-only: it needs no approval and can run alongside other reads, and it says whether the skill came from the project or your user folder.
432
+ `/skills` lists what was found, its source, and every skipped folder with the reason (no `SKILL.md`, a loose `SKILL.md`, a missing description, a duplicate name, an oversized file). `/skill anti-slop` loads a skill for the next message, and `/skill anti-slop rewrite this paragraph` loads it and sends the request in the same turn. The transcript shows the short command while the model gets the full instructions. The first time a repository skill is loaded, Kiro says so once.
449
433
 
450
- `/skills` lists what was found, whether it came from the project or the user, and any folder that was skipped with the reason (no `SKILL.md`, a `SKILL.md` sitting loose in the skills root, a missing description, a duplicate name, an oversized file). `/skill anti-slop` loads a skill for your next message; `/skill anti-slop rewrite this paragraph` loads it and sends the request in the same turn. Either way the transcript keeps the compact command line you typed while the model receives the full instructions. The first time the model pulls a skill that came from the repository you are in, Kiro says so once in the transcript.
434
+ Every installed skill is also a slash command, so `/anti-slop rewrite this paragraph` is the same turn as `/skill anti-slop rewrite this paragraph`. Skill names appear in the `/` menu, labelled `skill · <description>`, and can be completed with `Tab`. Built-in commands win a clash, so a skill named `model` is reachable only as `/skill model`, and `/skills` flags it. The command list refreshes after each turn, so new skills appear without a restart.
451
435
 
452
- The index is rebuilt every turn, so edits to `SKILL.md` apply on the next message. Set `KIRO_SKILLS_DIR` to replace both user roots, and `--no-skills` or `KIRO_NO_SKILLS=1` (which can live in `~/.kiro/.env`) to skip skill folders entirely.
436
+ The index is rebuilt every turn, so edits to `SKILL.md` apply on the next message. `KIRO_SKILLS_DIR` replaces both user roots. `--no-skills` or `KIRO_NO_SKILLS=1` (which can live in `~/.kiro/.env`) skips skill folders entirely.
453
437
 
454
438
  ## How it works
455
439
 
456
- - The OpenAI provider posts to `{baseUrl}/chat/completions` with `stream: true`, parses SSE incrementally, and assembles tool-call deltas by index. It also accepts a plain JSON response from servers that ignore streaming, and reads `usage` when the endpoint sends it.
457
- - OpenAI reasoning models (`o1`/`o3`/`o4`, `gpt-5`) automatically switch from `max_tokens` to `max_completion_tokens` and omit a custom temperature. If any other endpoint rejects `max_tokens` with a 400/422 that names `max_completion_tokens`, Kiro retries once with the new parameter without consuming a retry slot. Thinking deltas from `reasoning_content`, `reasoning`, and OpenRouter's `reasoning_details` are streamed to the TUI and never persisted.
458
- - A stream with no bytes for `KIRO_STREAM_IDLE_MS` (default 120 seconds, `0` disables) is cancelled and retried like a dropped connection, instead of hanging the TUI forever.
459
- - Before each model round, Kiro checks the context estimate (corrected by the last reported usage) against the profile's `contextWindow`. At ~80% it replaces older turns with a model-written summary, keeps the last four user turns, and then sends the request.
460
- - When a profile has no explicit `contextWindow`, Kiro infers one from the model id (a size suffix such as `-32k`, else a family table: `gpt-4o` 128k, `gpt-4` 8k, `o1`/`o3` 200k, `claude-3/4` 200k, `gemini` 1M, `llama-3.1` 128k, …) and falls back to 128k for unknown ids. `/context` says whether the number is inferred; set `contextWindow` in the profile to pin it.
461
- - If the endpoint still rejects a request as too long (HTTP 400/413 with a context-length message), Kiro forces a compaction and retries that round once instead of ending the turn with a bare error.
462
- - `finish_reason: length` is reported: a truncated answer, or tool-call arguments cut off by `max_tokens`, produces an explicit notice instead of a confusing tool error.
463
- - A "cheap" placeholder pass shrinks old tool results before they are summarized; the discarded messages never reach the model again after compaction.
464
- - The agent loop streams assistant text live, appends the assistant message with its tool calls, executes contiguous read-only calls in parallel and everything else sequentially, appends tool results in call order, and repeats. A turn is capped at 25 tool rounds.
465
- - Transient failures are retried up to three times with exponential backoff and jitter: network errors, connection drops before any output, HTTP 429, and 5xx. `Retry-After` is honoured (capped at 60 seconds), and the TUI shows `retrying (n/3)…`. A 400/401/403/404, a malformed stream, a cancel, or a failure after partial text is never retried. Set `KIRO_RETRY_BASE_MS` to change the base backoff (default 500ms).
466
- - Malformed tool-call JSON, unknown tool names, non-zero exits, and timeouts are returned to the model as tool errors rather than crashing the session.
467
- - Ctrl+C aborts the HTTP stream and any running command; partial assistant text is preserved.
468
- - `kiro -p` runs the same agent loop without Ink, streams assistant text to stdout and diagnostics to stderr, denies tool calls unless `--yolo` is given, and saves the session like the TUI.
469
- - Sessions are saved atomically after each user message and completed turn, and are restored by rebuilding the visible transcript from the stored messages.
470
- - Reply timing is measured per model round (request start to finished reply) and includes network latency. Token throughput uses the endpoint's completion-token usage; both are shown only in the live TUI and are not persisted. Session token totals are persisted separately in the session file.
471
- - Model discovery calls `GET {baseUrl}/models` with a 10-second timeout; the connection test sends one tiny non-tool chat completion with the same timeout. Both can be cancelled.
472
- - Config saves are atomic and merge into the file on disk, so fields Kiro does not know about are preserved. Invalid JSON can be backed up and replaced with a fresh template.
473
- - Keys are never written to `config.json`, sessions, or logs. They live in `~/.kiro/.env` (mode `0600`) or the real environment, and the config stores only `apiKeyEnv`; actual values are never printed, are stripped from `run_command`'s environment, and are redacted from tool output before it reaches the model.
440
+ - The OpenAI provider streams SSE responses and assembles tool-call deltas by index. It also accepts a plain JSON reply from servers that ignore streaming.
441
+ - Reasoning models (`o1`/`o3`/`o4`, `gpt-5`) use `max_completion_tokens` instead of `max_tokens` and omit temperature. If another endpoint rejects `max_tokens` and names `max_completion_tokens`, Kiro retries once with the new parameter.
442
+ - A stream that sends no bytes for `KIRO_STREAM_IDLE_MS` (default 120000, `0` disables) is cancelled and retried like a dropped connection.
443
+ - When a profile has no `contextWindow`, Kiro infers one from the model id (a suffix such as `-32k`, or a family table) and falls back to `128000`. `/context` says whether the value was inferred.
444
+ - If the endpoint rejects a request as too long (400/413 with a context-length message), Kiro compacts and retries the round once.
445
+ - `finish_reason: length` produces an explicit notice, including when tool-call arguments were cut off.
446
+ - Transient failures are retried up to three times with backoff and jitter: network errors, dropped connections before output, 429, and 5xx. `Retry-After` is honoured up to 60 seconds. Errors after partial text, cancels, and 400/401/403/404 are not retried. `KIRO_RETRY_BASE_MS` changes the base delay (default 500ms).
447
+ - Malformed tool JSON, unknown tools, non-zero exits, and timeouts go back to the model as tool errors instead of ending the session.
448
+ - A turn is capped at 25 tool rounds.
449
+ - Model discovery and the connection test both time out after 10 seconds and can be cancelled.
450
+ - Config saves are atomic and merge with the file on disk, so unknown fields survive. Invalid JSON can be backed up and replaced with a template.
474
451
 
475
452
  ## Testing
476
453
 
477
454
  ```bash
478
- pnpm test # backend tests against an in-process mock OpenAI-compatible server
479
- pnpm mock # start the mock server on port 8787 for manual TUI testing
455
+ pnpm test # backend tests against an in-process mock server
456
+ pnpm mock # mock server on port 8787 for manual TUI testing
480
457
  ```
481
458
 
482
- The mock server is scripted: it streams a text response with `write_file` and `list_dir` calls, then a `run_command` call, then a final answer, followed by multi-write and slow-streaming turns for approval and cancellation testing. It can also serve `GET /models` (with a configurable list or a forced `401`/`404`), return HTTP errors with custom headers such as `Retry-After`, drop the connection mid-stream, and records model-discovery and chat requests, including auth headers. Point a test profile at `http://localhost:8787/v1` and any model name; no key is needed.
483
-
484
- The suite covers streaming, multiple tool calls per response, approvals and denials, malformed tool JSON, the round cap, HTTP errors, malformed SSE, unreachable endpoints, retries for 429/5xx and connection drops, no retry after partial output or a 401, the retry limit, read-only batching and ordered results, the global result cap, abort, workspace escapes, read paging, edit uniqueness, command exit codes and timeouts, output truncation, config validation, missing keys, system-prompt/`AGENTS.md` injection, and session persistence. Search tests cover glob matching, `.gitignore` handling, heavy-directory skips, result caps, ripgrep and the built-in grep fallback, binary/large-file skipping, and invalid regexes. Editing tests cover `replace_all`, near-miss hints, atomic multi-edits, and patch validation for updates, new files, conflicts, and rejected deletions. Context tests cover `stream_options` and usage parsing, token estimates and formatting, the 80% threshold, compaction boundaries, kept tool-call rounds, the old-result placeholder pass, empty-summary rejection, loop-level compaction (once per turn, non-fatal failures), persistence of compacted sessions, the `ctx` status-bar meter, and `contextWindow` config/wizard handling. Session tests cover atomic save/load, usage totals, file permissions, per-directory isolation, sorting, corrupt-file skipping, id validation, and reconstruction of resumed tool blocks and statuses. TUI unit tests cover Markdown styles, wrapping, and table alignment, slash-command filtering/shared help text, the Usage card and its width collapse, the centered model-picker overlay with its frame and hidden-entry counts, and SGR mouse-wheel parsing; pty runs exercise the command palette, mouse and PgUp/PgDn scrolling, Markdown rendering, approvals, cancellation, and the `/usage` toggle.
485
-
486
- Model workflow tests use a temp `$HOME` so the real `~/.kiro` is never touched. They cover atomic config saves that preserve unknown fields, profile-name and URL validation, corrupt-config backup/recovery, `.env` parsing and real-environment precedence, `0600` writes, masking, the exact preset list, discovery success/401/missing-`/models`/timeout, the connection test, and wizard add/edit/select/remove/last-profile refusal/cancel/manual-model fallback. Scripted `kiro model add`, `list`, `use`, `test`, and `remove` run through the real CLI against the in-process mock; a failed test saves nothing, keys never appear in `config.json`, and generated keys land in `.env`. The wizard screen renderer is unit-tested against a fake stream: alternate-screen enter/leave, a new menu replacing the previous one, the breadcrumb of answered prompts (menu title instead of `Choose`, the value kept by pressing Enter, confirmation of a `Y/n` default, and the reset on Escape or a return to the root menu), stale errors dropped at a step change, log trimming to the terminal height with the prompt always visible, keyboard scrolling of an over-long list (page, top, bottom, clamping, reset on new output), and replaying results after the screen is restored. `/model` groups profiles by endpoint so several models behind one base URL are listed as siblings.
459
+ The mock server streams scripted replies with tool calls, slow responses, and errors, and can force `401`/`404`, custom headers, or a dropped connection. Point a profile at `http://localhost:8787/v1` with any model name; no key is needed.
487
460
 
488
- The newer paths have their own coverage: `max_completion_tokens` selection for reasoning models and recovery from a `max_tokens` rejection, `reasoning_content` deltas reaching the agent and collapsing in the renderer, the stream idle timeout, checkpoint edit/create undo with backup files outside the manifest, and prompt-history dedupe/capping/redaction. Skills are covered from the file to the model: frontmatter with quoted and continued values, CRLF input, `.kiro` overriding `.claude`, symlinked and nested skill folders, skipped folders reported with their reason, an index that keeps every name while clipping descriptions, an invocation message that carries the user's request, `--no-skills`, and the read-only `read_skill` tool. A spawned `kiro -p` test runs a tool with `--yolo`, checks the reply and saved session, feeds a piped prompt through `-p -`, and verifies the non-TTY hint without `-p`.
461
+ The tests cover streaming and tool calls, approvals, retries and timeouts, path escapes, search and edit behaviour, config and key handling, compaction, sessions, the TUI components, and the skills pipeline from `SKILL.md` to `read_skill`. Pty runs exercise the palette, scrolling, Markdown, approvals, cancellation, and the `/usage` toggle. Model workflow tests use a temporary `$HOME`, so the real `~/.kiro` is never touched.
489
462
 
490
463
  ## Project layout
491
464
 
@@ -513,7 +486,7 @@ test/
513
486
  - Model discovery assumes an OpenAI-compatible `GET /models`. Endpoints without it work, but the model id must be typed manually.
514
487
  - Removing a profile leaves its key in `~/.kiro/.env`; there is no command that deletes stored secrets.
515
488
  - No sub-agents, MCP, plugins, web search, image input, themes, or git integration.
516
- - Sessions are single-process and stored as plaintext JSON. There is no delete or rename command and no cross-directory session browser; `/export` writes a Markdown transcript you can keep or copy from.
489
+ - Sessions are single-process and stored as plaintext JSON. There is no delete or rename command and no cross-directory session browser; `/export` writes a Markdown transcript you can keep.
517
490
  - `/undo` covers `write_file`, `edit_file`, `multi_edit`, and `apply_patch` only. It keeps the last 30 calls, and `run_command` changes are outside its reach; use Git for a complete safety net.
518
491
  - Prompt history is plaintext, capped at 200 entries per directory, and only recalled in the TUI (not in `-p` mode).
519
492
  - Only contiguous read-only tool calls run in parallel; writes, edits, patches, and commands stay sequential.
@@ -521,5 +494,5 @@ test/
521
494
  - Markdown support covers the common subset; images and syntax highlighting are shown as plain text.
522
495
  - Mouse reporting is on by default and takes over click-drag selection; use Shift+drag to copy, or `--no-mouse` / `/mouse` to turn it off and scroll with `PgUp`/`PgDn`.
523
496
  - The context-window inference is a best-effort guess. For an unusual or self-hosted model, set `contextWindow` explicitly or compaction will trigger too late.
524
- - The TUI targets Linux, macOS, and Windows Terminal; Windows-specific process-kill behavior is implemented via `taskkill` but has not been exercised on a real Windows machine.
497
+ - The TUI targets Linux, macOS, and Windows Terminal; Windows process killing uses `taskkill` but has not been exercised on a real Windows machine.
525
498
  - Very narrow terminals and unusually long approval previews are clipped rather than paginated.
@@ -5,7 +5,7 @@ export const PLACEHOLDER_TOOL_RESULT_CHARS = 2_000;
5
5
  export const MAX_SUMMARY_INPUT_CHARS = 100_000;
6
6
  const MAX_TRANSCRIPT_MESSAGE_CHARS = 4_000;
7
7
  const TOOL_ARGS_PREVIEW_CHARS = 500;
8
- export const SUMMARY_PREFIX = '[Context summary — earlier turns were compacted to save space]';
8
+ export const SUMMARY_PREFIX = '[Context summary: earlier turns were compacted to save space]';
9
9
  export function shouldCompact(usedTokens, contextWindow, threshold = COMPACT_THRESHOLD) {
10
10
  return contextWindow > 0 && usedTokens >= Math.floor(contextWindow * threshold);
11
11
  }
@@ -364,10 +364,11 @@ export function skillInvocationMessage(skill, request = '') {
364
364
  }
365
365
  return `Use the "${skill.name}" skill. Its instructions follow; apply them to what I ask next.\n\n${body}`;
366
366
  }
367
- export function formatSkillList(inventory, cwd) {
367
+ export function formatSkillList(inventory, cwd, reserved = []) {
368
368
  if (inventory.disabled) {
369
369
  return 'Skills are disabled for this run (--no-skills or KIRO_NO_SKILLS).';
370
370
  }
371
+ const taken = new Set(reserved);
371
372
  const lines = [];
372
373
  if (inventory.skills.length === 0) {
373
374
  lines.push('No skills installed.');
@@ -381,8 +382,10 @@ export function formatSkillList(inventory, cwd) {
381
382
  lines.push(`Installed skills (${counts}):`);
382
383
  const width = Math.min(28, Math.max(...inventory.skills.map((skill) => skill.name.length)));
383
384
  for (const skill of inventory.skills) {
385
+ const shadowed = taken.has(skill.name.toLowerCase());
384
386
  lines.push(` ${skill.name.padEnd(width)} ${clipDescription(skill.description, 80)} ` +
385
- `[${skill.source}] (${shortPath(skill.dir, cwd)})`);
387
+ `[${skill.source}] (${shortPath(skill.dir, cwd)})` +
388
+ (shadowed ? ` · /${skill.name} is a built-in, use /skill ${skill.name}` : ''));
386
389
  }
387
390
  }
388
391
  lines.push('', `Looked in: ${inventory.roots.map((root) => shortPath(root, cwd)).join(', ')}`);
package/dist/headless.js CHANGED
@@ -12,7 +12,7 @@ import { addUsage, normalizeUsage } from './usage.js';
12
12
  * Text streams to stdout; notices, tool calls, and reasoning go to stderr, so
13
13
  * `kiro -p … > out.md` stays clean for scripting. Same session store, system
14
14
  * prompt, compaction, and tools as the TUI. Approvals are denied outside
15
- * --yolo mode — a piped run never performs an unsupervised mutation.
15
+ * --yolo mode: a piped run never performs an unsupervised mutation.
16
16
  */
17
17
  export async function runHeadless(options) {
18
18
  const { config, cwd, yolo } = options;
package/dist/index.js CHANGED
@@ -13,7 +13,7 @@ import { MOUSE_OFF } from './ui/mouse.js';
13
13
  import { App } from './ui/App.js';
14
14
  import { runCheck, runUpdate } from './update.js';
15
15
  import { VERSION } from './version.js';
16
- const HELP = `Kiro — a small terminal coding agent
16
+ const HELP = `Kiro: a small terminal coding agent
17
17
 
18
18
  Usage: kiro [options]
19
19
  kiro model [command]
@@ -89,7 +89,7 @@ async function pickProfile(ctx, title) {
89
89
  return chooseMenu(ctx, title, names.map((name) => {
90
90
  const profile = ctx.config.profiles[name];
91
91
  const active = name === ctx.config.activeProfile ? ' [active]' : '';
92
- return { key: name, label: `${name}${active} — ${profile.model} @ ${profile.baseUrl}` };
92
+ return { key: name, label: `${name}${active} · ${profile.model} @ ${profile.baseUrl}` };
93
93
  }));
94
94
  }
95
95
  function hostLabel(baseUrl) {
@@ -365,10 +365,10 @@ export async function runAddFlow(ctx) {
365
365
  const presetId = await chooseMenu(ctx, 'Choose a provider', presets.map((preset) => ({
366
366
  key: preset.id,
367
367
  label: preset.local
368
- ? `${preset.label} — ${preset.baseUrl} (no key)`
368
+ ? `${preset.label} · ${preset.baseUrl} (no key)`
369
369
  : preset.apiKeyEnv
370
- ? `${preset.label} — ${preset.baseUrl} ($${preset.apiKeyEnv})`
371
- : `${preset.label} — enter a base URL`,
370
+ ? `${preset.label} · ${preset.baseUrl} ($${preset.apiKeyEnv})`
371
+ : `${preset.label} · enter a base URL`,
372
372
  })));
373
373
  if (presetId === null)
374
374
  return cancel(ctx);
@@ -48,7 +48,7 @@ export async function executeTool(name, rawArguments, ctx) {
48
48
  }
49
49
  catch (error) {
50
50
  return toolError(`Invalid JSON arguments for ${name}: ${error.message}. ` +
51
- 'The arguments were truncated or malformed — often because the response hit its ' +
51
+ 'The arguments were truncated or malformed, often because the response hit its ' +
52
52
  'max_tokens limit. Resend this call with smaller arguments (split the work into ' +
53
53
  'several calls) or ask for a higher maxTokens.');
54
54
  }
@@ -135,7 +135,7 @@ export const runCommandTool = {
135
135
  flags.push('cancelled by user');
136
136
  const statusLine = `exit code: ${exit}` +
137
137
  (signal ? ` (signal ${signal})` : '') +
138
- (flags.length ? ` — ${flags.join(', ')}` : '');
138
+ (flags.length ? ` (${flags.join(', ')})` : '');
139
139
  const content = truncateMiddle(`${statusLine}\n${sections.join('\n')}`, MAX_OUTPUT_CHARS);
140
140
  const summary = timedOut
141
141
  ? `timed out after ${timeoutSeconds}s`
package/dist/ui/App.js CHANGED
@@ -15,7 +15,7 @@ import { createProvider } from '../providers/index.js';
15
15
  import { dropIncompleteToolCalls, formatSessionTime, isSessionId, listSessions, loadSession, newSessionId, projectSessionsDir, saveSession, titleFromMessages, } from '../sessions.js';
16
16
  import { ApprovalPrompt } from './ApprovalPrompt.js';
17
17
  import { ApprovalPolicy } from './approval-policy.js';
18
- import { slashHelpLines } from './commands.js';
18
+ import { builtinCommandNames, buildSkillCommands, SLASH_COMMANDS, slashHelpLines, } from './commands.js';
19
19
  import { defaultExportPath, renderTranscriptMarkdown } from './export.js';
20
20
  import { buildResumedView } from './history.js';
21
21
  import { Input } from './Input.js';
@@ -472,6 +472,14 @@ export function App({ config, baseConfig, overrides, configPath, configCreated,
472
472
  approvalPolicy.clear();
473
473
  setAutoAllowed([]);
474
474
  }, [approvalPolicy]);
475
+ const [skillCommands, setSkillCommands] = useState([]);
476
+ const refreshSkillCommands = useCallback(async () => {
477
+ const inventory = await loadSkills(cwd);
478
+ setSkillCommands(buildSkillCommands(inventory.skills));
479
+ }, [cwd]);
480
+ useEffect(() => {
481
+ void refreshSkillCommands();
482
+ }, [refreshSkillCommands]);
475
483
  /** Mentions once per run when the model pulls instructions that came from the repo. */
476
484
  const noteProjectSkill = useCallback(async (rawArguments) => {
477
485
  let name;
@@ -676,6 +684,7 @@ export function App({ config, baseConfig, overrides, configPath, configCreated,
676
684
  resolveApproval('deny');
677
685
  recomputeContext();
678
686
  void persistSession();
687
+ void refreshSkillCommands();
679
688
  if (!quittingRef.current) {
680
689
  if (cancelRequestedRef.current && queuedRef.current.length > 0) {
681
690
  queuedRef.current = [];
@@ -695,6 +704,7 @@ export function App({ config, baseConfig, overrides, configPath, configCreated,
695
704
  flushText,
696
705
  noteProjectSkill,
697
706
  persistSession,
707
+ refreshSkillCommands,
698
708
  profileName,
699
709
  queueText,
700
710
  recomputeContext,
@@ -787,11 +797,13 @@ export function App({ config, baseConfig, overrides, configPath, configCreated,
787
797
  return;
788
798
  const [command, ...rest] = input.trim().split(/\s+/);
789
799
  const argument = rest[0];
800
+ if (!command)
801
+ return;
790
802
  switch (command) {
791
803
  case '/help': {
792
804
  addNotice('info', [
793
805
  'Commands (type / to open the menu, ↑↓ to choose, Enter to run):',
794
- ...slashHelpLines(),
806
+ ...slashHelpLines(skillCommands.length),
795
807
  '',
796
808
  ' Model subcommands: /model <name> · /model add · /model edit [name] ·',
797
809
  ' /model remove [name] · /model test [name] · /model list --remote',
@@ -870,7 +882,7 @@ export function App({ config, baseConfig, overrides, configPath, configCreated,
870
882
  `Context: ~${formatTokens(used)} / ${formatTokens(window)} tokens (${formatPercent(used, window)} used)` +
871
883
  (profile?.contextWindow
872
884
  ? '.'
873
- : ' — window inferred from the model id; set "contextWindow" in the profile to override.'),
885
+ : '. Window inferred from the model id; set "contextWindow" in the profile to override.'),
874
886
  ` system ~${formatTokens(count('system'))} · user ~${formatTokens(count('user'))} · ` +
875
887
  `assistant ~${formatTokens(count('assistant'))} · tool ~${formatTokens(count('tool'))}`,
876
888
  usage
@@ -902,7 +914,7 @@ export function App({ config, baseConfig, overrides, configPath, configCreated,
902
914
  return;
903
915
  }
904
916
  const inventory = await loadSkills(cwd);
905
- addNotice(inventory.skills.length === 0 && inventory.invalid.length === 0 ? 'muted' : 'info', formatSkillList(inventory, cwd));
917
+ addNotice(inventory.skills.length === 0 && inventory.invalid.length === 0 ? 'muted' : 'info', formatSkillList(inventory, cwd, builtinCommandNames()));
906
918
  return;
907
919
  }
908
920
  case '/skill': {
@@ -1182,8 +1194,19 @@ export function App({ config, baseConfig, overrides, configPath, configCreated,
1182
1194
  case '/exit':
1183
1195
  quit();
1184
1196
  return;
1185
- default:
1197
+ default: {
1198
+ const skillName = command.startsWith('/') ? command.slice(1) : '';
1199
+ if (skillName) {
1200
+ const inventory = await loadSkills(cwd);
1201
+ const skill = findSkill(inventory.skills, skillName);
1202
+ if (skill) {
1203
+ const line = input.trim();
1204
+ void sendTurn(skillInvocationMessage(skill, line.slice(command.length).trim()), false, line);
1205
+ return;
1206
+ }
1207
+ }
1186
1208
  addNotice('error', `Unknown command "${command}". Type /help for commands.`);
1209
+ }
1187
1210
  }
1188
1211
  }, [
1189
1212
  addNotice,
@@ -1350,7 +1373,7 @@ export function App({ config, baseConfig, overrides, configPath, configCreated,
1350
1373
  const viewportHeight = Math.max(3, rows - 5 - (pendingApproval ? 12 : 0) - (pickerInline ? PICKER_INLINE_ROWS : 0));
1351
1374
  const showUsageCard = usageCardEnabled && shouldShowUsageCard(columns, viewportHeight);
1352
1375
  const chatWidth = showUsageCard ? Math.max(40, width - USAGE_CARD_WIDTH - USAGE_CARD_GAP) : width;
1353
- return (_jsxs(Box, { flexDirection: "column", width: columns, paddingX: 1, children: [_jsxs(Box, { flexDirection: "row", alignItems: "flex-end", width: width, children: [_jsx(MessageList, { items: items, width: chatWidth, height: viewportHeight, resetSignal: resetSignal, expandedToolId: expandedToolId, palette: palette, interactive: !pendingApproval && !pickerOpen && !wizardActive && wizardPrompt === null }), showUsageCard ? (_jsx(Box, { marginLeft: USAGE_CARD_GAP, flexShrink: 0, children: _jsx(UsageCard, { usage: sessionUsage, contextTokens: contextTokens, contextWindow: contextWindow, contextEstimated: usageRef.current === null, lastReply: lastReply, busy: busy }) })) : null] }), pendingApproval ? (_jsx(ApprovalPrompt, { request: pendingApproval, width: width, onDecision: resolveApproval })) : pickerInline ? (_jsx(ModelPicker, { config: runtimeConfig, activeProfile: profileName, width: width, onSelect: (name, model) => void selectModel(name, model), onRefresh: refreshProfileModels, onCancel: () => setPickerOpen(false) })) : (_jsx(Input, { disabled: pickerOpen, width: width, mask: wizardPrompt?.mask, allowEmpty: wizardPrompt?.allowEmpty, history: wizardPrompt || wizardActive ? undefined : promptHistory, onPaletteChange: setPalette, placeholder: pickerOpen
1376
+ return (_jsxs(Box, { flexDirection: "column", width: columns, paddingX: 1, children: [_jsxs(Box, { flexDirection: "row", alignItems: "flex-end", width: width, children: [_jsx(MessageList, { items: items, width: chatWidth, height: viewportHeight, resetSignal: resetSignal, expandedToolId: expandedToolId, palette: palette, interactive: !pendingApproval && !pickerOpen && !wizardActive && wizardPrompt === null }), showUsageCard ? (_jsx(Box, { marginLeft: USAGE_CARD_GAP, flexShrink: 0, children: _jsx(UsageCard, { usage: sessionUsage, contextTokens: contextTokens, contextWindow: contextWindow, contextEstimated: usageRef.current === null, lastReply: lastReply, busy: busy }) })) : null] }), pendingApproval ? (_jsx(ApprovalPrompt, { request: pendingApproval, width: width, onDecision: resolveApproval })) : pickerInline ? (_jsx(ModelPicker, { config: runtimeConfig, activeProfile: profileName, width: width, onSelect: (name, model) => void selectModel(name, model), onRefresh: refreshProfileModels, onCancel: () => setPickerOpen(false) })) : (_jsx(Input, { disabled: pickerOpen, width: width, mask: wizardPrompt?.mask, allowEmpty: wizardPrompt?.allowEmpty, history: wizardPrompt || wizardActive ? undefined : promptHistory, slashCommands: [...SLASH_COMMANDS, ...skillCommands], onPaletteChange: setPalette, placeholder: pickerOpen
1354
1377
  ? 'Model picker open · Esc to close'
1355
1378
  : wizardPrompt
1356
1379
  ? wizardPrompt.defaultValue && !wizardPrompt.mask
package/dist/ui/Input.js CHANGED
@@ -7,7 +7,7 @@ import { isMouseSequence } from './mouse.js';
7
7
  import { applyInputOps, parseEditSequence, parseInputChunk, } from './text.js';
8
8
  const MAX_INPUT_CHARS = 20_000;
9
9
  const MAX_MENU_ROWS = 6;
10
- export function Input({ disabled, placeholder, width, mask = false, allowEmpty = false, slashMenu = true, history, onSubmit, onCancel, onPaletteChange, }) {
10
+ export function Input({ disabled, placeholder, width, mask = false, allowEmpty = false, slashMenu = true, slashCommands, history, onSubmit, onCancel, onPaletteChange, }) {
11
11
  const { stdin } = useStdin();
12
12
  const [state, setState] = useState({ chars: [], cursor: 0 });
13
13
  const [selected, setSelected] = useState(0);
@@ -22,7 +22,7 @@ export function Input({ disabled, placeholder, width, mask = false, allowEmpty =
22
22
  setHistoryIndex(null);
23
23
  }
24
24
  }, [historyIndex, recalled, text]);
25
- const matches = slashMenu && !mask && !disabled ? filterSlashCommands(text) : [];
25
+ const matches = slashMenu && !mask && !disabled ? filterSlashCommands(text, slashCommands) : [];
26
26
  const menuOpen = matches.length > 0;
27
27
  const activeIndex = Math.min(selected, Math.max(0, matches.length - 1));
28
28
  const menuStart = Math.max(0, Math.min(activeIndex - Math.floor(MAX_MENU_ROWS / 2), matches.length - MAX_MENU_ROWS));
@@ -22,8 +22,8 @@ export function UsageCard({ usage, contextTokens, contextWindow, contextEstimate
22
22
  const accent = busy ? 'cyan' : 'gray';
23
23
  const innerWidth = Math.max(8, width - 4);
24
24
  const title = truncateToWidth(`Usage · ${usage.requests} req`, innerWidth);
25
- const prompt = usage.requests > 0 ? formatTokens(usage.promptTokens) : '—';
26
- const completion = usage.requests > 0 ? formatTokens(usage.completionTokens) : '—';
25
+ const prompt = usage.requests > 0 ? formatTokens(usage.promptTokens) : '-';
26
+ const completion = usage.requests > 0 ? formatTokens(usage.completionTokens) : '-';
27
27
  const bar = contextBar(contextTokens, contextWindow, Math.max(4, innerWidth - 9));
28
28
  const contextLine = truncateToWidth(`ctx ${bar} ${formatPercent(contextTokens, contextWindow).padStart(4)}`, innerWidth);
29
29
  const windowLine = truncateToWidth(`${contextEstimated ? '~' : ''}${formatTokens(contextTokens)} / ${formatTokens(contextWindow)} window`, innerWidth);
@@ -2,7 +2,7 @@ export const SLASH_COMMANDS = [
2
2
  { name: '/help', description: 'show this help' },
3
3
  { name: '/model', usage: '[name | add | edit | remove | test | list]', description: 'list or switch models' },
4
4
  { name: '/skills', description: 'list installed skills and where they were found' },
5
- { name: '/skill', usage: '<name>', description: 'load a skill and apply it to your next request' },
5
+ { name: '/skill', usage: '<name> [request]', description: 'load a skill and apply it to your next request' },
6
6
  { name: '/context', description: 'show approximate context usage' },
7
7
  { name: '/usage', description: 'show or hide the usage card' },
8
8
  { name: '/compact', description: 'summarize older turns to free context' },
@@ -15,20 +15,48 @@ export const SLASH_COMMANDS = [
15
15
  { name: '/allow', usage: '[clear]', description: 'manage tools that skip approval' },
16
16
  { name: '/exit', description: 'quit Kiro' },
17
17
  ];
18
+ /** A skill called `/model` would be unreachable, so built-in names are claimed. */
19
+ export function builtinCommandNames() {
20
+ return SLASH_COMMANDS.map((command) => command.name.slice(1).toLowerCase());
21
+ }
22
+ function shorten(text, max) {
23
+ return text.length > max ? `${text.slice(0, max - 1)}…` : text;
24
+ }
25
+ /** Skills become slash commands: `/anti-slop rewrite this`. Built-ins win a clash. */
26
+ export function buildSkillCommands(skills, reserved = builtinCommandNames()) {
27
+ const taken = new Set(reserved);
28
+ const seen = new Set();
29
+ const commands = [];
30
+ for (const skill of skills) {
31
+ const key = skill.name.toLowerCase();
32
+ if (taken.has(key) || seen.has(key))
33
+ continue;
34
+ seen.add(key);
35
+ commands.push({ name: `/${skill.name}`, description: `skill · ${shorten(skill.description, 60)}` });
36
+ }
37
+ return commands;
38
+ }
18
39
  /** Matches only while the user is still typing the command name, before any space. */
19
- export function filterSlashCommands(query) {
40
+ export function filterSlashCommands(query, commands = SLASH_COMMANDS) {
20
41
  const text = query.trimStart();
21
42
  if (!text.startsWith('/') || /\s/.test(text))
22
43
  return [];
23
44
  const needle = text.toLowerCase();
24
- return SLASH_COMMANDS.filter((command) => command.name.startsWith(needle));
45
+ return commands.filter((command) => command.name.toLowerCase().startsWith(needle));
25
46
  }
26
47
  export function slashCommandLabel(command) {
27
48
  return command.usage ? `${command.name} ${command.usage}` : command.name;
28
49
  }
29
- export function slashHelpLines() {
50
+ export function slashHelpLines(skillCount = 0) {
30
51
  const labels = SLASH_COMMANDS.map((command) => ` ${slashCommandLabel(command)}`);
52
+ if (skillCount > 0) {
53
+ labels.push(` /<skill> [request]`);
54
+ }
31
55
  const width = Math.max(...labels.map((label) => label.length)) + 2;
32
- return SLASH_COMMANDS.map((command, index) => `${labels[index].padEnd(width)}${command.description}`);
56
+ const lines = SLASH_COMMANDS.map((command, index) => `${labels[index].padEnd(width)}${command.description}`);
57
+ if (skillCount > 0) {
58
+ lines.push(`${labels[labels.length - 1].padEnd(width)}run one of your ${skillCount} installed skill${skillCount === 1 ? '' : 's'}`);
59
+ }
60
+ return lines;
33
61
  }
34
62
  //# sourceMappingURL=commands.js.map
package/dist/ui/mouse.js CHANGED
@@ -3,7 +3,7 @@ export const MOUSE_SCROLL_LINES = 3;
3
3
  /**
4
4
  * Enables button/wheel reporting with SGR coordinates; paired with MOUSE_OFF.
5
5
  * xterm has no wheel-only mode, so turning this on also hands clicks to Kiro
6
- * instead of starting a text selection — copy/paste then needs Shift+drag.
6
+ * instead of starting a text selection, so copy/paste needs Shift+drag.
7
7
  */
8
8
  export const MOUSE_ON = '\x1b[?1000h\x1b[?1006h';
9
9
  export const MOUSE_OFF = '\x1b[?1006l\x1b[?1000l';
package/dist/update.js CHANGED
@@ -47,25 +47,25 @@ async function latestVersion() {
47
47
  }
48
48
  return latest;
49
49
  }
50
- /** `kiro check` — compare the installed version with the registry. Exit 0 current, 1 update available, 2 check failed. */
50
+ /** `kiro check`: compare the installed version with the registry. Exit 0 current, 1 update available, 2 check failed. */
51
51
  export async function runCheck() {
52
52
  let latest;
53
53
  try {
54
54
  latest = await latestVersion();
55
55
  }
56
56
  catch (error) {
57
- console.error(`Kiro ${VERSION} — version check failed: ${error.message}`);
57
+ console.error(`Kiro ${VERSION}: version check failed: ${error.message}`);
58
58
  console.error('Check manually with: npm view @ywldan/kiro version');
59
59
  return 2;
60
60
  }
61
61
  if (compareVersions(VERSION, latest) >= 0) {
62
- process.stdout.write(`Kiro ${VERSION} — up to date\n`);
62
+ process.stdout.write(`Kiro ${VERSION}: up to date\n`);
63
63
  return 0;
64
64
  }
65
65
  process.stdout.write(`Kiro ${VERSION} → ${latest} available. Run "kiro update" to upgrade.\n`);
66
66
  return 1;
67
67
  }
68
- /** `kiro update` — install the latest published version globally through npm. */
68
+ /** `kiro update`: install the latest published version globally through npm. */
69
69
  export async function runUpdate() {
70
70
  let latest;
71
71
  try {
@@ -75,7 +75,7 @@ export async function runUpdate() {
75
75
  latest = 'latest';
76
76
  }
77
77
  if (latest !== 'latest' && compareVersions(VERSION, latest) >= 0) {
78
- process.stdout.write(`Kiro ${VERSION} — already up to date, nothing to do\n`);
78
+ process.stdout.write(`Kiro ${VERSION}: already up to date, nothing to do\n`);
79
79
  return 0;
80
80
  }
81
81
  process.stdout.write(`Updating Kiro ${VERSION} → ${latest} via npm…\n`);
package/dist/version.js CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = '0.2.10';
1
+ export const VERSION = '0.2.12';
2
2
  //# sourceMappingURL=version.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ywldan/kiro",
3
- "version": "0.2.10",
3
+ "version": "0.2.12",
4
4
  "description": "A small terminal coding agent with your own OpenAI-compatible endpoint",
5
5
  "keywords": [
6
6
  "ai",