@tyvm/knowhow 0.0.109 → 0.0.110
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/autodoc/README.md +324 -0
- package/autodoc/chat-guide.md +268 -365
- package/autodoc/cli-reference.md +399 -473
- package/autodoc/config-reference.md +431 -330
- package/autodoc/embeddings-guide.md +223 -322
- package/autodoc/generate-guide.md +261 -301
- package/autodoc/language-plugin-guide.md +221 -247
- package/autodoc/modules-guide.md +242 -215
- package/autodoc/plugins-guide.md +470 -469
- package/autodoc/quickstart-guide.md +67 -70
- package/autodoc/skills-guide.md +455 -339
- package/autodoc/worker-guide.md +301 -308
- package/package.json +1 -1
- package/scripts/build-for-node.sh +10 -24
- package/src/agents/tools/list.ts +2 -2
- package/src/ai.ts +81 -37
- package/src/chat/CliChatService.ts +1 -1
- package/src/chat/modules/AgentModule.ts +7 -2
- package/src/chat/modules/SessionsModule.ts +40 -1
- package/src/chat/modules/SystemModule.ts +2 -2
- package/src/clients/anthropic.ts +1 -1
- package/src/clients/index.ts +25 -6
- package/src/clients/openai.ts +8 -5
- package/src/clients/types.ts +29 -6
- package/src/clients/withRetry.ts +89 -0
- package/src/commands/agent.ts +30 -0
- package/src/commands/modules.ts +417 -47
- package/src/config.ts +1 -1
- package/src/fileSync.ts +20 -12
- package/src/hashes.ts +43 -22
- package/src/index.ts +4 -2
- package/src/processors/Base64ImageDetector.ts +73 -0
- package/src/services/MediaProcessorService.ts +79 -10
- package/src/services/modules/index.ts +47 -18
- package/tests/processors/Base64ImageDetector.test.ts +160 -0
- package/tests/unit/clients/AIClient.test.ts +446 -0
- package/tests/unit/clients/withRetry.test.ts +319 -0
- package/tests/unit/commands/github-credentials.test.ts +1 -2
- package/ts_build/package.json +1 -1
- package/ts_build/src/agents/tools/list.js +2 -2
- package/ts_build/src/agents/tools/list.js.map +1 -1
- package/ts_build/src/ai.d.ts +3 -3
- package/ts_build/src/ai.js +51 -23
- package/ts_build/src/ai.js.map +1 -1
- package/ts_build/src/chat/CliChatService.js +1 -1
- package/ts_build/src/chat/CliChatService.js.map +1 -1
- package/ts_build/src/chat/modules/AgentModule.js +5 -2
- package/ts_build/src/chat/modules/AgentModule.js.map +1 -1
- package/ts_build/src/chat/modules/SessionsModule.js +30 -1
- package/ts_build/src/chat/modules/SessionsModule.js.map +1 -1
- package/ts_build/src/chat/modules/SystemModule.js +2 -2
- package/ts_build/src/chat/modules/SystemModule.js.map +1 -1
- package/ts_build/src/clients/anthropic.js +1 -1
- package/ts_build/src/clients/anthropic.js.map +1 -1
- package/ts_build/src/clients/index.js +7 -6
- package/ts_build/src/clients/index.js.map +1 -1
- package/ts_build/src/clients/openai.js +4 -4
- package/ts_build/src/clients/openai.js.map +1 -1
- package/ts_build/src/clients/types.d.ts +12 -6
- package/ts_build/src/clients/withRetry.d.ts +2 -0
- package/ts_build/src/clients/withRetry.js +60 -0
- package/ts_build/src/clients/withRetry.js.map +1 -0
- package/ts_build/src/commands/agent.js +25 -0
- package/ts_build/src/commands/agent.js.map +1 -1
- package/ts_build/src/commands/modules.js +359 -32
- package/ts_build/src/commands/modules.js.map +1 -1
- package/ts_build/src/config.js +1 -1
- package/ts_build/src/config.js.map +1 -1
- package/ts_build/src/fileSync.d.ts +2 -2
- package/ts_build/src/fileSync.js +13 -11
- package/ts_build/src/fileSync.js.map +1 -1
- package/ts_build/src/hashes.d.ts +2 -2
- package/ts_build/src/hashes.js +40 -16
- package/ts_build/src/hashes.js.map +1 -1
- package/ts_build/src/index.js +1 -1
- package/ts_build/src/index.js.map +1 -1
- package/ts_build/src/processors/Base64ImageDetector.d.ts +3 -0
- package/ts_build/src/processors/Base64ImageDetector.js +42 -0
- package/ts_build/src/processors/Base64ImageDetector.js.map +1 -1
- package/ts_build/src/services/MediaProcessorService.d.ts +5 -4
- package/ts_build/src/services/MediaProcessorService.js +53 -8
- package/ts_build/src/services/MediaProcessorService.js.map +1 -1
- package/ts_build/src/services/modules/index.js +35 -12
- package/ts_build/src/services/modules/index.js.map +1 -1
- package/ts_build/tests/processors/Base64ImageDetector.test.js +111 -0
- package/ts_build/tests/processors/Base64ImageDetector.test.js.map +1 -1
- package/ts_build/tests/unit/clients/AIClient.test.d.ts +1 -0
- package/ts_build/tests/unit/clients/AIClient.test.js +339 -0
- package/ts_build/tests/unit/clients/AIClient.test.js.map +1 -0
- package/ts_build/tests/unit/clients/withRetry.test.d.ts +1 -0
- package/ts_build/tests/unit/clients/withRetry.test.js +225 -0
- package/ts_build/tests/unit/clients/withRetry.test.js.map +1 -0
- package/ts_build/tests/unit/commands/github-credentials.test.js +1 -2
- package/ts_build/tests/unit/commands/github-credentials.test.js.map +1 -1
package/autodoc/chat-guide.md
CHANGED
|
@@ -1,540 +1,443 @@
|
|
|
1
1
|
# `knowhow chat` Guide
|
|
2
2
|
|
|
3
|
-
`knowhow chat` is the primary interactive
|
|
4
|
-
|
|
5
|
-
At startup, Knowhow typically prints a list of available commands based on:
|
|
6
|
-
- enabled chat modules (agent/search/sessions/shell/voice/etc.)
|
|
7
|
-
- your configuration (`knowhow.json`)
|
|
8
|
-
- the current chat mode (agent vs attached vs voice)
|
|
9
|
-
|
|
10
|
-
> **Tip:** Always look at the startup line like `Commands: /agent, /agents, ...` to confirm what your build exposes.
|
|
3
|
+
`knowhow chat` is the primary interactive terminal experience for Knowhow. You’ll start a chat loop, then use built-in slash commands (`/…`) to control agents, sessions, rendering, input modes, and more.
|
|
11
4
|
|
|
12
5
|
---
|
|
13
6
|
|
|
14
|
-
## 1)
|
|
7
|
+
## 1) Start a chat session
|
|
15
8
|
|
|
16
|
-
Start chat
|
|
9
|
+
Start Knowhow’s interactive chat:
|
|
17
10
|
|
|
18
11
|
```bash
|
|
19
12
|
knowhow chat
|
|
20
13
|
```
|
|
21
14
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
### Common CLI flags (version/build-dependent)
|
|
25
|
-
Your exact flags depend on the CLI build. Check:
|
|
26
|
-
|
|
27
|
-
```bash
|
|
28
|
-
knowhow chat --help
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
Common patterns you may see include:
|
|
32
|
-
- selecting a starting **agent**
|
|
33
|
-
- selecting a **renderer**
|
|
34
|
-
- enabling **voice**
|
|
35
|
-
- attaching/resuming a prior session/task (if your build supports it)
|
|
15
|
+
After starting, Knowhow will show the available commands for the current mode.
|
|
36
16
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
knowhow chat --
|
|
41
|
-
|
|
42
|
-
```
|
|
17
|
+
> Tip: While chatting, you can usually discover functionality from `/` commands (documented below). If you’re ever unsure, run:
|
|
18
|
+
>
|
|
19
|
+
> ```bash
|
|
20
|
+
> knowhow chat --help
|
|
21
|
+
> ```
|
|
43
22
|
|
|
44
23
|
---
|
|
45
24
|
|
|
46
|
-
## 2) Chat modes (
|
|
47
|
-
|
|
48
|
-
Knowhow changes behavior based on mode. Mode determines:
|
|
49
|
-
- how inputs are interpreted
|
|
50
|
-
- which slash commands are enabled
|
|
51
|
-
- whether you’re controlling a running task (attached) vs just chatting
|
|
25
|
+
## 2) Chat modes (what changes with `/...`)
|
|
52
26
|
|
|
53
|
-
|
|
54
|
-
You’re using a configured agent to respond.
|
|
27
|
+
Knowhow’s CLI chat behavior changes based on active modes.
|
|
55
28
|
|
|
56
|
-
|
|
29
|
+
### Default (normal) chat
|
|
30
|
+
- You send plain text (no leading `/`) and Knowhow responds as a standard assistant.
|
|
31
|
+
- Agent mode is **off** until you enable it with `/agent`.
|
|
57
32
|
|
|
58
|
-
###
|
|
59
|
-
|
|
33
|
+
### Agent mode: `/agent` (agent interaction mode)
|
|
34
|
+
When you enable agent mode:
|
|
35
|
+
- Your prompt becomes: `Ask knowhow <AgentName>:`
|
|
36
|
+
- Your input becomes an initial task for that agent.
|
|
37
|
+
- The agent streams events into the active renderer.
|
|
60
38
|
|
|
61
|
-
|
|
62
|
-
|
|
39
|
+
Command:
|
|
40
|
+
- `/agent <agent_name>`
|
|
63
41
|
|
|
64
|
-
|
|
42
|
+
### Agent attached mode: `/attach` (agent:attached)
|
|
43
|
+
When you attach to a running task/session:
|
|
44
|
+
- You’re “attached” to a specific agent task that’s already running.
|
|
45
|
+
- Mode switches to `agent:attached`, unlocking attached-mode commands like:
|
|
46
|
+
- `/logs`, `/pause`, `/unpause`, `/kill`, `/detach`, `/done`
|
|
65
47
|
|
|
66
|
-
|
|
48
|
+
Commands:
|
|
49
|
+
- `/attach <taskId>`
|
|
50
|
+
- `/resume <taskId>` (for completed/saved sessions)
|
|
67
51
|
|
|
68
|
-
|
|
69
|
-
|
|
52
|
+
### Voice mode: `/voice`
|
|
53
|
+
When voice mode is enabled:
|
|
54
|
+
- Input comes from `voiceToText()` instead of the normal text prompt.
|
|
55
|
+
- Mode affects how the CLI collects your next user input.
|
|
70
56
|
|
|
71
|
-
|
|
72
|
-
-
|
|
73
|
-
**Example**
|
|
74
|
-
```text
|
|
75
|
-
/agent Patcher
|
|
76
|
-
```
|
|
57
|
+
Command:
|
|
58
|
+
- `/voice`
|
|
77
59
|
|
|
78
|
-
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
```
|
|
60
|
+
### Multi-line mode: `/multi`
|
|
61
|
+
When multi-line mode is enabled:
|
|
62
|
+
- Input is collected using a text editor UI (via Inquirer’s editor).
|
|
63
|
+
- After submitting, multiline mode is reset.
|
|
83
64
|
|
|
84
|
-
|
|
65
|
+
Command:
|
|
66
|
+
- `/multi`
|
|
85
67
|
|
|
86
|
-
|
|
87
|
-
These commands are typically only enabled when you are attached to a running agent task:
|
|
68
|
+
---
|
|
88
69
|
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
70
|
+
## 3) Built-in slash commands (`/`)
|
|
71
|
+
|
|
72
|
+
The following commands are available from the CLI modules shown in the code. (Additional commands may exist in other modules or via custom command modules/plugins.)
|
|
73
|
+
|
|
74
|
+
### Agent controls
|
|
75
|
+
| Command | Description | Mode |
|
|
76
|
+
|---|---|---|
|
|
77
|
+
| `/agent <agent_name>` | Enable agent mode and select an agent | default / non-agent |
|
|
78
|
+
| `/agents` | List available agents, then optionally select one | default / non-agent |
|
|
79
|
+
| `/pause` | Pause the attached agent | `agent:attached` |
|
|
80
|
+
| `/unpause` | Unpause the attached agent | `agent:attached` |
|
|
81
|
+
| `/kill` | Terminate the attached agent | `agent:attached` |
|
|
82
|
+
| `/detach` | Detach from the attached agent task (leaves agent running) | `agent:attached` |
|
|
83
|
+
| `/done` | Exit the current agent interaction (detaches) | `agent:attached` |
|
|
84
|
+
|
|
85
|
+
### Session / attachment management
|
|
86
|
+
| Command | Description | Mode |
|
|
87
|
+
|---|---|---|
|
|
88
|
+
| `/attach [taskId]` | Attach to a running session/task | any (but useful in agent workflows) |
|
|
89
|
+
| `/resume [taskId]` | Resume a completed/saved session | any |
|
|
90
|
+
| `/sessions` | List sessions (running + optionally completed) | any |
|
|
91
|
+
| `/logs [N]` | Show the last N messages from the attached agent (default `N=20`) | `agent:attached` |
|
|
92
|
+
|
|
93
|
+
Important flags for these commands:
|
|
94
|
+
- `/attach --completed` : show saved/completed sessions in addition to running ones
|
|
95
|
+
- `/sessions --completed` or `/sessions --all`
|
|
96
|
+
- `/sessions --csv` : output sessions as CSV
|
|
97
|
+
|
|
98
|
+
### Shell execution (command helpers)
|
|
99
|
+
| Command | Description | Mode |
|
|
100
|
+
|---|---|---|
|
|
101
|
+
| `/! <command>` | Execute a shell command (interactive: inherits stdio) | `agent` / `agent:attached` |
|
|
102
|
+
| `/!! <command>` | Execute a shell command, then send its output to the AI | `agent` / `agent:attached` |
|
|
103
|
+
|
|
104
|
+
### Renderer switching
|
|
105
|
+
| Command | Description | Mode |
|
|
106
|
+
|---|---|---|
|
|
107
|
+
| `/render [specifier]` | Switch output renderer, or show current renderer + built-ins | any |
|
|
108
|
+
|
|
109
|
+
Built-in renderers:
|
|
110
|
+
- `basic`
|
|
111
|
+
- `compact`
|
|
112
|
+
- `fancy`
|
|
113
|
+
|
|
114
|
+
Also supports:
|
|
115
|
+
- a filesystem path (e.g. `./my-renderer.js`)
|
|
116
|
+
- a package name (e.g. `@my-org/knowhow-renderer`)
|
|
117
|
+
|
|
118
|
+
### Input / chat behavior
|
|
119
|
+
| Command | Description | Mode |
|
|
120
|
+
|---|---|---|
|
|
121
|
+
| `/multi` | Toggle multiline input mode | any |
|
|
122
|
+
| `/voice` | Toggle voice input mode | any |
|
|
123
|
+
| `/exit` | Exit the chat process | any |
|
|
124
|
+
|
|
125
|
+
### Model / provider / debug / history
|
|
126
|
+
| Command | Description | Mode |
|
|
127
|
+
|---|---|---|
|
|
128
|
+
| `/model` | Select a model for the active context (and update active agent prefs) | any |
|
|
129
|
+
| `/provider` | Select a provider (and update active agent prefs) | any |
|
|
130
|
+
| `/debug` | Toggle debug mode | any |
|
|
131
|
+
| `/clear` | Clear chat history (AI will not remember previous messages) | any |
|
|
94
132
|
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
/detach
|
|
100
|
-
/done
|
|
101
|
-
```
|
|
133
|
+
### Search
|
|
134
|
+
| Command | Description | Mode |
|
|
135
|
+
|---|---|---|
|
|
136
|
+
| `/search` | Search embeddings interactively | any |
|
|
102
137
|
|
|
103
|
-
|
|
104
|
-
-
|
|
138
|
+
Inside embedding search, it uses non-slash commands:
|
|
139
|
+
- `next`, `exit`, `embeddings`, `use`
|
|
105
140
|
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
/multi
|
|
109
|
-
Write a runbook for:
|
|
110
|
-
1) Setup
|
|
111
|
-
2) Daily use
|
|
112
|
-
3) Troubleshooting
|
|
141
|
+
### Notes about other commands
|
|
142
|
+
Some commands referenced in fuzzy-match logic (like `help`) may exist in modules not included in the provided code excerpts. If your build includes more modules, run `knowhow chat` and look at the “Commands:” line that appears at startup and updates per mode.
|
|
113
143
|
|
|
114
|
-
|
|
115
|
-
```
|
|
144
|
+
---
|
|
116
145
|
|
|
117
|
-
|
|
118
|
-
- **`/render`** — show current renderer / help for renderer switching
|
|
119
|
-
- **`/render <basic|compact|fancy>`** — switch built-in renderer
|
|
146
|
+
## 4) Switching agents (`/agent` and `/agents`)
|
|
120
147
|
|
|
121
|
-
|
|
148
|
+
### List agents
|
|
122
149
|
```text
|
|
123
|
-
/
|
|
124
|
-
/render compact
|
|
125
|
-
/render fancy
|
|
150
|
+
/agents
|
|
126
151
|
```
|
|
127
152
|
|
|
128
|
-
|
|
129
|
-
Depending on build support, `/render` may also load a renderer from:
|
|
130
|
-
- a path
|
|
131
|
-
- an npm package specifier
|
|
153
|
+
Knowhow prints available agent names, then prompts:
|
|
132
154
|
|
|
133
|
-
**Examples**
|
|
134
155
|
```text
|
|
135
|
-
|
|
136
|
-
/render @my-org/knowhow-renderer
|
|
156
|
+
Select an agent to start:
|
|
137
157
|
```
|
|
138
158
|
|
|
139
|
-
###
|
|
140
|
-
- **`/search`** — enter the interactive search loop (Search module)
|
|
141
|
-
|
|
142
|
-
**Example**
|
|
159
|
+
### Start a specific agent
|
|
143
160
|
```text
|
|
144
|
-
/
|
|
161
|
+
/agent Researcher
|
|
145
162
|
```
|
|
146
163
|
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
-
|
|
151
|
-
- **`exit`** — leave search mode
|
|
152
|
-
- **`embeddings`** — list available embedding scopes
|
|
153
|
-
- **`use`** — choose which embedding scope(s) to search
|
|
154
|
-
|
|
155
|
-
Any other input is treated as a new search query.
|
|
164
|
+
When successful:
|
|
165
|
+
- agent mode is enabled
|
|
166
|
+
- your prompt changes to `Ask knowhow Researcher:`
|
|
167
|
+
- the agent begins a task when you type input (non-command text)
|
|
156
168
|
|
|
157
|
-
|
|
169
|
+
### Example: switch agents in one session
|
|
158
170
|
```text
|
|
159
|
-
/
|
|
160
|
-
|
|
171
|
+
> /agents
|
|
172
|
+
Available agents:
|
|
173
|
+
- Patcher
|
|
174
|
+
- Researcher
|
|
175
|
+
- DevOpsBot
|
|
176
|
+
────────────────────────────────────────────────
|
|
161
177
|
|
|
162
|
-
|
|
163
|
-
...match content...
|
|
178
|
+
Select an agent to start: Researcher
|
|
164
179
|
|
|
165
|
-
|
|
166
|
-
{ "source": "...", "chunk": 12 }
|
|
180
|
+
Agent mode enabled. Selected agent: Researcher. Type your task to get started.
|
|
167
181
|
|
|
168
|
-
|
|
169
|
-
### TEXT
|
|
170
|
-
...next match...
|
|
171
|
-
|
|
172
|
-
searching: use
|
|
173
|
-
Embedding to search: snippets
|
|
174
|
-
searching: "how to configure agents"
|
|
175
|
-
(search results...)
|
|
176
|
-
searching: exit
|
|
182
|
+
Ask knowhow Researcher: Summarize the latest changes in X.
|
|
177
183
|
```
|
|
178
184
|
|
|
179
|
-
|
|
180
|
-
|
|
185
|
+
To switch again:
|
|
186
|
+
- start another agent with `/agent <name>` (or disable agent mode by `/agent` with no args—see next tip)
|
|
181
187
|
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
- With `<taskId>`, attaches directly.
|
|
185
|
-
- `--completed` may include completed items in the chooser; completed items are routed to **`/resume`**.
|
|
188
|
+
### Disable agent mode
|
|
189
|
+
In `AgentModule.handleAgentCommand`, `/agent` with **no arguments** toggles agent mode off (only if agent mode is already active):
|
|
186
190
|
|
|
187
|
-
**Examples**
|
|
188
191
|
```text
|
|
189
|
-
/
|
|
190
|
-
/attach 8d9f1c2b-3a4e-...
|
|
191
|
-
/attach --completed
|
|
192
|
+
/agent
|
|
192
193
|
```
|
|
193
194
|
|
|
194
|
-
|
|
195
|
-
- With **no args**, opens an interactive list of saved/completed sessions to resume.
|
|
196
|
-
- With `<taskId>`, resumes that session.
|
|
197
|
-
- When resuming, Knowhow can prompt you to add additional context.
|
|
198
|
-
|
|
199
|
-
**Examples**
|
|
200
|
-
```text
|
|
201
|
-
/resume
|
|
202
|
-
/resume 8d9f1c2b-3a4e-...
|
|
203
|
-
```
|
|
204
|
-
|
|
205
|
-
- **`/sessions [--all] [--completed] [--csv]`**
|
|
206
|
-
Lists sessions/tasks so you can choose to attach or resume.
|
|
207
|
-
|
|
208
|
-
- `--completed` includes completed sessions
|
|
209
|
-
- `--all` includes more history/scope (implementation-defined)
|
|
210
|
-
- `--csv` outputs table data in CSV format
|
|
211
|
-
|
|
212
|
-
**Examples**
|
|
213
|
-
```text
|
|
214
|
-
/sessions
|
|
215
|
-
/sessions --completed
|
|
216
|
-
/sessions --completed --csv
|
|
217
|
-
```
|
|
218
|
-
|
|
219
|
-
- **`/logs [N]`**
|
|
220
|
-
Shows the last **N** messages from the **currently attached** agent (default `N=20`).
|
|
221
|
-
Typically restricted to **attached mode**.
|
|
222
|
-
|
|
223
|
-
**Examples**
|
|
224
|
-
```text
|
|
225
|
-
/logs
|
|
226
|
-
/logs 50
|
|
227
|
-
```
|
|
228
|
-
|
|
229
|
-
> **Note on “save/load”:** the Sessions module primarily exposes **attach** (running tasks) and **resume** (completed/saved tasks). If your build includes explicit `save/load` subcommands under `/sessions`, they will appear in your runtime `Commands:` list or via `/sessions` help.
|
|
230
|
-
|
|
231
|
-
### Shell commands
|
|
232
|
-
These are provided by the shell module and work in agent/attached modes where enabled.
|
|
233
|
-
|
|
234
|
-
- **`/! [command]`** — run shell commands interactively (module behavior may vary)
|
|
235
|
-
- **`/!! <command>`** — run a shell command, capture output, and send it to the AI for analysis
|
|
195
|
+
---
|
|
236
196
|
|
|
237
|
-
|
|
238
|
-
```text
|
|
239
|
-
/!
|
|
240
|
-
# (interactive shell mode, if your build uses it)
|
|
197
|
+
## 5) Multi-line input (`/multi`)
|
|
241
198
|
|
|
242
|
-
|
|
243
|
-
/!! cat ./build.log | tail -n 200
|
|
244
|
-
```
|
|
199
|
+
Toggle multi-line mode:
|
|
245
200
|
|
|
246
|
-
**Typical workflow**
|
|
247
201
|
```text
|
|
248
|
-
|
|
249
|
-
npm test
|
|
250
|
-
/!!
|
|
251
|
-
npm test
|
|
252
|
-
# then ask the AI to explain failures based on captured output
|
|
202
|
+
/multi
|
|
253
203
|
```
|
|
254
204
|
|
|
255
|
-
|
|
256
|
-
If your build includes voice support, the Voice module typically exposes a command like:
|
|
205
|
+
Then enter a task in a multi-line editor UI.
|
|
257
206
|
|
|
258
|
-
|
|
207
|
+
After you submit the edited content:
|
|
208
|
+
- the CLI disables multiline mode automatically (`multilineMode = false` after use)
|
|
259
209
|
|
|
260
|
-
|
|
210
|
+
Example workflow:
|
|
261
211
|
```text
|
|
262
|
-
/
|
|
263
|
-
|
|
212
|
+
> /multi
|
|
213
|
+
Multiline mode: enabled
|
|
264
214
|
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
215
|
+
> (editor opens)
|
|
216
|
+
Write a detailed plan for migrating service A to service B:
|
|
217
|
+
- include risks
|
|
218
|
+
- include rollback steps
|
|
219
|
+
- include timeline
|
|
268
220
|
```
|
|
269
221
|
|
|
270
222
|
---
|
|
271
223
|
|
|
272
|
-
##
|
|
224
|
+
## 6) Shell commands (`/!` and `/!!`)
|
|
273
225
|
|
|
274
|
-
|
|
275
|
-
```text
|
|
276
|
-
/agents
|
|
277
|
-
```
|
|
226
|
+
These commands exist specifically to help you run local shell work while an agent is active.
|
|
278
227
|
|
|
279
|
-
###
|
|
280
|
-
|
|
281
|
-
/agent <AgentName>
|
|
282
|
-
```
|
|
228
|
+
### `/!` — interactive execution
|
|
229
|
+
Runs a shell command and uses inherited stdio (so interactive prompts work):
|
|
283
230
|
|
|
284
|
-
**Example**
|
|
285
231
|
```text
|
|
286
|
-
|
|
287
|
-
/agent Researcher
|
|
288
|
-
Summarize the tradeoffs between two approaches...
|
|
232
|
+
/! ls -la
|
|
289
233
|
```
|
|
290
234
|
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
---
|
|
294
|
-
|
|
295
|
-
## 5) Multi-line input (`/multi`)
|
|
296
|
-
|
|
297
|
-
Use `/multi` when you want to paste structured content (requirements, logs, code blocks, JSON/YAML).
|
|
235
|
+
### `/!!` — send output to the AI
|
|
236
|
+
Runs a command, captures its output, and sends that output to the agent as message content.
|
|
298
237
|
|
|
299
|
-
**Example**
|
|
300
238
|
```text
|
|
301
|
-
|
|
302
|
-
Create a step-by-step plan to debug a failing CI job.
|
|
303
|
-
|
|
304
|
-
Input:
|
|
305
|
-
- command I ran:
|
|
306
|
-
- relevant log excerpt:
|
|
307
|
-
- what I already tried:
|
|
308
|
-
|
|
309
|
-
Output:
|
|
310
|
-
- hypotheses
|
|
311
|
-
- commands to verify
|
|
312
|
-
- minimal fix suggestions
|
|
239
|
+
/!! cat package.json
|
|
313
240
|
```
|
|
314
241
|
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
## 6) Shell commands (`/!` and `/!!`)
|
|
318
|
-
|
|
319
|
-
### `/!` — interactive shell
|
|
320
|
-
Use `/!` to run shell commands in an interactive way (depending on your build). For some builds, `/!` may also accept a command directly.
|
|
242
|
+
The command output will be wrapped and forwarded to the agent like:
|
|
321
243
|
|
|
322
|
-
**Example**
|
|
323
244
|
```text
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
cat package.json
|
|
245
|
+
Command output from `cat package.json`:
|
|
246
|
+
<output...>
|
|
327
247
|
```
|
|
328
248
|
|
|
329
|
-
###
|
|
330
|
-
Use `/!!` when you want Knowhow to *capture* command output and include it in the AI context.
|
|
331
|
-
|
|
332
|
-
**Example**
|
|
249
|
+
### Example: use shell output to guide an agent
|
|
333
250
|
```text
|
|
334
|
-
|
|
335
|
-
|
|
251
|
+
> /agent Patcher
|
|
252
|
+
Agent mode enabled. Selected agent: Patcher. Type your task to get started.
|
|
336
253
|
|
|
337
|
-
|
|
338
|
-
```text
|
|
339
|
-
What caused the failure, and what minimal changes should I make?
|
|
340
|
-
```
|
|
254
|
+
Ask knowhow Patcher: Inspect the repo and patch any failing tests.
|
|
341
255
|
|
|
342
|
-
|
|
256
|
+
Ask knowhow Patcher: /!! npm test
|
|
257
|
+
```
|
|
343
258
|
|
|
344
259
|
---
|
|
345
260
|
|
|
346
|
-
## 7) Session management (attach/resume
|
|
261
|
+
## 7) Session management (attach/resume + session persistence)
|
|
262
|
+
|
|
263
|
+
Knowhow supports continuing work across time and processes by saving agent session state.
|
|
347
264
|
|
|
348
|
-
|
|
349
|
-
- **
|
|
350
|
-
- **
|
|
265
|
+
### Key concepts
|
|
266
|
+
- **Running tasks** can be attached to with `/attach`.
|
|
267
|
+
- **Completed/saved sessions** can be resumed with `/resume`.
|
|
268
|
+
- Session metadata may also exist on disk under agent process directories (used for filesystem-backed attachments).
|
|
351
269
|
|
|
352
|
-
### List sessions
|
|
270
|
+
### List sessions
|
|
353
271
|
```text
|
|
354
272
|
/sessions
|
|
355
273
|
```
|
|
356
274
|
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
275
|
+
Options:
|
|
276
|
+
- `/sessions --completed` : include saved/completed
|
|
277
|
+
- `/sessions --all` : include more historical sessions
|
|
278
|
+
- `/sessions --csv` : CSV output
|
|
361
279
|
|
|
362
|
-
|
|
280
|
+
### Attach to a running task
|
|
363
281
|
```text
|
|
364
|
-
/
|
|
282
|
+
/attach <taskId>
|
|
365
283
|
```
|
|
366
284
|
|
|
367
|
-
|
|
285
|
+
Or interactively:
|
|
368
286
|
```text
|
|
369
287
|
/attach
|
|
370
288
|
```
|
|
371
289
|
|
|
372
|
-
|
|
290
|
+
The session list can include filesystem/web tasks, depending on what’s available.
|
|
291
|
+
|
|
292
|
+
### Resume a completed session
|
|
373
293
|
```text
|
|
374
|
-
/
|
|
294
|
+
/resume <taskId>
|
|
375
295
|
```
|
|
376
296
|
|
|
377
|
-
|
|
378
|
-
Resume interactively:
|
|
297
|
+
Or interactively:
|
|
379
298
|
```text
|
|
380
299
|
/resume
|
|
381
300
|
```
|
|
382
301
|
|
|
383
|
-
|
|
384
|
-
```text
|
|
385
|
-
/resume <taskId>
|
|
386
|
-
```
|
|
302
|
+
You’ll be prompted to add additional context for resuming.
|
|
387
303
|
|
|
388
|
-
###
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
```
|
|
304
|
+
### Attach/detach during `agent:attached`
|
|
305
|
+
While attached:
|
|
306
|
+
- `/detach` detaches from the running task
|
|
307
|
+
- `/done` exits interaction (detaches)
|
|
393
308
|
|
|
394
309
|
---
|
|
395
310
|
|
|
396
|
-
## 8) Renderers (
|
|
311
|
+
## 8) Renderers (`/render`)
|
|
397
312
|
|
|
398
|
-
|
|
313
|
+
Knowhow can change how messages/events are displayed.
|
|
399
314
|
|
|
400
|
-
###
|
|
315
|
+
### Built-in renderers
|
|
316
|
+
`/render` shows:
|
|
317
|
+
- Current renderer
|
|
318
|
+
- Built-ins: `basic`, `compact`, `fancy`
|
|
319
|
+
|
|
320
|
+
Switch to a built-in:
|
|
401
321
|
```text
|
|
402
|
-
/render basic
|
|
403
322
|
/render compact
|
|
404
|
-
/render fancy
|
|
405
323
|
```
|
|
406
324
|
|
|
407
|
-
###
|
|
325
|
+
### Example: show renderer info
|
|
408
326
|
```text
|
|
409
|
-
/render
|
|
410
|
-
/render @my-org/knowhow-renderer
|
|
327
|
+
/render
|
|
411
328
|
```
|
|
412
329
|
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
(multi-line text...)
|
|
418
|
-
```
|
|
330
|
+
### Switching while an agent is running
|
|
331
|
+
When you switch renderers:
|
|
332
|
+
- the CLI preserves the active task id (if one exists)
|
|
333
|
+
- agent event wiring is rewired so live agent output continues to render in the new renderer
|
|
419
334
|
|
|
420
335
|
---
|
|
421
336
|
|
|
422
|
-
## 9) Voice input (
|
|
423
|
-
|
|
424
|
-
If voice is enabled in your build, toggle voice mode with:
|
|
337
|
+
## 9) Voice input (`/voice`)
|
|
425
338
|
|
|
339
|
+
Enable voice mode:
|
|
426
340
|
```text
|
|
427
341
|
/voice
|
|
428
342
|
```
|
|
429
343
|
|
|
430
|
-
|
|
344
|
+
When enabled, the next input prompt is satisfied by calling `voiceToText()` (microphone integration). If voice input fails or isn’t configured, you may get an empty string / an error.
|
|
431
345
|
|
|
432
|
-
|
|
346
|
+
Disable it again:
|
|
347
|
+
```text
|
|
348
|
+
/voice
|
|
349
|
+
```
|
|
433
350
|
|
|
434
351
|
---
|
|
435
352
|
|
|
436
|
-
## 10) Custom agents (`knowhow.json`
|
|
353
|
+
## 10) Custom agents (configure in `knowhow.json`)
|
|
437
354
|
|
|
438
|
-
|
|
355
|
+
Custom agents are loaded as agent constructors (used by `/agent` and `/agents`). In this guide, custom agents are configured in `knowhow.json` under an `agents` array.
|
|
439
356
|
|
|
440
|
-
|
|
357
|
+
> ⚠️ The exact schema of your agent config can depend on your Knowhow version and agent implementation. The examples below show the typical structure and the most important part: the **agent name** you will use with `/agent <name>`.
|
|
441
358
|
|
|
359
|
+
### Example `knowhow.json` with custom agents
|
|
442
360
|
```json
|
|
443
361
|
{
|
|
444
362
|
"agents": [
|
|
445
363
|
{
|
|
446
|
-
"name": "
|
|
447
|
-
"description": "Edits code safely and provides patch-style output.",
|
|
448
|
-
"model": "gpt-4.1-mini",
|
|
364
|
+
"name": "ResearcherPro",
|
|
449
365
|
"provider": "openai",
|
|
450
|
-
"
|
|
451
|
-
"systemPrompt": "You are a
|
|
366
|
+
"model": "gpt-5.4-nano",
|
|
367
|
+
"systemPrompt": "You are a rigorous research agent. Provide sourced, structured answers.",
|
|
368
|
+
"tools": ["search", "render", "code-execution"]
|
|
452
369
|
},
|
|
453
370
|
{
|
|
454
|
-
"name": "
|
|
455
|
-
"
|
|
456
|
-
"model": "
|
|
457
|
-
"
|
|
458
|
-
"tools": ["
|
|
459
|
-
"systemPrompt": "You are a research assistant. Provide sourced tradeoffs and clear recommendations."
|
|
371
|
+
"name": "PatchMaster",
|
|
372
|
+
"provider": "anthropic",
|
|
373
|
+
"model": "sonnet-4-6",
|
|
374
|
+
"systemPrompt": "You are an expert software patching agent. Be precise and safe.",
|
|
375
|
+
"tools": ["askHuman", "file-edit", "diff-preview"]
|
|
460
376
|
}
|
|
461
377
|
]
|
|
462
378
|
}
|
|
463
379
|
```
|
|
464
380
|
|
|
465
|
-
###
|
|
381
|
+
### Using your custom agent
|
|
382
|
+
After updating `knowhow.json`, restart Knowhow and run:
|
|
383
|
+
|
|
466
384
|
```text
|
|
467
385
|
/agents
|
|
468
|
-
/agent
|
|
469
|
-
Ask knowhow: What are the tradeoffs between approach A and approach B?
|
|
386
|
+
/agent ResearcherPro
|
|
470
387
|
```
|
|
471
388
|
|
|
472
|
-
|
|
389
|
+
Then provide your task as normal text (non-slash).
|
|
473
390
|
|
|
474
391
|
---
|
|
475
392
|
|
|
476
|
-
##
|
|
393
|
+
## End-to-end examples
|
|
477
394
|
|
|
478
|
-
### Example A:
|
|
395
|
+
### Example A: Start an agent and run work
|
|
479
396
|
```text
|
|
480
|
-
/
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
397
|
+
> /agent Patcher
|
|
398
|
+
Agent mode enabled. Selected agent: Patcher. Type your task to get started.
|
|
399
|
+
|
|
400
|
+
Ask knowhow Patcher: Fix the failing unit test in the repo.
|
|
484
401
|
```
|
|
485
402
|
|
|
486
|
-
### Example B:
|
|
403
|
+
### Example B: Run a shell command and feed output to the agent
|
|
487
404
|
```text
|
|
488
|
-
/
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
Requirements:
|
|
492
|
-
- Commands begin with `/`
|
|
493
|
-
- Support agent switching
|
|
494
|
-
- Include rendering and sessions
|
|
495
|
-
|
|
496
|
-
Return:
|
|
497
|
-
1) Proposed architecture
|
|
498
|
-
2) Command registry design
|
|
499
|
-
3) Example user flows
|
|
405
|
+
> /agent Patcher
|
|
406
|
+
Ask knowhow Patcher: /!! npm test
|
|
407
|
+
Ask knowhow Patcher: Based on the output, propose a minimal patch.
|
|
500
408
|
```
|
|
501
409
|
|
|
502
|
-
### Example C:
|
|
410
|
+
### Example C: Attach to a running agent task and view logs
|
|
503
411
|
```text
|
|
504
|
-
|
|
505
|
-
|
|
412
|
+
> /sessions
|
|
413
|
+
1) a1b2c3... (running) Patcher
|
|
414
|
+
2) d4e5f6... (saved) ResearcherPro
|
|
415
|
+
|
|
416
|
+
> /attach a1b2c3...
|
|
417
|
+
🔄 Attached to running task: a1b2c3...
|
|
418
|
+
Agent : Patcher
|
|
419
|
+
Task : Fix the failing unit test...
|
|
420
|
+
Status: running
|
|
421
|
+
|
|
422
|
+
> /logs 10
|
|
506
423
|
```
|
|
507
424
|
|
|
508
|
-
### Example D:
|
|
425
|
+
### Example D: Resume a completed session
|
|
509
426
|
```text
|
|
510
|
-
/
|
|
511
|
-
|
|
512
|
-
|
|
427
|
+
> /resume d4e5f6...
|
|
428
|
+
📋 Session found: d4e5f6...
|
|
429
|
+
Agent : ResearcherPro
|
|
430
|
+
Task : Summarize...
|
|
431
|
+
|
|
432
|
+
Add any additional context for resuming this session (or press Enter to skip): Focus on migration risks.
|
|
513
433
|
```
|
|
514
434
|
|
|
515
|
-
### Example E:
|
|
435
|
+
### Example E: Switch renderer mid-session
|
|
516
436
|
```text
|
|
517
|
-
/
|
|
518
|
-
|
|
437
|
+
> /render fancy
|
|
438
|
+
✅ Renderer switched to: fancy
|
|
519
439
|
```
|
|
520
440
|
|
|
521
441
|
---
|
|
522
442
|
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
- **Start chat:** `knowhow chat`
|
|
526
|
-
- **List agents:** `/agents`
|
|
527
|
-
- **Switch agent:** `/agent <name>`
|
|
528
|
-
- **Multi-line input:** `/multi`
|
|
529
|
-
- **Renderers:** `/render basic|compact|fancy`
|
|
530
|
-
- **Search:** `/search` (then use `next`, `exit`, `embeddings`, `use`)
|
|
531
|
-
- **Sessions listing:** `/sessions [--completed] [--all] [--csv]`
|
|
532
|
-
- **Attach:** `/attach [taskId] [--completed]`
|
|
533
|
-
- **Resume:** `/resume [taskId]`
|
|
534
|
-
- **Attached logs:** `/logs [N]`
|
|
535
|
-
- **Shell:** `/!` and `/!! <command>`
|
|
536
|
-
- **Voice (if available):** `/voice`
|
|
537
|
-
|
|
538
|
-
---
|
|
539
|
-
|
|
540
|
-
If you paste the actual module source files that register the `/…` commands in your environment (agent/search/sessions/shell/voice/system modules), I can turn the “known commands” above into a **fully exact** reference (including any optional flags and exact argument syntax for every subcommand).
|
|
443
|
+
If you want, paste your `knowhow.json` (redact secrets) and I can help you write a correct custom-agent schema that matches how your Knowhow build expects agent definitions.
|