@knightcodeai/cli-linux-x64 0.9.1 → 0.9.3
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/bin/CHANGELOG.md +60 -0
- package/bin/README.md +52 -19
- package/bin/docs/cli-integration.md +106 -0
- package/bin/docs/cli.md +270 -0
- package/bin/docs/compaction.md +56 -37
- package/bin/docs/configuration.md +46 -0
- package/bin/docs/containerization.md +86 -54
- package/bin/docs/custom-provider.md +132 -785
- package/bin/docs/docs.json +143 -103
- package/bin/docs/environment-variables.md +5 -4
- package/bin/docs/extensions.md +134 -2956
- package/bin/docs/how-knightcode-works.md +49 -0
- package/bin/docs/index.md +24 -69
- package/bin/docs/json.md +193 -65
- package/bin/docs/keybindings.md +56 -101
- package/bin/docs/llama-cpp.md +3 -3
- package/bin/docs/message-types.md +261 -0
- package/bin/docs/models.md +64 -547
- package/bin/docs/packages.md +66 -167
- package/bin/docs/prompt-templates.md +31 -68
- package/bin/docs/providers.md +103 -241
- package/bin/docs/quickstart.md +61 -106
- package/bin/docs/rpc-commands.md +854 -0
- package/bin/docs/rpc-extension-ui.md +200 -0
- package/bin/docs/rpc.md +129 -1556
- package/bin/docs/sdk.md +76 -1160
- package/bin/docs/security.md +70 -32
- package/bin/docs/session-format.md +25 -216
- package/bin/docs/sessions.md +38 -143
- package/bin/docs/settings.md +111 -389
- package/bin/docs/shell-aliases.md +85 -5
- package/bin/docs/skills.md +51 -189
- package/bin/docs/slash-commands.md +63 -0
- package/bin/docs/terminal-setup.md +107 -79
- package/bin/docs/termux.md +74 -83
- package/bin/docs/themes.md +68 -280
- package/bin/docs/tmux.md +31 -39
- package/bin/docs/tui.md +69 -923
- package/bin/docs/usage.md +79 -286
- package/bin/docs/windows.md +43 -17
- package/bin/export-html/template.js +6 -1
- package/bin/knightcode +2 -2
- package/bin/package.json +6 -6
- package/package.json +1 -1
- package/bin/docs/development.md +0 -71
package/bin/docs/settings.md
CHANGED
|
@@ -1,432 +1,154 @@
|
|
|
1
|
-
# Settings
|
|
1
|
+
# Settings Reference
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
This reference lists user-configurable settings, their types, defaults, and purposes. Project settings override agent-directory settings. Resource lists are combined. See [Configuration](configuration.md) for file locations and trust behavior.
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|----------|-------|
|
|
7
|
-
| `~/.knightcode/agent/settings.json` | Global (all projects) |
|
|
8
|
-
| `.knightcode/settings.json` | Project (current directory) |
|
|
5
|
+
## Model and thinking
|
|
9
6
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
## Project Trust
|
|
13
|
-
|
|
14
|
-
On interactive startup, knightcode asks before trusting a project folder that contains project-local settings, resources, or project `.agents/skills` and has no saved decision for the folder or a parent folder in `~/.knightcode/agent/trust.json`. Trusting a project allows knightcode to load `.knightcode/settings.json` and `.knightcode` resources, install missing project packages, and execute project extensions.
|
|
15
|
-
|
|
16
|
-
Non-interactive modes (`-p`, `--mode json`, and `--mode rpc`) do not show a trust prompt. Without an applicable saved trust decision, they use `defaultProjectTrust` from global settings: `ask` (default) and `never` ignore those project resources, while `always` trusts them. Pass `--approve`/`-a` or `--no-approve`/`-na` to override project trust for one run.
|
|
17
|
-
|
|
18
|
-
If no extension or saved decision applies, `defaultProjectTrust` controls the fallback behavior. Set it to `"ask"`, `"always"`, or `"never"` in `~/.knightcode/agent/settings.json`, or change it with `/settings`.
|
|
19
|
-
|
|
20
|
-
`knightcode config` and package commands use the same project trust flow, except `knightcode update` never prompts. Pass `--approve` to trust project-local settings for one command or `--no-approve` to ignore them.
|
|
21
|
-
|
|
22
|
-
Use `/trust` in interactive mode to save a project trust decision for future sessions, including trust for the immediate parent folder. It writes `~/.knightcode/agent/trust.json` only; the current session is not reloaded, so restart knightcode for changes to take effect.
|
|
23
|
-
|
|
24
|
-
## All Settings
|
|
25
|
-
|
|
26
|
-
### Model & Thinking
|
|
7
|
+
<a id="model-cycling"></a>
|
|
27
8
|
|
|
28
9
|
| Setting | Type | Default | Description |
|
|
29
|
-
|
|
30
|
-
| `defaultProvider` | string |
|
|
31
|
-
| `defaultModel` | string |
|
|
32
|
-
| `defaultThinkingLevel` |
|
|
33
|
-
| `modelThinkingLevels` | object |
|
|
34
|
-
| `
|
|
35
|
-
| `
|
|
36
|
-
| `
|
|
37
|
-
| `
|
|
38
|
-
|
|
39
|
-
#### Cache Warming
|
|
40
|
-
|
|
41
|
-
Providers drop a prompt cache entry after a period of inactivity, so the first request after a pause pays full input price again. Cache warming re-sends the last request with a one-token output budget shortly before expiry:
|
|
42
|
-
|
|
43
|
-
- `"off"` disables warming.
|
|
44
|
-
- `"streaming"` protects expensive prefixes during long tool executions and stops as soon as the agent settles.
|
|
45
|
-
- `"idle"` also considers refreshes while waiting for your next prompt, using a fixed 15% continuation probability measured from real usage.
|
|
10
|
+
|---|---|---|---|
|
|
11
|
+
| `defaultProvider` | string | Automatic | Startup AI provider. Saved by `Ctrl+S` in `/model` and by the IDE's model picker. |
|
|
12
|
+
| `defaultModel` | string | Automatic | Startup model ID. Saved by `Ctrl+S` in `/model` and by the IDE's model picker. |
|
|
13
|
+
| `defaultThinkingLevel` | `"off" \| "minimal" \| "low" \| "medium" \| "high" \| "xhigh" \| "max"` | `"medium"` | Startup thinking level. |
|
|
14
|
+
| `modelThinkingLevels` | object | None | Per-model startup thinking levels keyed by exact `provider/modelId`. |
|
|
15
|
+
| `thinkingBudgets` | object | Built-in budgets | Token budgets for `minimal`, `low`, `medium`, and `high` thinking levels. |
|
|
16
|
+
| `enabledModels` | `string[]` | All available models | Model patterns used for startup selection and model cycling. Uses the same format as `--models`. |
|
|
17
|
+
| `hideThinkingBlock` | boolean | `false` | Hide thinking blocks in the transcript. |
|
|
18
|
+
| `showCacheMissNotices` | boolean | `false` | Show notices for significant cache misses, successful cache warming, compaction usage, and provider recovery. |
|
|
19
|
+
| `cacheWarming` | `"off" \| "streaming" \| "idle"` | `"streaming"` | Keep eligible provider prompt caches warm during active runs or, with `"idle"`, between runs. Global setting only. |
|
|
46
20
|
|
|
47
|
-
|
|
48
|
-
{
|
|
49
|
-
"cacheWarming": "idle"
|
|
50
|
-
}
|
|
51
|
-
```
|
|
21
|
+
Cache warming runs only when the model declares a cache lifetime and KnightCode estimates at least $0.05 in avoided cache-miss cost. Refresh usage counts toward session totals but does not enter model context. `/session` shows the next decision; extensions can override it with `cache_warming_decision`. See [Prompt Cache Lifetimes](models.md#prompt-cache-lifetimes).
|
|
52
22
|
|
|
53
|
-
|
|
23
|
+
See [Choose a Model](models.md) for model selection and thinking controls.
|
|
54
24
|
|
|
55
|
-
|
|
25
|
+
## Interaction
|
|
56
26
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
"thinkingBudgets": {
|
|
66
|
-
"minimal": 1024,
|
|
67
|
-
"low": 4096,
|
|
68
|
-
"medium": 10240,
|
|
69
|
-
"high": 32768
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
```
|
|
27
|
+
| Setting | Type | Default | Description |
|
|
28
|
+
|---|---|---|---|
|
|
29
|
+
| `steeringMode` | `"all" \| "one-at-a-time"` | `"one-at-a-time"` | How queued steering messages are delivered. |
|
|
30
|
+
| `followUpMode` | `"all" \| "one-at-a-time"` | `"one-at-a-time"` | How queued follow-up messages are delivered. |
|
|
31
|
+
| `externalEditor` | string | `$VISUAL`, `$EDITOR`, then platform default | Command opened by the external-editor keybinding. |
|
|
32
|
+
| `doubleEscapeAction` | `"tree" \| "fork" \| "none"` | `"tree"` | Action for double Escape with an empty editor. `/undo` is the quick way to a user message. |
|
|
33
|
+
| `treeFilterMode` | `"default" \| "no-tools" \| "user-only" \| "labeled-only" \| "all"` | `"default"` | Initial filter used by `/tree`. |
|
|
34
|
+
| `defaultProjectTrust` | `"ask" \| "always" \| "never"` | `"ask"` | Fallback project-trust behavior. **Can only be set in agent-directory settings.** |
|
|
73
35
|
|
|
74
|
-
|
|
36
|
+
## Tools
|
|
75
37
|
|
|
76
38
|
| Setting | Type | Default | Description |
|
|
77
|
-
|
|
78
|
-
| `
|
|
79
|
-
| `externalEditor` | string | `$VISUAL`, then `$EDITOR`, then Notepad on Windows or `nano` elsewhere | Command for Ctrl+G external editor; takes precedence over environment variables |
|
|
80
|
-
| `quietStartup` | boolean | `false` | Hide startup header |
|
|
81
|
-
| `defaultProjectTrust` | string | `"ask"` | Fallback project trust behavior: `"ask"`, `"always"`, or `"never"`. Global setting only |
|
|
82
|
-
| `collapseChangelog` | boolean | `false` | Show condensed changelog after updates |
|
|
83
|
-
| `enableInstallTelemetry` | boolean | `true` | Send the anonymous install/update ping and selected provider attribution headers. This does not control update checks |
|
|
84
|
-
| `enableAnalytics` | boolean | `false` | Opt-in analytics data sharing. Currently only asked for during the experimental first-time setup (`KNIGHTCODE_EXPERIMENTAL=1`) |
|
|
85
|
-
| `trackingId` | string | - | Analytics tracking identifier, generated when `enableAnalytics` is turned on |
|
|
86
|
-
| `doubleEscapeAction` | string | `"tree"` | Action for double-escape: `"tree"`, `"fork"`, or `"none"`. `/undo` is the quick way to a user message |
|
|
87
|
-
| `treeFilterMode` | string | `"default"` | Default filter for `/tree`: `"default"`, `"no-tools"`, `"user-only"`, `"labeled-only"`, `"all"` |
|
|
88
|
-
| `editorPaddingX` | number | `0` | Horizontal padding for input editor (0-3) |
|
|
89
|
-
| `outputPad` | number | `1` | Horizontal padding for user messages, assistant messages, and thinking (0 or 1) |
|
|
90
|
-
| `autocompleteMaxVisible` | number | `5` | Max visible items in autocomplete dropdown (3-20) |
|
|
91
|
-
| `showHardwareCursor` | boolean | `false` | Show the terminal cursor while TUI positions it for IME support |
|
|
92
|
-
| `tuiMode` | string | `"regular"` | Interactive TUI mode: `"regular"` or experimental `"fullscreen"`. Fullscreen captures the mouse and owns text selection, so dragging copies to the clipboard; regular leaves selection and copying to the terminal emulator (see [Text selection and copy](terminal-setup.md#text-selection-and-copy)). Changes from `/settings` apply immediately; `--tui-mode` overrides this setting at startup |
|
|
93
|
-
| `fullscreenExitOutput` | string | `"transcript"` | Fullscreen exit output: `"transcript"` prints the final transcript and resume hint, while `"resume-hint"` restores the previous screen and prints only the resume hint. Has no effect in regular TUI mode |
|
|
94
|
-
| `fullscreenScrollbar` | string | `"auto"` | Fullscreen transcript scrollbar: `"auto"` shows it temporarily while scrolling or while the pointer is over its rightmost-column track, `"always"` reserves that column and keeps it visible, and `"hidden"` hides it. Has no effect in regular TUI mode |
|
|
95
|
-
| `fullscreenCopyOnSelect` | boolean | `true` | Automatically copy selected text in fullscreen mode. When disabled, selections stay highlighted and `Ctrl+X` copies the active selection. Has no effect in regular TUI mode |
|
|
96
|
-
|
|
97
|
-
For VS Code, include `--wait` so knightcode resumes after the editor exits:
|
|
98
|
-
|
|
99
|
-
```json
|
|
100
|
-
{
|
|
101
|
-
"externalEditor": "code --wait"
|
|
102
|
-
}
|
|
103
|
-
```
|
|
104
|
-
|
|
105
|
-
### Telemetry and update checks
|
|
106
|
-
|
|
107
|
-
`enableInstallTelemetry` controls the anonymous install/update ping to `https://knightcode.dev/api/report-install` and KnightCode attribution headers for OpenRouter, NVIDIA NIM, and Cloudflare provider requests. Opting out disables both. It does not disable update checks; KnightCode can still fetch `https://knightcode.dev/api/latest-version` to look for the latest version.
|
|
108
|
-
|
|
109
|
-
The KnightCode IDE shares this setting rather than keeping its own. Its first run and its settings write `enableInstallTelemetry` here, except while `KNIGHTCODE_TELEMETRY` is set, because the variable outranks the setting. The engine the IDE starts sends the same ping once per IDE version, with a `knightcode-ide` user agent, and records the version it was delivered for as `lastIdeVersion`. A ping that fails is retried on the next start.
|
|
110
|
-
|
|
111
|
-
Set `KNIGHTCODE_SKIP_VERSION_CHECK=1` to disable the KnightCode version update check. Use `--offline` or `KNIGHTCODE_OFFLINE=1` to disable all startup network operations described here, including update checks, package update checks, and install/update telemetry.
|
|
112
|
-
|
|
113
|
-
### Network
|
|
39
|
+
|---|---|---|---|
|
|
40
|
+
| `defaultTools` | `string[]` | `read`, `bash`, `edit`, `write` | Built-in tools enabled at startup. An empty array disables all built-in tools but not extension or SDK tools. |
|
|
114
41
|
|
|
115
|
-
|
|
116
|
-
|---------|------|---------|-------------|
|
|
117
|
-
| `httpProxy` | string | - | HTTP proxy URL applied as `HTTP_PROXY` and `HTTPS_PROXY`. Global setting only. |
|
|
42
|
+
Available built-in tools are `read`, `bash`, `powershell`, `edit`, `write`, `grep`, `find`, and `ls`. CLI tool options override this setting for one invocation. See [Command Line](cli.md#tools).
|
|
118
43
|
|
|
119
|
-
|
|
120
|
-
{
|
|
121
|
-
"httpProxy": "http://127.0.0.1:7890"
|
|
122
|
-
}
|
|
123
|
-
```
|
|
44
|
+
The [web tools](usage.md#web-tools) `webfetch` and `websearch` are not part of `defaultTools`. `/tools` turns them on and stores their settings, including the search provider and Brave key, in `~/.knightcode/agent/tools.json`.
|
|
124
45
|
|
|
125
|
-
|
|
46
|
+
## Sessions and context
|
|
126
47
|
|
|
127
48
|
| Setting | Type | Default | Description |
|
|
128
|
-
|
|
129
|
-
| `
|
|
130
|
-
|
|
131
|
-
```json
|
|
132
|
-
{
|
|
133
|
-
"warnings": {
|
|
134
|
-
"anthropicExtraUsage": false
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
```
|
|
49
|
+
|---|---|---|---|
|
|
50
|
+
| `sessionDir` | string | Agent session directory | Session storage directory. Relative paths resolve from the working directory. `KNIGHTCODE_CODING_AGENT_SESSION_DIR` and `--session-dir` override this setting. |
|
|
138
51
|
|
|
139
52
|
### Compaction
|
|
140
53
|
|
|
141
54
|
| Setting | Type | Default | Description |
|
|
142
|
-
|
|
143
|
-
| `compaction.enabled` | boolean | `true` | Enable
|
|
144
|
-
| `compaction.reserveTokens` | number | `16384` | Tokens reserved for
|
|
145
|
-
| `compaction.keepRecentTokens` | number | `20000` | Recent tokens
|
|
146
|
-
| `compaction.modelOverrides` | object |
|
|
147
|
-
|
|
148
|
-
```json
|
|
149
|
-
{
|
|
150
|
-
"compaction": {
|
|
151
|
-
"enabled": true,
|
|
152
|
-
"reserveTokens": 16384,
|
|
153
|
-
"keepRecentTokens": 20000
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
```
|
|
157
|
-
|
|
158
|
-
#### Per-model compaction overrides
|
|
159
|
-
|
|
160
|
-
```json
|
|
161
|
-
{
|
|
162
|
-
"compaction": {
|
|
163
|
-
"enabled": true,
|
|
164
|
-
"reserveTokens": 16384,
|
|
165
|
-
"keepRecentTokens": 20000,
|
|
166
|
-
"modelOverrides": {
|
|
167
|
-
"some-provider/big-model": {
|
|
168
|
-
"reserveTokens": 400000
|
|
169
|
-
},
|
|
170
|
-
"local/small-model": {
|
|
171
|
-
"reserveTokens": 2048,
|
|
172
|
-
"keepRecentTokens": 4096
|
|
173
|
-
}
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
}
|
|
177
|
-
```
|
|
178
|
-
|
|
179
|
-
Keys match exact, case-sensitive `provider/modelId` values, not names or glob patterns. Model IDs may contain slashes (for example, `openrouter/anthropic/claude-sonnet-4`).
|
|
180
|
-
|
|
181
|
-
Each token setting resolves independently: matching model override → ordinary `compaction` setting → built-in default. In the example, `some-provider/big-model` keeps the ordinary 20000 recent tokens. Token values must be non-negative safe integers. Invalid values in the matching model override produce an error when read; only omitted fields fall back to the ordinary setting. Model override entries must be objects. Invalid ordinary token settings produce an error when read, even if the active model has a valid override. Only omitted ordinary values use built-in defaults. Zero is accepted, but `reserveTokens: 0` leaves no response margin and also sets the summarization output budget to zero.
|
|
182
|
-
|
|
183
|
-
Global and project settings merge recursively **before** model lookup. A project can override one field for a model without replacing its other fields or other models. A global model-specific value takes precedence over a project-wide fallback; override the same model entry in the project to change it.
|
|
184
|
-
|
|
185
|
-
`enabled` is not model-specific. The active model's token settings apply to manual compaction, automatic threshold checks (including between assistant turns), and overflow recovery. Switching models takes effect on the next check or compaction. Configure overrides in JSON; `/settings` retains the ordinary auto-compaction toggle.
|
|
186
|
-
|
|
187
|
-
See [compaction.md](compaction.md) for trigger and summarization behavior.
|
|
188
|
-
|
|
189
|
-
### Branch Summary
|
|
55
|
+
|---|---|---|---|
|
|
56
|
+
| `compaction.enabled` | boolean | `true` | Enable automatic compaction. |
|
|
57
|
+
| `compaction.reserveTokens` | number | `16384` | Tokens reserved for the model response. |
|
|
58
|
+
| `compaction.keepRecentTokens` | number | `20000` | Recent tokens retained without summarization. |
|
|
59
|
+
| `compaction.modelOverrides` | object | None | Per-model token settings keyed by exact `provider/modelId`. |
|
|
190
60
|
|
|
191
|
-
|
|
192
|
-
|---------|------|---------|-------------|
|
|
193
|
-
| `branchSummary.reserveTokens` | number | `16384` | Tokens reserved when selecting branch history; output is capped at 4096 tokens |
|
|
194
|
-
| `branchSummary.skipPrompt` | boolean | `false` | Skip "Summarize branch?" prompt on `/tree` navigation (defaults to no summary) |
|
|
61
|
+
<a id="per-model-compaction-overrides"></a>
|
|
195
62
|
|
|
196
|
-
|
|
63
|
+
Compaction token values must be non-negative safe integers. Each value resolves independently from the matching model override, then the ordinary compaction setting, then the built-in default. Project and user objects merge before model lookup.
|
|
197
64
|
|
|
198
|
-
|
|
199
|
-
|---------|------|---------|-------------|
|
|
200
|
-
| `retry.enabled` | boolean | `true` | Enable automatic agent-level retry on transient errors |
|
|
201
|
-
| `retry.maxRetries` | number | `3` | Maximum agent-level retry attempts |
|
|
202
|
-
| `retry.baseDelayMs` | number | `2000` | Base delay for agent-level exponential backoff (2s, 4s, 8s) |
|
|
203
|
-
| `retry.maxAgentDelayMs` | number | `60000` | Max agent-level retry delay (60s) |
|
|
204
|
-
| `retry.provider.timeoutMs` | number | SDK default | Provider/SDK request timeout in milliseconds |
|
|
205
|
-
| `retry.provider.maxRetries` | number | `0` | Provider/SDK retry attempts |
|
|
206
|
-
| `retry.provider.maxRetryDelayMs` | number | `60000` | Max server-requested delay before failing (60s) |
|
|
207
|
-
|
|
208
|
-
Agent-level retries use exponential backoff capped by `retry.maxAgentDelayMs`, so long retry runs stay responsive after prolonged outages.
|
|
209
|
-
|
|
210
|
-
When a provider requests a retry delay longer than `retry.provider.maxRetryDelayMs`, the request fails immediately with an informative error instead of waiting silently. Set it to `0` to disable the limit.
|
|
211
|
-
|
|
212
|
-
Keep `retry.provider.maxRetries` at `0` unless provider-level retries are explicitly needed. Setting it above `0` can make SDK/provider retries handle out-of-usage-limit errors before KnightCode sees them, which may block the agent until the provider quota resets in some circumstances.
|
|
213
|
-
|
|
214
|
-
```json
|
|
215
|
-
{
|
|
216
|
-
"retry": {
|
|
217
|
-
"enabled": true,
|
|
218
|
-
"maxRetries": 3,
|
|
219
|
-
"baseDelayMs": 2000,
|
|
220
|
-
"maxAgentDelayMs": 60000,
|
|
221
|
-
"provider": {
|
|
222
|
-
"timeoutMs": 3600000,
|
|
223
|
-
"maxRetries": 0,
|
|
224
|
-
"maxRetryDelayMs": 60000
|
|
225
|
-
}
|
|
226
|
-
}
|
|
227
|
-
}
|
|
228
|
-
```
|
|
229
|
-
|
|
230
|
-
### Message Delivery
|
|
65
|
+
See [Compaction Reference](compaction.md) for trigger, summarization, and validation behavior.
|
|
231
66
|
|
|
232
|
-
|
|
233
|
-
|---------|------|---------|-------------|
|
|
234
|
-
| `steeringMode` | string | `"one-at-a-time"` | How steering messages are sent: `"all"` or `"one-at-a-time"` |
|
|
235
|
-
| `followUpMode` | string | `"one-at-a-time"` | How follow-up messages are sent: `"all"` or `"one-at-a-time"` |
|
|
236
|
-
| `transport` | string | `"auto"` | Preferred transport for providers that support multiple transports: `"sse"`, `"websocket"`, `"websocket-cached"`, or `"auto"` |
|
|
237
|
-
| `httpIdleTimeoutMs` | number | `300000` | HTTP header/body idle timeout in milliseconds, also used by providers with explicit stream idle timeouts. Set to `0` to disable. |
|
|
238
|
-
| `websocketConnectTimeoutMs` | number | `15000` | WebSocket connect/open handshake timeout in milliseconds for providers that support WebSocket transports. Set to `0` to disable. |
|
|
239
|
-
|
|
240
|
-
### Terminal & Images
|
|
241
|
-
|
|
242
|
-
| Setting | Type | Default | Description |
|
|
243
|
-
|---------|------|---------|-------------|
|
|
244
|
-
| `terminal.showImages` | boolean | `true` | Show images in terminal (if supported) |
|
|
245
|
-
| `terminal.imageWidthCells` | number | `60` | Preferred inline image width in terminal cells |
|
|
246
|
-
| `terminal.clearOnShrink` | boolean | `false` | Clear empty rows when content shrinks (can cause flicker) |
|
|
247
|
-
| `terminal.hyperlinks` | boolean or `"auto"` | `"auto"` | Override OSC 8 hyperlink support (advanced, JSON-only) |
|
|
248
|
-
| `terminal.images` | string or boolean | `"auto"` | Override image protocol support with `"kitty"`, `"iterm2"`, `false`, or `"auto"` (advanced, JSON-only) |
|
|
249
|
-
| `terminal.trueColor` | boolean or `"auto"` | `"auto"` | Override truecolor support (advanced, JSON-only) |
|
|
250
|
-
| `images.autoResize` | boolean | `true` | Resize images to 2000x2000 max. Applies to `@file` attachments, `read`, and images returned by tools |
|
|
251
|
-
| `images.blockImages` | boolean | `false` | Block all images from being sent to LLM |
|
|
252
|
-
|
|
253
|
-
### Shell
|
|
67
|
+
### Branch summaries
|
|
254
68
|
|
|
255
69
|
| Setting | Type | Default | Description |
|
|
256
|
-
|
|
257
|
-
| `
|
|
258
|
-
| `
|
|
259
|
-
| `npmCommand` | string[] | - | Command argv used for npm package lookup/install operations (e.g., `["mise", "exec", "node@20", "--", "npm"]`) |
|
|
260
|
-
|
|
261
|
-
Windows paths in JSON must use forward slashes or escaped backslashes:
|
|
262
|
-
|
|
263
|
-
```json
|
|
264
|
-
{
|
|
265
|
-
"shellPath": "C:/Program Files/Git/bin/bash.exe"
|
|
266
|
-
}
|
|
267
|
-
```
|
|
70
|
+
|---|---|---|---|
|
|
71
|
+
| `branchSummary.reserveTokens` | number | `16384` | Tokens reserved when summarizing branch history. |
|
|
72
|
+
| `branchSummary.skipPrompt` | boolean | `false` | Skip the branch-summary prompt and default to no summary. |
|
|
268
73
|
|
|
269
|
-
|
|
270
|
-
{
|
|
271
|
-
"shellPath": "C:\\Program Files\\Git\\bin\\bash.exe"
|
|
272
|
-
}
|
|
273
|
-
```
|
|
274
|
-
|
|
275
|
-
```json
|
|
276
|
-
{
|
|
277
|
-
"npmCommand": ["mise", "exec", "node@20", "--", "npm"]
|
|
278
|
-
}
|
|
279
|
-
```
|
|
280
|
-
|
|
281
|
-
`npmCommand` is used for all npm package-manager operations, including installs, uninstalls, and dependency installs inside git packages. User-scoped npm packages install under `~/.knightcode/agent/npm/`; project-scoped npm packages install under `.knightcode/npm/`. Use argv-style entries exactly as the process should be launched. When `npmCommand` is configured, git package dependency installs use plain `install` to avoid npm-specific flags in wrappers or alternate package managers.
|
|
282
|
-
|
|
283
|
-
### Tools
|
|
74
|
+
## Terminal and display
|
|
284
75
|
|
|
285
76
|
| Setting | Type | Default | Description |
|
|
286
|
-
|
|
287
|
-
| `
|
|
288
|
-
|
|
289
|
-
`
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
77
|
+
|---|---|---|---|
|
|
78
|
+
| `theme` | string | Detected | Built-in or custom theme name. |
|
|
79
|
+
| `quietStartup` | boolean | `false` | Hide the startup header. |
|
|
80
|
+
| `tuiMode` | `"regular" \| "fullscreen"` | `"regular"` | Interactive terminal UI mode. Fullscreen captures the mouse and owns text selection, so dragging copies to the clipboard; regular leaves selection and copying to the terminal emulator (see [Text selection and copy](terminal-setup.md#text-selection-and-copy)). |
|
|
81
|
+
| `fullscreenExitOutput` | `"transcript" \| "resume-hint"` | `"transcript"` | Output printed when fullscreen mode exits. |
|
|
82
|
+
| `fullscreenScrollbar` | `"auto" \| "always" \| "hidden"` | `"auto"` | Fullscreen transcript scrollbar behavior. |
|
|
83
|
+
| `fullscreenCopyOnSelect` | boolean | `true` | Copy selected text automatically in fullscreen mode. When disabled, selections stay highlighted and `Ctrl+X` copies the active selection. Has no effect in regular mode. |
|
|
84
|
+
| `editorPaddingX` | number | `0` | Horizontal editor padding from 0 to 3 cells. |
|
|
85
|
+
| `outputPad` | `0 \| 1` | `1` | Horizontal transcript padding. |
|
|
86
|
+
| `autocompleteMaxVisible` | number | `5` | Visible autocomplete entries, from 3 to 20. |
|
|
87
|
+
| `showHardwareCursor` | boolean | `false` | Show the terminal cursor while KnightCode positions it for input methods. |
|
|
88
|
+
| `terminal.showImages` | boolean | `true` | Display inline images when supported. |
|
|
89
|
+
| `terminal.imageWidthCells` | number | `60` | Preferred inline image width in terminal cells. |
|
|
90
|
+
| `terminal.clearOnShrink` | boolean | `false` | Clear empty rows when rendered content shrinks. |
|
|
91
|
+
| `terminal.showTerminalProgress` | boolean | `false` | Show OSC 9;4 progress in the terminal tab. |
|
|
92
|
+
| `terminal.hyperlinks` | `boolean \| "auto"` | `"auto"` | Override OSC 8 hyperlink detection. |
|
|
93
|
+
| `terminal.images` | `"kitty" \| "iterm2" \| "auto" \| false` | `"auto"` | Override inline-image protocol detection. |
|
|
94
|
+
| `terminal.trueColor` | `boolean \| "auto"` | `"auto"` | Override true-color detection. |
|
|
95
|
+
| `images.autoResize` | boolean | `true` | Resize images to at most 2000 by 2000 pixels before sending them to a model. |
|
|
96
|
+
| `images.blockImages` | boolean | `false` | Prevent images from being sent to models. |
|
|
97
|
+
| `markdown.codeBlockIndent` | string | `" "` | Prefix used to indent rendered code blocks. |
|
|
98
|
+
| `markdown.mermaid` | `"off" \| "final" \| "streaming"` | `"streaming"` | Mermaid rendering mode. |
|
|
99
|
+
|
|
100
|
+
See [Themes](themes.md) and [Terminal Setup](terminal-setup.md) for format and platform details.
|
|
101
|
+
|
|
102
|
+
## Network and retries
|
|
296
103
|
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
104
|
+
| Setting | Type | Default | Description |
|
|
105
|
+
|---|---|---|---|
|
|
106
|
+
| `transport` | `"auto" \| "sse" \| "websocket" \| "websocket-cached"` | `"auto"` | Preferred transport for AI providers that support multiple transports. |
|
|
107
|
+
| `httpProxy` | string | None | Proxy URL applied as `HTTP_PROXY` and `HTTPS_PROXY` for KnightCode-managed HTTP clients. **Can only be set in agent-directory settings.** |
|
|
108
|
+
| `httpIdleTimeoutMs` | number | `300000` | HTTP header and body idle timeout in milliseconds. Set to `0` to disable. |
|
|
109
|
+
| `websocketConnectTimeoutMs` | number | `15000` | WebSocket connection timeout in milliseconds. Set to `0` to disable. |
|
|
110
|
+
| `retry.enabled` | boolean | `true` | Enable automatic agent-level retry for transient failures. |
|
|
111
|
+
| `retry.maxRetries` | number | `3` | Maximum agent-level retry attempts. |
|
|
112
|
+
| `retry.baseDelayMs` | number | `2000` | Initial exponential-backoff delay in milliseconds. |
|
|
113
|
+
| `retry.maxAgentDelayMs` | number | `60000` | Maximum agent-level retry delay in milliseconds. |
|
|
114
|
+
| `retry.provider.timeoutMs` | number | `httpIdleTimeoutMs` | Provider request timeout in milliseconds. |
|
|
115
|
+
| `retry.provider.maxRetries` | number | `0` | Provider-level retry attempts. |
|
|
116
|
+
| `retry.provider.maxRetryDelayMs` | number | `60000` | Maximum server-requested delay in milliseconds. Set to `0` to disable the limit. |
|
|
117
|
+
|
|
118
|
+
Keep `retry.provider.maxRetries` at `0` unless provider-level retries are required. Provider retries can delay KnightCode from handling quota and usage-limit errors itself.
|
|
119
|
+
|
|
120
|
+
## Shell
|
|
310
121
|
|
|
311
122
|
| Setting | Type | Default | Description |
|
|
312
|
-
|
|
313
|
-
| `
|
|
123
|
+
|---|---|---|---|
|
|
124
|
+
| `shellPath` | string | Platform default | Custom shell executable path. Supports a leading `~`. |
|
|
125
|
+
| `shellCommandPrefix` | string | None | Prefix prepended to every shell command. |
|
|
126
|
+
| `npmCommand` | `string[]` | `npm` | Command and arguments used for npm package lookup and installation. |
|
|
314
127
|
|
|
315
|
-
|
|
316
|
-
{ "sessionDir": ".knightcode/sessions" }
|
|
317
|
-
```
|
|
128
|
+
See [Shell aliases](shell-aliases.md) for shell setup and [KnightCode Packages](packages.md) for package-manager behavior.
|
|
318
129
|
|
|
319
|
-
|
|
130
|
+
## Resources
|
|
320
131
|
|
|
321
|
-
|
|
132
|
+
Resource paths in user settings resolve from the agent directory. Paths in project settings resolve from the project `.knightcode` directory. Absolute paths and `~` are supported.
|
|
322
133
|
|
|
323
134
|
| Setting | Type | Default | Description |
|
|
324
|
-
|
|
325
|
-
| `
|
|
135
|
+
|---|---|---|---|
|
|
136
|
+
| `packages` | array | `[]` | npm, git, or local KnightCode package sources. See [KnightCode Packages](packages.md). |
|
|
137
|
+
| `extensions` | `string[]` | `[]` | Extension files or directories. |
|
|
138
|
+
| `skills` | `string[]` | `[]` | Skill files or directories. |
|
|
139
|
+
| `prompts` | `string[]` | `[]` | Prompt-template files or directories. |
|
|
140
|
+
| `themes` | `string[]` | `[]` | Theme files or directories. |
|
|
141
|
+
| `enableSkillCommands` | boolean | `true` | Register skills as `/skill:name` commands. |
|
|
326
142
|
|
|
327
|
-
|
|
328
|
-
{
|
|
329
|
-
"enabledModels": ["claude-*", "gpt-4o", "gemini-2*"]
|
|
330
|
-
}
|
|
331
|
-
```
|
|
143
|
+
Resource arrays support glob exclusions with `!pattern`, exact inclusion with `+path`, and exact exclusion with `-path`. KnightCode loads resources listed in both user-level and project settings.
|
|
332
144
|
|
|
333
|
-
|
|
145
|
+
## Updates, telemetry, and warnings
|
|
334
146
|
|
|
335
147
|
| Setting | Type | Default | Description |
|
|
336
|
-
|
|
337
|
-
| `
|
|
338
|
-
| `
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
These settings define where to load extensions, skills, prompts, and themes from.
|
|
148
|
+
|---|---|---|---|
|
|
149
|
+
| `collapseChangelog` | boolean | `false` | Show a condensed changelog after an update. |
|
|
150
|
+
| `enableInstallTelemetry` | boolean | `true` | Enable anonymous install/update reporting and selected provider attribution headers. Does not control update checks. |
|
|
151
|
+
| `enableAnalytics` | boolean | `false` | Opt in to analytics data sharing. Currently used only by the experimental first-run setup. |
|
|
152
|
+
| `warnings.anthropicExtraUsage` | boolean | `true` | Warn when Anthropic subscription authentication may use paid extra usage. |
|
|
343
153
|
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
| Setting | Type | Default | Description |
|
|
347
|
-
|---------|------|---------|-------------|
|
|
348
|
-
| `packages` | array | `[]` | npm/git packages to load resources from |
|
|
349
|
-
| `extensions` | string[] | `[]` | Local extension file paths or directories |
|
|
350
|
-
| `skills` | string[] | `[]` | Local skill file paths or directories |
|
|
351
|
-
| `prompts` | string[] | `[]` | Local prompt template paths or directories |
|
|
352
|
-
| `themes` | string[] | `[]` | Local theme file paths or directories |
|
|
353
|
-
| `enableSkillCommands` | boolean | `true` | Register skills as `/skill:name` commands |
|
|
354
|
-
|
|
355
|
-
Arrays support glob patterns and exclusions. Use `!pattern` to exclude. Use `+path` to force-include an exact path and `-path` to force-exclude an exact path.
|
|
356
|
-
|
|
357
|
-
#### packages
|
|
358
|
-
|
|
359
|
-
String form loads all resources from a package:
|
|
360
|
-
|
|
361
|
-
```json
|
|
362
|
-
{
|
|
363
|
-
"packages": ["knightcode-skills", "@org/my-extension"]
|
|
364
|
-
}
|
|
365
|
-
```
|
|
366
|
-
|
|
367
|
-
Object form filters which resources to load:
|
|
368
|
-
|
|
369
|
-
```json
|
|
370
|
-
{
|
|
371
|
-
"packages": [
|
|
372
|
-
{
|
|
373
|
-
"source": "knightcode-skills",
|
|
374
|
-
"skills": ["brave-search", "transcribe"],
|
|
375
|
-
"extensions": []
|
|
376
|
-
}
|
|
377
|
-
]
|
|
378
|
-
}
|
|
379
|
-
```
|
|
380
|
-
|
|
381
|
-
See [packages.md](packages.md) for package management details.
|
|
382
|
-
|
|
383
|
-
## Example
|
|
384
|
-
|
|
385
|
-
```json
|
|
386
|
-
{
|
|
387
|
-
"defaultProvider": "anthropic",
|
|
388
|
-
"defaultModel": "claude-sonnet-4-20250514",
|
|
389
|
-
"defaultThinkingLevel": "medium",
|
|
390
|
-
"modelThinkingLevels": {
|
|
391
|
-
"anthropic/claude-sonnet-4-20250514": "high"
|
|
392
|
-
},
|
|
393
|
-
"theme": "dark",
|
|
394
|
-
"compaction": {
|
|
395
|
-
"enabled": true,
|
|
396
|
-
"reserveTokens": 16384,
|
|
397
|
-
"keepRecentTokens": 20000
|
|
398
|
-
},
|
|
399
|
-
"retry": {
|
|
400
|
-
"enabled": true,
|
|
401
|
-
"maxRetries": 3
|
|
402
|
-
},
|
|
403
|
-
"enabledModels": ["claude-*", "gpt-4o"],
|
|
404
|
-
"warnings": {
|
|
405
|
-
"anthropicExtraUsage": true
|
|
406
|
-
},
|
|
407
|
-
"packages": ["knightcode-skills"]
|
|
408
|
-
}
|
|
409
|
-
```
|
|
410
|
-
|
|
411
|
-
## Project Overrides
|
|
412
|
-
|
|
413
|
-
Project settings (`.knightcode/settings.json`) override global settings. Nested objects are merged:
|
|
414
|
-
|
|
415
|
-
```json
|
|
416
|
-
// ~/.knightcode/agent/settings.json (global)
|
|
417
|
-
{
|
|
418
|
-
"theme": "dark",
|
|
419
|
-
"compaction": { "enabled": true, "reserveTokens": 16384 }
|
|
420
|
-
}
|
|
421
|
-
|
|
422
|
-
// .knightcode/settings.json (project)
|
|
423
|
-
{
|
|
424
|
-
"compaction": { "reserveTokens": 8192 }
|
|
425
|
-
}
|
|
426
|
-
|
|
427
|
-
// Result
|
|
428
|
-
{
|
|
429
|
-
"theme": "dark",
|
|
430
|
-
"compaction": { "enabled": true, "reserveTokens": 8192 }
|
|
431
|
-
}
|
|
432
|
-
```
|
|
154
|
+
The KnightCode IDE shares `enableInstallTelemetry` rather than keeping its own. Its first run and its settings write `enableInstallTelemetry` here, except while `KNIGHTCODE_TELEMETRY` is set, because the variable outranks the setting. The engine the IDE starts sends the same ping once per IDE version, with a `knightcode-ide` user agent, and records the version it was delivered for as `lastIdeVersion`. A ping that fails is retried on the next start.
|