@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/cli-reference.md
CHANGED
|
@@ -1,765 +1,691 @@
|
|
|
1
|
-
# Knowhow CLI Reference
|
|
1
|
+
# Knowhow CLI Reference
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
> **
|
|
3
|
+
> **Binary:** `knowhow`
|
|
4
|
+
> **Version:** `knowhow --version`
|
|
5
|
+
> **Help:** `knowhow --help`
|
|
6
6
|
|
|
7
7
|
## Table of Contents
|
|
8
8
|
|
|
9
|
-
1. [
|
|
10
|
-
2. [
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
- [`upload`](#upload)
|
|
21
|
-
- [`download`](#download)
|
|
22
|
-
- [`chat`](#chat)
|
|
23
|
-
- [`agent`](#agent)
|
|
24
|
-
- [`ask`](#ask)
|
|
25
|
-
- [`setup`](#setup)
|
|
26
|
-
- [`search`](#search)
|
|
27
|
-
- [`sessions`](#sessions)
|
|
28
|
-
- [`worker`](#worker)
|
|
29
|
-
- [`files`](#files)
|
|
30
|
-
- [`workers`](#workers)
|
|
31
|
-
- [`github-credentials`](#github-credentials)
|
|
32
|
-
3. [Exit Codes / Error Handling](#exit-codes--error-handling)
|
|
33
|
-
|
|
34
|
-
---
|
|
35
|
-
|
|
36
|
-
## Global
|
|
37
|
-
|
|
38
|
-
- **Binary name:** `knowhow`
|
|
39
|
-
- **Version:** `knowhow --version`
|
|
40
|
-
- **Config migration:** On startup, the CLI runs config migration (`migrateConfig()`) before dispatching commands.
|
|
41
|
-
- Many operational commands call `setupServices()` first to wire services/clients/tools (and connect to configured backends).
|
|
9
|
+
1. [Project Initialization](#project-initialization)
|
|
10
|
+
2. [Authentication](#authentication)
|
|
11
|
+
3. [Chat & Agents](#chat--agents)
|
|
12
|
+
4. [Run Pipelines (Generate)](#run-pipelines-generate)
|
|
13
|
+
5. [Embeddings](#embeddings)
|
|
14
|
+
6. [Remote Sync (Upload/Download)](#remote-sync-uploaddownload)
|
|
15
|
+
7. [Workers](#workers)
|
|
16
|
+
8. [File Sync](#file-sync)
|
|
17
|
+
9. [Cloud Workers](#cloud-workers)
|
|
18
|
+
10. [Modules](#modules)
|
|
19
|
+
11. [Git Credential Helper](#git-credential-helper)
|
|
42
20
|
|
|
43
21
|
---
|
|
44
22
|
|
|
45
|
-
##
|
|
46
|
-
|
|
47
|
-
### `init`
|
|
23
|
+
## Project Initialization
|
|
48
24
|
|
|
49
|
-
|
|
50
|
-
Initialize Knowhow configuration and
|
|
25
|
+
### `knowhow init`
|
|
26
|
+
**Purpose:** Initialize Knowhow configuration files and folder structure:
|
|
27
|
+
- Creates **global** config in `~/.knowhow/`
|
|
28
|
+
- Creates **local** config in `./.knowhow/`
|
|
29
|
+
- Ensures built-in template prompts/files exist
|
|
30
|
+
- Adds `@tyvm/knowhow-module-script` to the global `~/.knowhow/knowhow.json` modules (if missing)
|
|
51
31
|
|
|
52
|
-
|
|
32
|
+
**Usage:**
|
|
53
33
|
```bash
|
|
54
34
|
knowhow init
|
|
55
35
|
```
|
|
56
36
|
|
|
57
|
-
|
|
58
|
-
None defined in the provided source excerpts.
|
|
59
|
-
|
|
60
|
-
#### What it creates/writes
|
|
61
|
-
- Creates local directory structure under `./.knowhow/`:
|
|
62
|
-
- `./.knowhow/`
|
|
63
|
-
- `./.knowhow/prompts/`
|
|
64
|
-
- `./.knowhow/docs/`
|
|
65
|
-
- `./.knowhow/embeddings/`
|
|
66
|
-
- Creates global template/config directory under `~/.knowhow/` and copies template files if missing:
|
|
67
|
-
- `./.knowhow/knowhow.json` (local)
|
|
68
|
-
- `./.knowhow/language.json` (local)
|
|
69
|
-
- `./.knowhow/.ignore`, `./.knowhow/.hashes.json`, `./.knowhow/.jwt` (local)
|
|
70
|
-
- Prompt templates: `./.knowhow/prompts/*.mdx` (local)
|
|
71
|
-
- Template folder/file permissions are set when created (folder `0o744`, files `0o600`).
|
|
72
|
-
|
|
73
|
-
#### Example
|
|
37
|
+
**Example:**
|
|
74
38
|
```bash
|
|
75
39
|
knowhow init
|
|
76
40
|
```
|
|
77
41
|
|
|
78
42
|
---
|
|
79
43
|
|
|
80
|
-
|
|
44
|
+
## Authentication
|
|
81
45
|
|
|
82
|
-
|
|
83
|
-
|
|
46
|
+
### `knowhow login`
|
|
47
|
+
**Purpose:** Log in to Knowhow. Supports either browser-based login flow or manual JWT input.
|
|
84
48
|
|
|
85
|
-
|
|
49
|
+
**Usage:**
|
|
86
50
|
```bash
|
|
87
|
-
knowhow login [--jwt
|
|
51
|
+
knowhow login [--jwt]
|
|
88
52
|
```
|
|
89
53
|
|
|
90
|
-
|
|
91
|
-
- `--jwt
|
|
92
|
-
|
|
93
|
-
> If `--jwt` is provided, the implementation passes it to the login routine.
|
|
54
|
+
**Options:**
|
|
55
|
+
- `--jwt` — Use manual JWT input instead of browser login
|
|
94
56
|
|
|
95
|
-
|
|
57
|
+
**Example:**
|
|
96
58
|
```bash
|
|
97
59
|
knowhow login
|
|
98
60
|
```
|
|
99
61
|
|
|
62
|
+
Manual JWT (exact behavior depends on `login()` implementation):
|
|
100
63
|
```bash
|
|
101
|
-
knowhow login --jwt
|
|
64
|
+
knowhow login --jwt
|
|
102
65
|
```
|
|
103
66
|
|
|
67
|
+
> ✅ **Note:** In the provided code, there is **no `knowhow logout` command registered**. (It may exist elsewhere, but it’s not present in the snippets you provided.)
|
|
68
|
+
|
|
104
69
|
---
|
|
105
70
|
|
|
106
|
-
|
|
71
|
+
## Chat & Agents
|
|
72
|
+
|
|
73
|
+
### `knowhow chat`
|
|
74
|
+
**Purpose:** Start an interactive chat interface.
|
|
107
75
|
|
|
108
|
-
|
|
109
|
-
|
|
76
|
+
**Usage:**
|
|
77
|
+
```bash
|
|
78
|
+
knowhow chat
|
|
79
|
+
```
|
|
110
80
|
|
|
111
|
-
|
|
81
|
+
**Example:**
|
|
112
82
|
```bash
|
|
113
|
-
knowhow
|
|
83
|
+
knowhow chat
|
|
114
84
|
```
|
|
115
85
|
|
|
116
|
-
|
|
117
|
-
|
|
86
|
+
---
|
|
87
|
+
|
|
88
|
+
### `knowhow agent`
|
|
89
|
+
**Purpose:** Run a one-shot agent task directly from the CLI (default agent: `Patcher`). Can also resume a previously started task.
|
|
118
90
|
|
|
119
|
-
|
|
91
|
+
**Usage:**
|
|
120
92
|
```bash
|
|
121
|
-
knowhow
|
|
93
|
+
knowhow agent [options]
|
|
122
94
|
```
|
|
123
95
|
|
|
124
|
-
|
|
96
|
+
#### Options
|
|
97
|
+
- `--provider <provider>`
|
|
98
|
+
AI provider (e.g. `openai`, `anthropic`, `google`, `xai`)
|
|
99
|
+
- `--model <model>`
|
|
100
|
+
Specific model for the selected provider
|
|
101
|
+
- `--agent-name <name>`
|
|
102
|
+
Which agent to use (default: `Patcher`)
|
|
103
|
+
- `--max-time-limit <minutes>`
|
|
104
|
+
Execution time limit in minutes (default: `30`)
|
|
105
|
+
- `--max-spend-limit <dollars>`
|
|
106
|
+
Cost limit in dollars (default: `10`)
|
|
107
|
+
- `--message-id <messageId>`
|
|
108
|
+
Knowhow message ID for task tracking
|
|
109
|
+
- `--sync-fs`
|
|
110
|
+
Enable filesystem-based synchronization
|
|
111
|
+
- `--task-id <taskId>`
|
|
112
|
+
Pre-generated task ID (used with `--sync-fs` for predictable agent directory)
|
|
113
|
+
- `--prompt-file <path>`
|
|
114
|
+
Custom prompt template file with a `{text}` placeholder
|
|
115
|
+
- `--input <text>`
|
|
116
|
+
Task input (fallback to stdin if not provided)
|
|
117
|
+
- `--resume`
|
|
118
|
+
Resume a previously started task using `--task-id` (local FS or remote)
|
|
119
|
+
- `--renderer <name>`
|
|
120
|
+
Renderer to use: `basic`, `compact`, `fancy`, or a path/package
|
|
121
|
+
(default: from config or `basic`)
|
|
125
122
|
|
|
126
|
-
|
|
123
|
+
#### Input rules
|
|
124
|
+
- If you don’t pass `--input` and don’t pass `--prompt-file`, the CLI reads from **stdin** (only if stdin is not a TTY).
|
|
125
|
+
- `--prompt-file` is processed through `readPromptFile(options.promptFile, input)`.
|
|
127
126
|
|
|
128
|
-
|
|
129
|
-
Update the globally installed `knowhow` CLI to the latest npm version.
|
|
127
|
+
**Examples**
|
|
130
128
|
|
|
131
|
-
|
|
129
|
+
Run the default agent with inline input:
|
|
132
130
|
```bash
|
|
133
|
-
knowhow
|
|
131
|
+
knowhow agent --input "Summarize the project in 10 bullets"
|
|
134
132
|
```
|
|
135
133
|
|
|
136
|
-
|
|
137
|
-
|
|
134
|
+
Use a custom prompt template file:
|
|
135
|
+
```bash
|
|
136
|
+
knowhow agent --prompt-file .knowhow/prompts/BasicCodeDocumenter.mdx --input "src/index.ts"
|
|
137
|
+
```
|
|
138
138
|
|
|
139
|
-
|
|
140
|
-
Runs:
|
|
139
|
+
Resume a task:
|
|
141
140
|
```bash
|
|
142
|
-
|
|
141
|
+
knowhow agent --resume --task-id 123 --message-id 456 --input "Continue where you left off"
|
|
143
142
|
```
|
|
144
143
|
|
|
145
|
-
|
|
144
|
+
Choose provider + renderer:
|
|
146
145
|
```bash
|
|
147
|
-
knowhow
|
|
146
|
+
knowhow agent --provider openai --model gpt-4.1-mini --renderer fancy --input "Fix the failing tests"
|
|
148
147
|
```
|
|
149
148
|
|
|
150
149
|
---
|
|
151
150
|
|
|
152
|
-
### `
|
|
153
|
-
|
|
154
|
-
#### Purpose
|
|
155
|
-
Run the configured sources pipeline to generate outputs (summaries/docs/etc.) based on `config.sources`.
|
|
151
|
+
### `knowhow ask`
|
|
152
|
+
**Purpose:** Direct AI questioning without agent overhead.
|
|
156
153
|
|
|
157
|
-
|
|
154
|
+
**Usage:**
|
|
158
155
|
```bash
|
|
159
|
-
knowhow
|
|
156
|
+
knowhow ask [options]
|
|
160
157
|
```
|
|
161
158
|
|
|
162
|
-
#### Options
|
|
163
|
-
|
|
159
|
+
#### Options
|
|
160
|
+
- `--provider <provider>` — AI provider to use
|
|
161
|
+
- `--model <model>` — Specific model
|
|
162
|
+
- `--input <text>` — Question (fallback to stdin if not provided)
|
|
163
|
+
- `--prompt-file <path>` — Custom prompt template file
|
|
164
164
|
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
- Computes hashes (prompt hash and input file hash) and skips work if unchanged.
|
|
168
|
-
- For each source:
|
|
169
|
-
- If `source.kind === "file"` (or falsy): generates from matching files (`source.input`)
|
|
170
|
-
- Otherwise: treats `source.kind` as a plugin “kind”, writes to `source.output`, then continues with file-handling logic.
|
|
165
|
+
**Input rules**
|
|
166
|
+
- If `--input` is not provided and `--prompt-file` is not provided, it reads from **stdin** (non-TTY).
|
|
171
167
|
|
|
172
|
-
|
|
168
|
+
**Example:**
|
|
173
169
|
```bash
|
|
174
|
-
knowhow
|
|
170
|
+
knowhow ask --input "What does Knowhow do?"
|
|
175
171
|
```
|
|
176
172
|
|
|
177
|
-
|
|
173
|
+
With a prompt template:
|
|
174
|
+
```bash
|
|
175
|
+
knowhow ask --prompt-file .knowhow/prompts/BasicAsk.mdx --input "Explain embeddings."
|
|
176
|
+
```
|
|
178
177
|
|
|
179
|
-
|
|
178
|
+
---
|
|
180
179
|
|
|
181
|
-
|
|
182
|
-
|
|
180
|
+
### `knowhow setup`
|
|
181
|
+
**Purpose:** Ask the agent to configure Knowhow (runs the setup agent flow).
|
|
183
182
|
|
|
184
|
-
|
|
183
|
+
**Usage:**
|
|
185
184
|
```bash
|
|
186
|
-
knowhow
|
|
185
|
+
knowhow setup
|
|
187
186
|
```
|
|
188
187
|
|
|
189
|
-
|
|
190
|
-
Not defined in provided excerpts (assumed equivalent to `generate`).
|
|
191
|
-
|
|
192
|
-
#### Example
|
|
188
|
+
**Example:**
|
|
193
189
|
```bash
|
|
194
|
-
knowhow
|
|
190
|
+
knowhow setup
|
|
195
191
|
```
|
|
196
192
|
|
|
197
193
|
---
|
|
198
194
|
|
|
199
|
-
### `
|
|
200
|
-
|
|
201
|
-
#### Purpose
|
|
202
|
-
Generate embeddings for sources configured in `config.embedSources`.
|
|
195
|
+
### `knowhow search`
|
|
196
|
+
**Purpose:** Search embeddings directly from the CLI.
|
|
203
197
|
|
|
204
|
-
|
|
198
|
+
**Usage:**
|
|
205
199
|
```bash
|
|
206
|
-
knowhow
|
|
200
|
+
knowhow search [options]
|
|
207
201
|
```
|
|
208
202
|
|
|
209
|
-
#### Options
|
|
210
|
-
|
|
203
|
+
#### Options
|
|
204
|
+
- `--input <text>` — Search query (fallback to stdin if not provided)
|
|
205
|
+
- `-e, --embedding <path>` — Specific embedding path (default: `all`)
|
|
211
206
|
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
- Calls `embedSource(defaultModel, source, ignorePattern)` per configured embedding source.
|
|
207
|
+
**Example:**
|
|
208
|
+
```bash
|
|
209
|
+
knowhow search --input "How do I configure auth?" --embedding .knowhow/embeddings/docs.json
|
|
210
|
+
```
|
|
217
211
|
|
|
218
|
-
|
|
212
|
+
Read query from stdin:
|
|
219
213
|
```bash
|
|
220
|
-
knowhow
|
|
214
|
+
echo "What is a worker?" | knowhow search
|
|
221
215
|
```
|
|
222
216
|
|
|
223
217
|
---
|
|
224
218
|
|
|
225
|
-
### `
|
|
226
|
-
|
|
227
|
-
#### Purpose
|
|
228
|
-
Purge embeddings matching a glob pattern.
|
|
229
|
-
(Depending on the CLI implementation, this may be an alias of `knowhow purge`.)
|
|
219
|
+
### `knowhow sessions`
|
|
220
|
+
**Purpose:** Manage agent sessions from CLI (prints session table, optionally all historical sessions).
|
|
230
221
|
|
|
231
|
-
|
|
222
|
+
**Usage:**
|
|
232
223
|
```bash
|
|
233
|
-
knowhow
|
|
224
|
+
knowhow sessions [options]
|
|
234
225
|
```
|
|
235
226
|
|
|
236
|
-
#### Options
|
|
237
|
-
|
|
227
|
+
#### Options
|
|
228
|
+
- `--all` — Show all historical sessions (default: current process only)
|
|
229
|
+
- `--csv` — Output sessions as CSV
|
|
238
230
|
|
|
239
|
-
|
|
240
|
-
|
|
231
|
+
**Example:**
|
|
232
|
+
```bash
|
|
233
|
+
knowhow sessions
|
|
234
|
+
```
|
|
241
235
|
|
|
242
|
-
|
|
236
|
+
All sessions as CSV:
|
|
243
237
|
```bash
|
|
244
|
-
knowhow
|
|
238
|
+
knowhow sessions --all --csv
|
|
245
239
|
```
|
|
246
240
|
|
|
247
241
|
---
|
|
248
242
|
|
|
249
|
-
|
|
243
|
+
## Run Pipelines (Generate)
|
|
250
244
|
|
|
251
|
-
|
|
252
|
-
|
|
245
|
+
### `knowhow generate`
|
|
246
|
+
**Purpose:** Run the **sources pipeline** for documentation generation based on `config.sources`.
|
|
253
247
|
|
|
254
|
-
|
|
248
|
+
**Usage:**
|
|
255
249
|
```bash
|
|
256
|
-
knowhow
|
|
250
|
+
knowhow generate
|
|
257
251
|
```
|
|
258
252
|
|
|
259
|
-
|
|
260
|
-
None defined in the provided excerpts.
|
|
261
|
-
|
|
262
|
-
#### Arguments
|
|
263
|
-
- `<globPath>` — Glob expression for matching files whose chunks should be purged.
|
|
264
|
-
|
|
265
|
-
#### Behavior (from provided excerpt)
|
|
266
|
-
- Matches files via `globSync(globPath)`
|
|
267
|
-
- Loads configured embeddings map and config (`config.embedSources`)
|
|
268
|
-
- For each embedding “file” key:
|
|
269
|
-
- Filters out entries whose:
|
|
270
|
-
- `id` starts with `"./" + filePath` (removes chunks for that file)
|
|
271
|
-
- `text.length` exceeds the configured `chunkSize` for that embedding output
|
|
272
|
-
- Saves the pruned embeddings.
|
|
273
|
-
|
|
274
|
-
#### Example
|
|
253
|
+
**Example:**
|
|
275
254
|
```bash
|
|
276
|
-
knowhow
|
|
255
|
+
knowhow generate
|
|
277
256
|
```
|
|
278
257
|
|
|
258
|
+
> ✅ **Note:** The provided code registers `generate` only. There is **no `knowhow gen` alias** in the snippets you provided.
|
|
259
|
+
|
|
279
260
|
---
|
|
280
261
|
|
|
281
|
-
|
|
262
|
+
## Embeddings
|
|
282
263
|
|
|
283
|
-
|
|
284
|
-
|
|
264
|
+
### `knowhow embed`
|
|
265
|
+
**Purpose:** Create embeddings for entries in `config.embedSources`.
|
|
285
266
|
|
|
286
|
-
|
|
267
|
+
**Usage:**
|
|
287
268
|
```bash
|
|
288
|
-
knowhow
|
|
269
|
+
knowhow embed
|
|
289
270
|
```
|
|
290
271
|
|
|
291
|
-
|
|
292
|
-
No flags defined in the provided excerpts. Behavior is **configuration-driven**.
|
|
293
|
-
|
|
294
|
-
#### Configuration behavior (high level)
|
|
295
|
-
For each `config.embedSources[]` entry:
|
|
296
|
-
- Requires `source.remoteType`
|
|
297
|
-
- Reads embedding JSON from `source.output`
|
|
298
|
-
- Determines `embeddingName` from the output filename
|
|
299
|
-
|
|
300
|
-
Supports:
|
|
301
|
-
- **`remoteType: "s3"`**
|
|
302
|
-
- Uploads to: `s3://{bucketName}/{embeddingName}.json`
|
|
303
|
-
- **`remoteType: "knowhow"`**
|
|
304
|
-
- Requires `source.remoteId`
|
|
305
|
-
- Gets a presigned upload URL from the Knowhow API
|
|
306
|
-
- Uploads via S3 helper
|
|
307
|
-
- Calls `updateEmbeddingMetadata(...)` to sync metadata back to the backend
|
|
308
|
-
- Other types: skipped with a log.
|
|
309
|
-
|
|
310
|
-
#### Example
|
|
272
|
+
**Example:**
|
|
311
273
|
```bash
|
|
312
|
-
knowhow
|
|
274
|
+
knowhow embed
|
|
313
275
|
```
|
|
314
276
|
|
|
315
|
-
|
|
277
|
+
### `knowhow embed:purge <pattern>`
|
|
278
|
+
**Purpose:** Purge embeddings matching a glob pattern.
|
|
316
279
|
|
|
317
|
-
|
|
280
|
+
**Usage:**
|
|
281
|
+
```bash
|
|
282
|
+
knowhow embed:purge <pattern>
|
|
283
|
+
```
|
|
318
284
|
|
|
319
|
-
|
|
320
|
-
|
|
285
|
+
**Arguments**
|
|
286
|
+
- `<pattern>` — Glob pattern to match files for purging
|
|
321
287
|
|
|
322
|
-
|
|
288
|
+
**Example:**
|
|
323
289
|
```bash
|
|
324
|
-
knowhow
|
|
290
|
+
knowhow embed:purge "src/**/old*.ts"
|
|
325
291
|
```
|
|
326
292
|
|
|
327
|
-
|
|
328
|
-
No flags defined in the provided excerpts. Behavior is **configuration-driven**.
|
|
293
|
+
---
|
|
329
294
|
|
|
330
|
-
|
|
331
|
-
For each `config.embedSources[]` entry:
|
|
332
|
-
- Requires `source.remoteType`
|
|
333
|
-
- Computes destination:
|
|
334
|
-
- `fileName = "${name}.json"` where `name` is derived from `source.output`
|
|
335
|
-
- `destinationPath = source.output`
|
|
295
|
+
## Remote Sync (Upload/Download)
|
|
336
296
|
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
- Downloads `/{bucket}/{fileName}` into `destinationPath`
|
|
340
|
-
- **`remoteType: "github"`**
|
|
341
|
-
- Downloads from GitHub into local `.knowhow/embeddings/${fileName}`
|
|
342
|
-
- **`remoteType: "knowhow"`**
|
|
343
|
-
- Requires `source.remoteId`
|
|
344
|
-
- Gets presigned download URL from Knowhow API and downloads locally
|
|
345
|
-
- Other types: logs message.
|
|
297
|
+
### `knowhow upload`
|
|
298
|
+
**Purpose:** Upload generated embeddings/configured embedding outputs to configured remotes (`config.embedSources`).
|
|
346
299
|
|
|
347
|
-
|
|
300
|
+
**Usage:**
|
|
348
301
|
```bash
|
|
349
|
-
knowhow
|
|
302
|
+
knowhow upload
|
|
350
303
|
```
|
|
351
304
|
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
305
|
+
**Example:**
|
|
306
|
+
```bash
|
|
307
|
+
knowhow upload
|
|
308
|
+
```
|
|
355
309
|
|
|
356
|
-
|
|
357
|
-
|
|
310
|
+
### `knowhow download`
|
|
311
|
+
**Purpose:** Download embeddings from configured remotes.
|
|
358
312
|
|
|
359
|
-
|
|
313
|
+
**Usage:**
|
|
360
314
|
```bash
|
|
361
|
-
knowhow
|
|
315
|
+
knowhow download
|
|
362
316
|
```
|
|
363
317
|
|
|
364
|
-
|
|
365
|
-
Not defined in provided source excerpts.
|
|
366
|
-
|
|
367
|
-
#### Example
|
|
318
|
+
**Example:**
|
|
368
319
|
```bash
|
|
369
|
-
knowhow
|
|
320
|
+
knowhow download
|
|
370
321
|
```
|
|
371
322
|
|
|
372
323
|
---
|
|
373
324
|
|
|
374
|
-
|
|
325
|
+
## Workers
|
|
375
326
|
|
|
376
|
-
|
|
377
|
-
|
|
327
|
+
### `knowhow worker`
|
|
328
|
+
**Purpose:** Start a worker process (optionally registering it). Supports host mode or sandbox mode (Docker).
|
|
378
329
|
|
|
379
|
-
|
|
330
|
+
**Usage:**
|
|
380
331
|
```bash
|
|
381
|
-
knowhow
|
|
332
|
+
knowhow worker [options]
|
|
382
333
|
```
|
|
383
334
|
|
|
384
|
-
#### Options
|
|
385
|
-
|
|
335
|
+
#### Options
|
|
336
|
+
- `--register`
|
|
337
|
+
Register current directory as a worker path
|
|
338
|
+
- `--share`
|
|
339
|
+
Share this worker with your organization
|
|
340
|
+
- `--unshare`
|
|
341
|
+
Make this worker private (only you can use it)
|
|
342
|
+
- `--sandbox`
|
|
343
|
+
Run worker in a Docker container for isolation
|
|
344
|
+
- `--no-sandbox`
|
|
345
|
+
Run worker directly on host (disable sandbox mode)
|
|
346
|
+
- `--passkey`
|
|
347
|
+
Set up passkey authentication for this worker
|
|
348
|
+
- `--passkey-reset`
|
|
349
|
+
Remove passkey authentication requirement
|
|
350
|
+
- *(internal, not a direct CLI flag)* `allowedTools`
|
|
351
|
+
Used by tunnel mode to restrict tool set; not exposed as a CLI option in the provided code.
|
|
386
352
|
|
|
387
|
-
|
|
353
|
+
#### Examples
|
|
388
354
|
|
|
389
|
-
|
|
355
|
+
Start in default mode:
|
|
390
356
|
```bash
|
|
391
|
-
knowhow
|
|
357
|
+
knowhow worker
|
|
392
358
|
```
|
|
393
359
|
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
360
|
+
Register and share:
|
|
361
|
+
```bash
|
|
362
|
+
knowhow worker --register --share
|
|
363
|
+
```
|
|
397
364
|
|
|
398
|
-
|
|
399
|
-
|
|
365
|
+
Sandbox mode:
|
|
366
|
+
```bash
|
|
367
|
+
knowhow worker --sandbox
|
|
368
|
+
```
|
|
400
369
|
|
|
401
|
-
|
|
370
|
+
Host mode:
|
|
402
371
|
```bash
|
|
403
|
-
knowhow
|
|
372
|
+
knowhow worker --no-sandbox
|
|
404
373
|
```
|
|
405
374
|
|
|
406
|
-
|
|
407
|
-
|
|
375
|
+
Setup passkey:
|
|
376
|
+
```bash
|
|
377
|
+
knowhow worker --passkey
|
|
378
|
+
```
|
|
408
379
|
|
|
409
|
-
|
|
380
|
+
Reset passkey requirement:
|
|
410
381
|
```bash
|
|
411
|
-
knowhow
|
|
382
|
+
knowhow worker --passkey-reset
|
|
412
383
|
```
|
|
413
384
|
|
|
414
385
|
---
|
|
415
386
|
|
|
416
|
-
### `
|
|
387
|
+
### `knowhow workers`
|
|
388
|
+
**Purpose:** Manage and start all registered workers.
|
|
417
389
|
|
|
418
|
-
|
|
419
|
-
Ask the agent to configure Knowhow (runs setup workflow).
|
|
420
|
-
|
|
421
|
-
#### Usage syntax
|
|
390
|
+
**Usage:**
|
|
422
391
|
```bash
|
|
423
|
-
knowhow
|
|
392
|
+
knowhow workers [options]
|
|
424
393
|
```
|
|
425
394
|
|
|
426
|
-
#### Options
|
|
427
|
-
|
|
395
|
+
#### Options (mutually exclusive in practice)
|
|
396
|
+
- `--list`
|
|
397
|
+
List all registered worker paths
|
|
398
|
+
- `--unregister <path>`
|
|
399
|
+
Unregister a worker path
|
|
400
|
+
- `--clear`
|
|
401
|
+
Clear all registered worker paths
|
|
428
402
|
|
|
429
|
-
|
|
403
|
+
**Examples**
|
|
404
|
+
List:
|
|
430
405
|
```bash
|
|
431
|
-
knowhow
|
|
406
|
+
knowhow workers --list
|
|
432
407
|
```
|
|
433
408
|
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
### `search`
|
|
437
|
-
|
|
438
|
-
#### Purpose
|
|
439
|
-
Search embeddings directly from the CLI.
|
|
440
|
-
|
|
441
|
-
#### Usage syntax
|
|
409
|
+
Unregister:
|
|
442
410
|
```bash
|
|
443
|
-
knowhow
|
|
411
|
+
knowhow workers --unregister /path/to/worker
|
|
444
412
|
```
|
|
445
413
|
|
|
446
|
-
|
|
447
|
-
|
|
414
|
+
Start all workers (default action):
|
|
415
|
+
```bash
|
|
416
|
+
knowhow workers
|
|
417
|
+
```
|
|
448
418
|
|
|
449
|
-
|
|
419
|
+
Clear registry:
|
|
450
420
|
```bash
|
|
451
|
-
knowhow
|
|
421
|
+
knowhow workers --clear
|
|
452
422
|
```
|
|
453
423
|
|
|
454
424
|
---
|
|
455
425
|
|
|
456
|
-
### `
|
|
457
|
-
|
|
458
|
-
#### Purpose
|
|
459
|
-
Manage and list agent sessions from the CLI.
|
|
426
|
+
### `knowhow tunnel`
|
|
427
|
+
**Purpose:** Start a minimal worker with **tunnel enabled** (exposes local ports to the cloud). Registers essential tools needed by the backend.
|
|
460
428
|
|
|
461
|
-
|
|
429
|
+
**Usage:**
|
|
462
430
|
```bash
|
|
463
|
-
knowhow
|
|
431
|
+
knowhow tunnel [options]
|
|
464
432
|
```
|
|
465
433
|
|
|
466
|
-
#### Options
|
|
467
|
-
|
|
434
|
+
#### Options
|
|
435
|
+
- `--share` — Share this tunnel with your organization
|
|
436
|
+
- `--unshare` — Make this tunnel private (only you can use it)
|
|
468
437
|
|
|
469
|
-
|
|
438
|
+
**Example:**
|
|
470
439
|
```bash
|
|
471
|
-
knowhow
|
|
440
|
+
knowhow tunnel --share
|
|
472
441
|
```
|
|
473
442
|
|
|
474
443
|
---
|
|
475
444
|
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
#### Purpose
|
|
479
|
-
Start a Knowhow **worker** process exposing worker’s MCP tools over WebSocket to the Knowhow API.
|
|
480
|
-
|
|
481
|
-
Worker can run in:
|
|
482
|
-
- **Host mode** (default)
|
|
483
|
-
- **Docker sandbox mode** (`--sandbox`)
|
|
484
|
-
- **Passkey-gated locked mode** (when passkey auth is configured; worker starts locked)
|
|
445
|
+
## File Sync
|
|
485
446
|
|
|
486
|
-
|
|
447
|
+
### `knowhow files`
|
|
448
|
+
**Purpose:** Sync files between local filesystem and Knowhow FS using `fileMounts` config.
|
|
487
449
|
|
|
488
|
-
|
|
450
|
+
**Usage:**
|
|
489
451
|
```bash
|
|
490
|
-
knowhow
|
|
452
|
+
knowhow files [options]
|
|
491
453
|
```
|
|
492
454
|
|
|
493
|
-
#### Options
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
-
|
|
497
|
-
|
|
498
|
-
-
|
|
455
|
+
#### Options
|
|
456
|
+
- `--upload`
|
|
457
|
+
Force upload direction for all mounts
|
|
458
|
+
- `--download`
|
|
459
|
+
Force download direction for all mounts
|
|
460
|
+
- `--config <path>`
|
|
461
|
+
Path to `knowhow.json` (default: `./knowhow.json`)
|
|
462
|
+
- `--dry-run`
|
|
463
|
+
Print what would be synced without doing it
|
|
499
464
|
|
|
500
|
-
**
|
|
465
|
+
**Examples**
|
|
466
|
+
Dry-run:
|
|
501
467
|
```bash
|
|
502
|
-
knowhow
|
|
468
|
+
knowhow files --dry-run
|
|
503
469
|
```
|
|
504
470
|
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
##### `--share`
|
|
508
|
-
- **Type:** boolean
|
|
509
|
-
- **Purpose:** Share this worker with your organization.
|
|
510
|
-
- **Effect:** Adds request header `Shared: "true"`.
|
|
511
|
-
|
|
512
|
-
**Example**
|
|
471
|
+
Force upload:
|
|
513
472
|
```bash
|
|
514
|
-
knowhow
|
|
473
|
+
knowhow files --upload
|
|
515
474
|
```
|
|
516
475
|
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
##### `--unshare`
|
|
520
|
-
- **Type:** boolean
|
|
521
|
-
- **Purpose:** Make this worker private/unshared.
|
|
522
|
-
- **Effect:** Adds request header `Shared: "false"`.
|
|
523
|
-
|
|
524
|
-
**Example**
|
|
476
|
+
Use a custom config path:
|
|
525
477
|
```bash
|
|
526
|
-
knowhow
|
|
478
|
+
knowhow files --config ./my-knowhow.json --download
|
|
527
479
|
```
|
|
528
480
|
|
|
529
481
|
---
|
|
530
482
|
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
- Checks Docker availability
|
|
536
|
-
- Rebuilds worker Docker image (`Docker.buildWorkerImage()`)
|
|
537
|
-
- Starts Docker with:
|
|
538
|
-
- `workspaceDir: process.cwd()`
|
|
539
|
-
- JWT + API URL + tunnel/config wiring
|
|
540
|
-
- share/unshare mapping via container options
|
|
541
|
-
- Persists config preference: `config.worker.sandbox = true`
|
|
483
|
+
## Cloud Workers
|
|
484
|
+
|
|
485
|
+
### `knowhow cloudworker`
|
|
486
|
+
**Purpose:** Create or sync a cloud worker with your local knowhow config.
|
|
542
487
|
|
|
543
|
-
**
|
|
488
|
+
**Usage:**
|
|
544
489
|
```bash
|
|
545
|
-
knowhow
|
|
490
|
+
knowhow cloudworker [options]
|
|
546
491
|
```
|
|
547
492
|
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
-
|
|
552
|
-
|
|
553
|
-
-
|
|
493
|
+
#### Options
|
|
494
|
+
- `--init`
|
|
495
|
+
Initialize `config.files` entries based on what exists in `.knowhow/` (run once before `--push`)
|
|
496
|
+
- `--create`
|
|
497
|
+
Create a new cloud worker with synced config and files
|
|
498
|
+
- `--push <uid>`
|
|
499
|
+
Push/sync local config and files to an existing cloud worker (by `<uid>`)
|
|
500
|
+
- `--pull <id>`
|
|
501
|
+
Pull the latest `workerConfigJson` from a cloud worker and update local config
|
|
502
|
+
- `--name <name>`
|
|
503
|
+
Name for the cloud worker (used with `--create`)
|
|
504
|
+
- `--dry-run`
|
|
505
|
+
Print what would be synced without doing it
|
|
554
506
|
|
|
555
|
-
**
|
|
507
|
+
**Examples**
|
|
508
|
+
Initialize config files entries:
|
|
556
509
|
```bash
|
|
557
|
-
knowhow
|
|
510
|
+
knowhow cloudworker --init
|
|
558
511
|
```
|
|
559
512
|
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
##### `--passkey`
|
|
563
|
-
- **Type:** boolean
|
|
564
|
-
- **Purpose:** Run passkey setup for this worker (browser-based registration flow).
|
|
565
|
-
- **Effect in code:**
|
|
566
|
-
- Requires you to be logged in (`loadJwt()`).
|
|
567
|
-
- If not logged in: prints error:
|
|
568
|
-
- `You must be logged in to set up a passkey. Run 'knowhow login' first.`
|
|
569
|
-
- Calls `new PasskeySetupService().setup(jwt)`
|
|
570
|
-
|
|
571
|
-
**Example**
|
|
513
|
+
Create a new cloud worker:
|
|
572
514
|
```bash
|
|
573
|
-
knowhow
|
|
515
|
+
knowhow cloudworker --create --name "My Cloud Worker"
|
|
574
516
|
```
|
|
575
517
|
|
|
576
|
-
|
|
518
|
+
Push to an existing worker:
|
|
519
|
+
```bash
|
|
520
|
+
knowhow cloudworker --push 9f2c1a
|
|
521
|
+
```
|
|
577
522
|
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
523
|
+
Pull latest config:
|
|
524
|
+
```bash
|
|
525
|
+
knowhow cloudworker --pull 12345
|
|
526
|
+
```
|
|
582
527
|
|
|
583
|
-
|
|
528
|
+
Dry-run push:
|
|
584
529
|
```bash
|
|
585
|
-
knowhow
|
|
530
|
+
knowhow cloudworker --push 9f2c1a --dry-run
|
|
586
531
|
```
|
|
587
532
|
|
|
588
533
|
---
|
|
589
534
|
|
|
590
|
-
|
|
535
|
+
## Modules
|
|
591
536
|
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
- `options.noSandbox = true`
|
|
537
|
+
All commands are under:
|
|
538
|
+
```bash
|
|
539
|
+
knowhow modules <subcommand>
|
|
540
|
+
```
|
|
597
541
|
|
|
598
|
-
|
|
599
|
-
-
|
|
600
|
-
- then config: `config.worker?.sandbox`
|
|
601
|
-
- default: host mode (`false`)
|
|
542
|
+
### `knowhow modules setup`
|
|
543
|
+
**Purpose:** Add default built-in modules to your config and install them into `./.knowhow/node_modules`.
|
|
602
544
|
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
- Exits without starting worker loop.
|
|
545
|
+
**Usage:**
|
|
546
|
+
```bash
|
|
547
|
+
knowhow modules setup [--global]
|
|
548
|
+
```
|
|
608
549
|
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
- `config.worker?.auth?.passkey?.credentialId`
|
|
550
|
+
#### Options
|
|
551
|
+
- `--global`
|
|
552
|
+
Use the global config `~/.knowhow/knowhow.json` instead of local `./.knowhow/knowhow.json`
|
|
613
553
|
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
```json
|
|
618
|
-
{
|
|
619
|
-
"error": "WORKER_LOCKED",
|
|
620
|
-
"message": "Worker is locked. Call the `unlock` tool with your passkey assertion to unlock it first."
|
|
621
|
-
}
|
|
554
|
+
**Example:**
|
|
555
|
+
```bash
|
|
556
|
+
knowhow modules setup
|
|
622
557
|
```
|
|
623
558
|
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
- `allowedPorts` (warns if unset)
|
|
629
|
-
- `maxConcurrentStreams` (default `50`)
|
|
630
|
-
- `localHost` (auto-detects `host.docker.internal` when inside Docker, otherwise `127.0.0.1`)
|
|
631
|
-
- URL rewriting behavior (config-driven)
|
|
559
|
+
Global setup:
|
|
560
|
+
```bash
|
|
561
|
+
knowhow modules setup --global
|
|
562
|
+
```
|
|
632
563
|
|
|
633
|
-
|
|
564
|
+
---
|
|
634
565
|
|
|
635
|
-
|
|
566
|
+
### `knowhow modules install [module]`
|
|
567
|
+
**Purpose:** Install a module into `./.knowhow/node_modules` and add it to your config.
|
|
568
|
+
If no module is provided, installs all installable modules already listed in config.
|
|
636
569
|
|
|
637
|
-
|
|
570
|
+
**Usage:**
|
|
638
571
|
```bash
|
|
639
|
-
knowhow
|
|
572
|
+
knowhow modules install [module] [--global] [--latest]
|
|
640
573
|
```
|
|
641
574
|
|
|
642
|
-
|
|
575
|
+
#### Options
|
|
576
|
+
- `--global` — Use global config
|
|
577
|
+
- `--latest` — Force install the latest version (bypasses package-lock)
|
|
578
|
+
|
|
579
|
+
**Examples**
|
|
580
|
+
Install a specific module:
|
|
643
581
|
```bash
|
|
644
|
-
knowhow
|
|
582
|
+
knowhow modules install @tyvm/knowhow-module-script
|
|
645
583
|
```
|
|
646
584
|
|
|
647
|
-
|
|
585
|
+
Install into global config:
|
|
648
586
|
```bash
|
|
649
|
-
knowhow
|
|
587
|
+
knowhow modules install @tyvm/knowhow-module-script --global
|
|
650
588
|
```
|
|
651
589
|
|
|
652
|
-
|
|
590
|
+
Install all modules from config:
|
|
653
591
|
```bash
|
|
654
|
-
knowhow
|
|
592
|
+
knowhow modules install
|
|
655
593
|
```
|
|
656
594
|
|
|
657
|
-
|
|
595
|
+
Install latest version of a module:
|
|
658
596
|
```bash
|
|
659
|
-
knowhow
|
|
597
|
+
knowhow modules install @tyvm/knowhow-module-script --latest
|
|
660
598
|
```
|
|
661
599
|
|
|
662
600
|
---
|
|
663
601
|
|
|
664
|
-
### `
|
|
602
|
+
### `knowhow modules list`
|
|
603
|
+
**Purpose:** List modules in your config (global and/or local).
|
|
665
604
|
|
|
666
|
-
|
|
667
|
-
Sync files between local filesystem and Knowhow FS using configured `fileMounts`.
|
|
668
|
-
|
|
669
|
-
#### Usage syntax
|
|
605
|
+
**Usage:**
|
|
670
606
|
```bash
|
|
671
|
-
knowhow
|
|
607
|
+
knowhow modules list [--global]
|
|
672
608
|
```
|
|
673
609
|
|
|
674
|
-
#### Options
|
|
675
|
-
|
|
610
|
+
#### Options
|
|
611
|
+
- `--global` — Show global config modules only
|
|
676
612
|
|
|
677
|
-
|
|
613
|
+
**Example:**
|
|
678
614
|
```bash
|
|
679
|
-
knowhow
|
|
615
|
+
knowhow modules list
|
|
680
616
|
```
|
|
681
617
|
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
### `workers`
|
|
685
|
-
|
|
686
|
-
#### Purpose
|
|
687
|
-
Manage and start registered workers.
|
|
688
|
-
|
|
689
|
-
#### Usage syntax
|
|
618
|
+
Global only:
|
|
690
619
|
```bash
|
|
691
|
-
knowhow
|
|
620
|
+
knowhow modules list --global
|
|
692
621
|
```
|
|
693
622
|
|
|
694
|
-
|
|
695
|
-
Not defined in provided source excerpts.
|
|
623
|
+
---
|
|
696
624
|
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
```
|
|
625
|
+
### `knowhow modules update`
|
|
626
|
+
**Purpose:** Check for updates to all modules in your config and update them.
|
|
627
|
+
Shows installed vs latest (with publish date) before updating.
|
|
701
628
|
|
|
629
|
+
**Usage:**
|
|
702
630
|
```bash
|
|
703
|
-
knowhow
|
|
631
|
+
knowhow modules update [--global] [-y]
|
|
704
632
|
```
|
|
705
633
|
|
|
634
|
+
#### Options
|
|
635
|
+
- `--global` — Use the global config
|
|
636
|
+
- `-y, --yes` — Skip confirmation prompt; update all outdated modules automatically
|
|
637
|
+
|
|
638
|
+
**Example:**
|
|
706
639
|
```bash
|
|
707
|
-
knowhow
|
|
640
|
+
knowhow modules update
|
|
708
641
|
```
|
|
709
642
|
|
|
710
|
-
|
|
643
|
+
Auto-update without confirmation:
|
|
711
644
|
```bash
|
|
712
|
-
knowhow
|
|
645
|
+
knowhow modules update --yes
|
|
713
646
|
```
|
|
714
647
|
|
|
715
648
|
---
|
|
716
649
|
|
|
717
|
-
|
|
650
|
+
## Git Credential Helper
|
|
718
651
|
|
|
719
|
-
|
|
720
|
-
|
|
652
|
+
### `knowhow github-credentials [action]`
|
|
653
|
+
**Purpose:** Provide GitHub credentials to Git via Git’s credential helper protocol.
|
|
654
|
+
|
|
655
|
+
Designed to be used with:
|
|
656
|
+
```bash
|
|
657
|
+
git config credential.helper 'knowhow github-credentials'
|
|
658
|
+
```
|
|
721
659
|
|
|
722
|
-
|
|
660
|
+
**Usage:**
|
|
723
661
|
```bash
|
|
724
662
|
knowhow github-credentials [action] [--repo <repo>]
|
|
725
663
|
```
|
|
726
664
|
|
|
727
665
|
#### Arguments
|
|
728
|
-
- `[action]` —
|
|
729
|
-
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
#### Behavior (from provided excerpt)
|
|
736
|
-
- If `action === "get"`:
|
|
737
|
-
- Reads stdin for git credential protocol/host lines (implementation ignores parsed host and always fetches for the repo)
|
|
738
|
-
- Fetches credentials via `KnowhowSimpleClient().getGitCredential(repo || "")`
|
|
739
|
-
- Outputs:
|
|
740
|
-
- `protocol=...`
|
|
741
|
-
- `host=...`
|
|
742
|
-
- `username=...`
|
|
743
|
-
- `password=...`
|
|
744
|
-
- If `action` is `store` or `erase`:
|
|
745
|
-
- exits successfully without output.
|
|
666
|
+
- `[action]` — Optional. Supported behaviors in the code:
|
|
667
|
+
- `get` — read credentials from stdin and output credential lines
|
|
668
|
+
- `store` — exit immediately
|
|
669
|
+
- `erase` — exit immediately
|
|
670
|
+
|
|
671
|
+
#### Options
|
|
672
|
+
- `--repo <repo>` — Repository in `owner/repo` format (e.g. `myorg/myrepo`)
|
|
746
673
|
|
|
747
674
|
#### Examples
|
|
748
675
|
|
|
749
|
-
Configure git
|
|
676
|
+
Configure git:
|
|
750
677
|
```bash
|
|
751
|
-
git config credential.helper 'knowhow github-credentials'
|
|
678
|
+
git config --global credential.helper 'knowhow github-credentials'
|
|
752
679
|
```
|
|
753
680
|
|
|
754
|
-
|
|
681
|
+
Request credentials for a repo explicitly:
|
|
755
682
|
```bash
|
|
756
|
-
knowhow github-credentials get --repo
|
|
683
|
+
knowhow github-credentials get --repo myorg/myrepo
|
|
757
684
|
```
|
|
758
685
|
|
|
759
|
-
|
|
686
|
+
> If `--repo` is not provided, the helper attempts to infer it from:
|
|
687
|
+
> `git remote get-url origin`.
|
|
760
688
|
|
|
761
|
-
|
|
689
|
+
---
|
|
762
690
|
|
|
763
|
-
|
|
764
|
-
- For `update`, npm install errors are logged and exit code is `1`.
|
|
765
|
-
- On startup, command dispatch is handled by `program.parseAsync(...)`, and the CLI follows standard Node process error handling when uncaught errors occur.
|
|
691
|
+
If you share additional source files (e.g., `src/login.ts`, `src/chat/*`, `src/fileSync.ts`, `src/commands/*` beyond what’s included), I can extend this reference to cover any commands currently missing from the snippets you provided (such as a possible `knowhow logout`, `knowhow gen` alias, or additional chat subcommands).
|