@tyvm/knowhow 0.0.89 → 0.0.91
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/.depcheckrc +31 -0
- package/CONFIG.md +52 -0
- package/README.md +344 -29
- package/WORKER.md +169 -334
- package/autodoc/chat-guide.md +540 -0
- package/autodoc/cli-reference.md +765 -0
- package/autodoc/config-reference.md +541 -0
- package/autodoc/embeddings-guide.md +566 -0
- package/autodoc/generate-guide.md +477 -0
- package/autodoc/language-plugin-guide.md +443 -0
- package/autodoc/modules-guide.md +352 -0
- package/autodoc/plugins-guide.md +720 -0
- package/autodoc/quickstart-guide.md +129 -0
- package/autodoc/skills-guide.md +468 -0
- package/autodoc/worker-guide.md +526 -0
- package/bin/knowhow.js +1 -1
- package/package.json +4 -32
- package/src/agents/tools/executeScript/index.ts +5 -0
- package/src/agents/tools/googleSearch.ts +2 -2
- package/src/agents/tools/index.ts +0 -3
- package/src/agents/tools/list.ts +0 -147
- package/src/agents/tools/loadWebpage.ts +3 -113
- package/src/ai.ts +33 -2
- package/src/auth/browserLogin.ts +10 -13
- package/src/cli.ts +63 -3
- package/src/clients/gemini.ts +96 -25
- package/src/clients/http.ts +7 -11
- package/src/clients/pricing/google.ts +122 -26
- package/src/config.ts +28 -4
- package/src/conversion.ts +24 -54
- package/src/index.ts +30 -3
- package/src/login.ts +5 -6
- package/src/plugins/language.ts +0 -4
- package/src/plugins/plugins.ts +0 -14
- package/src/plugins/url.ts +31 -12
- package/src/processors/TokenCompressor.ts +2 -2
- package/src/processors/ToolResponseCache.ts +3 -3
- package/src/processors/tools/grepToolResponse.ts +9 -4
- package/src/processors/tools/jqToolResponse.ts +11 -6
- package/src/processors/tools/listStoredToolResponses.ts +1 -1
- package/src/processors/tools/tailToolResponse.ts +9 -4
- package/src/services/GitHub.ts +2 -2
- package/src/services/KnowhowClient.ts +34 -34
- package/src/{plugins/downloader/downloader.ts → services/MediaProcessorService.ts} +109 -267
- package/src/services/S3.ts +16 -16
- package/src/services/index.ts +4 -4
- package/src/services/modules/index.ts +10 -2
- package/src/services/modules/types.ts +5 -2
- package/src/services/script-execution/ScriptExecutor.ts +29 -10
- package/src/services/script-execution/ScriptPolicy.ts +6 -2
- package/src/types.ts +1 -0
- package/src/utils/http.ts +127 -0
- package/src/workers/auth/PasskeySetup.ts +7 -11
- package/tests/clients/AIClient.test.ts +24 -21
- package/tests/manual/file-edits/figma.test.ts +3 -70
- package/tests/plugins/language/languagePlugin-content-triggers.test.ts +2 -0
- package/tests/plugins/language/languagePlugin.test.ts +2 -0
- package/tests/processors/ToolResponseCache.test.ts +2 -2
- package/tests/test.spec.ts +0 -14
- package/tests/unit/modules/moduleLoading.test.ts +7 -4
- package/tests/unit/plugins/pluginLoading.test.ts +6 -6
- package/ts_build/package.json +4 -32
- package/ts_build/src/agents/tools/ast/astAppendNode.d.ts +1 -1
- package/ts_build/src/agents/tools/ast/astAppendNode.js +2 -90
- package/ts_build/src/agents/tools/ast/astAppendNode.js.map +1 -1
- package/ts_build/src/agents/tools/ast/astDeleteNode.d.ts +1 -1
- package/ts_build/src/agents/tools/ast/astDeleteNode.js +2 -88
- package/ts_build/src/agents/tools/ast/astDeleteNode.js.map +1 -1
- package/ts_build/src/agents/tools/ast/astEditNode.d.ts +1 -1
- package/ts_build/src/agents/tools/ast/astEditNode.js +2 -90
- package/ts_build/src/agents/tools/ast/astEditNode.js.map +1 -1
- package/ts_build/src/agents/tools/ast/astGetPathForLine.d.ts +1 -1
- package/ts_build/src/agents/tools/ast/astGetPathForLine.js +2 -72
- package/ts_build/src/agents/tools/ast/astGetPathForLine.js.map +1 -1
- package/ts_build/src/agents/tools/ast/astListPaths.d.ts +1 -1
- package/ts_build/src/agents/tools/ast/astListPaths.js +2 -72
- package/ts_build/src/agents/tools/ast/astListPaths.js.map +1 -1
- package/ts_build/src/agents/tools/executeScript/index.d.ts +3 -2
- package/ts_build/src/agents/tools/executeScript/index.js +4 -1
- package/ts_build/src/agents/tools/executeScript/index.js.map +1 -1
- package/ts_build/src/agents/tools/googleSearch.js +2 -2
- package/ts_build/src/agents/tools/googleSearch.js.map +1 -1
- package/ts_build/src/agents/tools/index.d.ts +0 -3
- package/ts_build/src/agents/tools/index.js +0 -3
- package/ts_build/src/agents/tools/index.js.map +1 -1
- package/ts_build/src/agents/tools/list.js +0 -138
- package/ts_build/src/agents/tools/list.js.map +1 -1
- package/ts_build/src/agents/tools/loadWebpage.js +1 -89
- package/ts_build/src/agents/tools/loadWebpage.js.map +1 -1
- package/ts_build/src/agents/tools/textSearch.d.ts +1 -1
- package/ts_build/src/ai.js +18 -1
- package/ts_build/src/ai.js.map +1 -1
- package/ts_build/src/auth/browserLogin.js +7 -7
- package/ts_build/src/auth/browserLogin.js.map +1 -1
- package/ts_build/src/cli.d.ts +1 -1
- package/ts_build/src/cli.js +47 -1
- package/ts_build/src/cli.js.map +1 -1
- package/ts_build/src/clients/gemini.d.ts +1 -73
- package/ts_build/src/clients/gemini.js +57 -19
- package/ts_build/src/clients/gemini.js.map +1 -1
- package/ts_build/src/clients/http.js +5 -9
- package/ts_build/src/clients/http.js.map +1 -1
- package/ts_build/src/clients/pricing/google.d.ts +17 -73
- package/ts_build/src/clients/pricing/google.js +47 -10
- package/ts_build/src/clients/pricing/google.js.map +1 -1
- package/ts_build/src/config.js +17 -2
- package/ts_build/src/config.js.map +1 -1
- package/ts_build/src/conversion.d.ts +1 -4
- package/ts_build/src/conversion.js +12 -27
- package/ts_build/src/conversion.js.map +1 -1
- package/ts_build/src/index.d.ts +4 -0
- package/ts_build/src/index.js +19 -3
- package/ts_build/src/index.js.map +1 -1
- package/ts_build/src/login.js +5 -4
- package/ts_build/src/login.js.map +1 -1
- package/ts_build/src/plugins/downloader/downloader.js +3 -3
- package/ts_build/src/plugins/downloader/downloader.js.map +1 -1
- package/ts_build/src/plugins/language.js.map +1 -1
- package/ts_build/src/plugins/plugins.js +0 -14
- package/ts_build/src/plugins/plugins.js.map +1 -1
- package/ts_build/src/plugins/tree-sitter/editor.d.ts +3 -32
- package/ts_build/src/plugins/tree-sitter/editor.js +6 -208
- package/ts_build/src/plugins/tree-sitter/editor.js.map +1 -1
- package/ts_build/src/plugins/tree-sitter/parser.d.ts +19 -54
- package/ts_build/src/plugins/tree-sitter/parser.js +19 -293
- package/ts_build/src/plugins/tree-sitter/parser.js.map +1 -1
- package/ts_build/src/plugins/tree-sitter/simple-paths.d.ts +2 -15
- package/ts_build/src/plugins/tree-sitter/simple-paths.js +2 -324
- package/ts_build/src/plugins/tree-sitter/simple-paths.js.map +1 -1
- package/ts_build/src/plugins/url.js +27 -8
- package/ts_build/src/plugins/url.js.map +1 -1
- package/ts_build/src/processors/TokenCompressor.js +2 -2
- package/ts_build/src/processors/TokenCompressor.js.map +1 -1
- package/ts_build/src/processors/ToolResponseCache.js +3 -3
- package/ts_build/src/processors/ToolResponseCache.js.map +1 -1
- package/ts_build/src/processors/tools/grepToolResponse.d.ts +3 -1
- package/ts_build/src/processors/tools/grepToolResponse.js +8 -2
- package/ts_build/src/processors/tools/grepToolResponse.js.map +1 -1
- package/ts_build/src/processors/tools/jqToolResponse.d.ts +3 -1
- package/ts_build/src/processors/tools/jqToolResponse.js +10 -4
- package/ts_build/src/processors/tools/jqToolResponse.js.map +1 -1
- package/ts_build/src/processors/tools/listStoredToolResponses.js +1 -1
- package/ts_build/src/processors/tools/listStoredToolResponses.js.map +1 -1
- package/ts_build/src/processors/tools/tailToolResponse.d.ts +3 -1
- package/ts_build/src/processors/tools/tailToolResponse.js +8 -2
- package/ts_build/src/processors/tools/tailToolResponse.js.map +1 -1
- package/ts_build/src/services/GitHub.js +2 -2
- package/ts_build/src/services/GitHub.js.map +1 -1
- package/ts_build/src/services/KnowhowClient.d.ts +29 -29
- package/ts_build/src/services/KnowhowClient.js +33 -33
- package/ts_build/src/services/KnowhowClient.js.map +1 -1
- package/ts_build/src/services/MediaProcessorService.d.ts +22 -0
- package/ts_build/src/services/MediaProcessorService.js +215 -0
- package/ts_build/src/services/MediaProcessorService.js.map +1 -0
- package/ts_build/src/services/S3.js +12 -18
- package/ts_build/src/services/S3.js.map +1 -1
- package/ts_build/src/services/index.d.ts +3 -2
- package/ts_build/src/services/index.js +3 -3
- package/ts_build/src/services/index.js.map +1 -1
- package/ts_build/src/services/modules/index.js +10 -2
- package/ts_build/src/services/modules/index.js.map +1 -1
- package/ts_build/src/services/modules/types.d.ts +5 -2
- package/ts_build/src/services/script-execution/ScriptExecutor.js +22 -7
- package/ts_build/src/services/script-execution/ScriptExecutor.js.map +1 -1
- package/ts_build/src/services/script-execution/ScriptPolicy.d.ts +1 -1
- package/ts_build/src/services/script-execution/ScriptPolicy.js +4 -2
- package/ts_build/src/services/script-execution/ScriptPolicy.js.map +1 -1
- package/ts_build/src/types.d.ts +1 -0
- package/ts_build/src/types.js +1 -0
- package/ts_build/src/types.js.map +1 -1
- package/ts_build/src/utils/http.d.ts +27 -0
- package/ts_build/src/utils/http.js +98 -0
- package/ts_build/src/utils/http.js.map +1 -0
- package/ts_build/src/workers/auth/PasskeySetup.js +6 -7
- package/ts_build/src/workers/auth/PasskeySetup.js.map +1 -1
- package/ts_build/tests/clients/AIClient.test.js +11 -14
- package/ts_build/tests/clients/AIClient.test.js.map +1 -1
- package/ts_build/tests/manual/file-edits/figma.test.d.ts +0 -1
- package/ts_build/tests/manual/file-edits/figma.test.js +1 -46
- package/ts_build/tests/manual/file-edits/figma.test.js.map +1 -1
- package/ts_build/tests/plugins/language/languagePlugin-content-triggers.test.js +2 -0
- package/ts_build/tests/plugins/language/languagePlugin-content-triggers.test.js.map +1 -1
- package/ts_build/tests/plugins/language/languagePlugin.test.js +2 -0
- package/ts_build/tests/plugins/language/languagePlugin.test.js.map +1 -1
- package/ts_build/tests/processors/ToolResponseCache.test.js +2 -2
- package/ts_build/tests/processors/ToolResponseCache.test.js.map +1 -1
- package/ts_build/tests/test.spec.js +0 -14
- package/ts_build/tests/test.spec.js.map +1 -1
- package/ts_build/tests/tree-sitter/tree-sitter.test.d.ts +0 -1
- package/ts_build/tests/tree-sitter/tree-sitter.test.js +2 -183
- package/ts_build/tests/tree-sitter/tree-sitter.test.js.map +1 -1
- package/ts_build/tests/unit/modules/moduleLoading.test.js +6 -4
- package/ts_build/tests/unit/modules/moduleLoading.test.js.map +1 -1
- package/ts_build/tests/unit/plugins/pluginLoading.test.js +4 -4
- package/ts_build/tests/unit/plugins/pluginLoading.test.js.map +1 -1
- package/autodoc/chat.mdx +0 -20
- package/autodoc/cli.mdx +0 -11
- package/autodoc/plugins/asana.mdx +0 -47
- package/autodoc/plugins/downloader/downloader.mdx +0 -38
- package/autodoc/plugins/downloader/plugin.mdx +0 -37
- package/autodoc/plugins/downloader/types.mdx +0 -42
- package/autodoc/plugins/embedding.mdx +0 -41
- package/autodoc/plugins/figma.mdx +0 -45
- package/autodoc/plugins/github.mdx +0 -40
- package/autodoc/plugins/jira.mdx +0 -46
- package/autodoc/plugins/language.mdx +0 -37
- package/autodoc/plugins/linear.mdx +0 -35
- package/autodoc/plugins/notion.mdx +0 -38
- package/autodoc/plugins/plugins.mdx +0 -59
- package/autodoc/plugins/types.mdx +0 -51
- package/autodoc/plugins/vim.mdx +0 -39
- package/autodoc/tools/addInternalTools.mdx +0 -1
- package/autodoc/tools/agentCall.mdx +0 -1
- package/autodoc/tools/asana/definitions.mdx +0 -10
- package/autodoc/tools/asana/index.mdx +0 -12
- package/autodoc/tools/askHuman.mdx +0 -1
- package/autodoc/tools/callPlugin.mdx +0 -1
- package/autodoc/tools/embeddingSearch.mdx +0 -1
- package/autodoc/tools/execCommand.mdx +0 -1
- package/autodoc/tools/fileSearch.mdx +0 -1
- package/autodoc/tools/finalAnswer.mdx +0 -1
- package/autodoc/tools/github/definitions.mdx +0 -6
- package/autodoc/tools/github/index.mdx +0 -8
- package/autodoc/tools/index.mdx +0 -14
- package/autodoc/tools/lintFile.mdx +0 -7
- package/autodoc/tools/list.mdx +0 -16
- package/autodoc/tools/modifyFile.mdx +0 -7
- package/autodoc/tools/patch.mdx +0 -9
- package/autodoc/tools/readBlocks.mdx +0 -1
- package/autodoc/tools/readFile.mdx +0 -1
- package/autodoc/tools/scanFile.mdx +0 -1
- package/autodoc/tools/textSearch.mdx +0 -6
- package/autodoc/tools/types/fileblock.mdx +0 -1
- package/autodoc/tools/visionTool.mdx +0 -1
- package/autodoc/tools/writeFile.mdx +0 -1
- package/benchmarks/.dockerignore +0 -7
- package/benchmarks/README.md +0 -166
- package/benchmarks/docker/Dockerfile +0 -68
- package/benchmarks/example-config.yml +0 -27
- package/benchmarks/jest.config.js +0 -13
- package/benchmarks/package-lock.json +0 -4297
- package/benchmarks/package.json +0 -39
- package/benchmarks/results/27b0a06/2025-09-27/xai/xai-grok-code-fast-1.json +0 -2909
- package/benchmarks/results/4057aed/2025-08-14/anthropic/anthropic-claude-sonnet-4-20250514.json +0 -1671
- package/benchmarks/results/4542435/2025-08-05/lms/lms-openai-gpt-oss-20b.json +0 -2814
- package/benchmarks/results/4542435/2025-08-05/lms/lms-qwen-qwen3-30b-a3b-2507.json +0 -2014
- package/benchmarks/results/4fb9125/2025-08-07/anthropic/anthropic-claude-sonnet-4-20250514.json +0 -3121
- package/benchmarks/results/5766aee/2025-08-02/lms-qwen/qwen3-coder-30b.json +0 -98
- package/benchmarks/results/6d73808/2025-08-07/openai/openai-gpt-5.json +0 -3256
- package/benchmarks/results/77bf0a6/2025-08-02/lms-qwen/qwen3-30b-a3b-2507.json +0 -4298
- package/benchmarks/results/8c0d445/2025-08-03/anthropic/anthropic-claude-sonnet-4-20250514.json +0 -3031
- package/benchmarks/results/8c0d445/2025-08-03/openai/openai-gpt-4.1-2025-04-14.json +0 -2990
- package/benchmarks/results/ac6b2ab/2025-08-03/anthropic/anthropic-claude-sonnet-4-20250514.json +0 -3256
- package/benchmarks/results/ac6b2ab/2025-08-03/lms/lms-qwen-qwen3-coder-30b.json +0 -3007
- package/benchmarks/results/ac6b2ab/2025-08-03/openai/openai-gpt-4.1-2025-04-14.json +0 -3256
- package/benchmarks/results/ac6b2ab/2025-08-03/openai/openai-gpt-4.1-mini-2025-04-14.json +0 -3036
- package/benchmarks/results/ac6b2ab/2025-08-03/openai/openai-gpt-4.1-nano-2025-04-14.json +0 -3280
- package/benchmarks/results/adff675/2025-08-04/lms/lms-qwen-qwen3-30b-a3b-2507.json +0 -1920
- package/benchmarks/results/adff675/2025-08-04/lms/lms-qwen-qwen3-coder-30b.json +0 -3281
- package/benchmarks/results/b502ed9/2025-08-03/lms-qwen/qwen3-coder-30b.json +0 -2896
- package/benchmarks/results/d1a8129/2025-08-03/lms/lms-qwen-qwen3-coder-30b.json +0 -3011
- package/benchmarks/results/e60471c/2025-08-03/lms/qwen3-30b-a3b-2507.json +0 -3003
- package/benchmarks/scripts/build-and-run.sh +0 -47
- package/benchmarks/scripts/clone-exercism.sh +0 -92
- package/benchmarks/scripts/validate.sh +0 -48
- package/benchmarks/src/__tests__/runner.test.ts +0 -27
- package/benchmarks/src/cli.ts +0 -90
- package/benchmarks/src/evaluators/EvaluatorRegistry.ts +0 -64
- package/benchmarks/src/evaluators/JavaScriptEvaluator.ts +0 -183
- package/benchmarks/src/evaluators/index.ts +0 -3
- package/benchmarks/src/evaluators/types.ts +0 -22
- package/benchmarks/src/index.ts +0 -3
- package/benchmarks/src/providers.ts +0 -13
- package/benchmarks/src/runner.ts +0 -824
- package/benchmarks/src/types.ts +0 -63
- package/benchmarks/tsconfig.json +0 -19
- package/leaderboard/README.md +0 -148
- package/leaderboard/app/api/benchmark-data/route.ts +0 -131
- package/leaderboard/app/api/benchmark-detail/route.ts +0 -172
- package/leaderboard/app/details/[model]/[provider]/[language]/page.tsx +0 -501
- package/leaderboard/app/exercise/[model]/[provider]/[language]/[exercise]/page.tsx +0 -375
- package/leaderboard/app/globals.css +0 -27
- package/leaderboard/app/layout.tsx +0 -21
- package/leaderboard/app/page.tsx +0 -170
- package/leaderboard/components/LeaderboardTable.tsx +0 -168
- package/leaderboard/components/PerformanceChart.tsx +0 -109
- package/leaderboard/next-env.d.ts +0 -5
- package/leaderboard/next.config.js +0 -4
- package/leaderboard/package-lock.json +0 -6363
- package/leaderboard/package.json +0 -28
- package/leaderboard/postcss.config.js +0 -6
- package/leaderboard/tailwind.config.js +0 -17
- package/leaderboard/tsconfig.json +0 -28
- package/leaderboard/types/benchmark.ts +0 -67
- package/leaderboard/utils/dataProcessor.ts +0 -33
- package/src/agents/tools/asana/definitions.ts +0 -199
- package/src/agents/tools/asana/index.ts +0 -108
- package/src/agents/tools/ast/astAppendNode.ts +0 -90
- package/src/agents/tools/ast/astDeleteNode.ts +0 -88
- package/src/agents/tools/ast/astEditNode.ts +0 -95
- package/src/agents/tools/ast/astGetPathForLine.ts +0 -73
- package/src/agents/tools/ast/astListPaths.ts +0 -66
- package/src/agents/tools/ast/index.ts +0 -7
- package/src/agents/tools/github/definitions.ts +0 -89
- package/src/agents/tools/github/index.ts +0 -67
- package/src/chat-old.ts +0 -446
- package/src/plugins/asana.ts +0 -146
- package/src/plugins/downloader/plugin.ts +0 -103
- package/src/plugins/downloader/types.ts +0 -92
- package/src/plugins/figma.ts +0 -158
- package/src/plugins/github.ts +0 -219
- package/src/plugins/jira.ts +0 -115
- package/src/plugins/linear.ts +0 -230
- package/src/plugins/notion.ts +0 -179
- package/src/plugins/tree-sitter/editor.ts +0 -369
- package/src/plugins/tree-sitter/lang-packs/index.ts +0 -23
- package/src/plugins/tree-sitter/lang-packs/java.ts +0 -59
- package/src/plugins/tree-sitter/lang-packs/javascript.ts +0 -57
- package/src/plugins/tree-sitter/lang-packs/python.ts +0 -45
- package/src/plugins/tree-sitter/lang-packs/types.ts +0 -79
- package/src/plugins/tree-sitter/lang-packs/typescript.ts +0 -49
- package/src/plugins/tree-sitter/parser.ts +0 -470
- package/src/plugins/tree-sitter/simple-paths.ts +0 -467
- package/test-comprehensive.ts +0 -31
- package/tests/tree-sitter/editor.test.ts +0 -113
- package/tests/tree-sitter/invalid.test.ts +0 -299
- package/tests/tree-sitter/paths/common-edits.test.ts +0 -564
- package/tests/tree-sitter/paths/debug-exact-position.test.ts +0 -44
- package/tests/tree-sitter/paths/debug-line-indexing.test.ts +0 -49
- package/tests/tree-sitter/paths/debug-paths.test.ts +0 -90
- package/tests/tree-sitter/paths/paths.test.ts +0 -170
- package/tests/tree-sitter/paths/simple-paths.test.ts +0 -367
- package/tests/tree-sitter/sample-after.ts +0 -48
- package/tests/tree-sitter/sample-before.ts +0 -25
- package/tests/tree-sitter/test-files/completely-broken.ts +0 -7
- package/tests/tree-sitter/test-files/duplicate-braces.ts +0 -39
- package/tests/tree-sitter/test-files/invalid-nesting.ts +0 -39
- package/tests/tree-sitter/test-files/malformed-signature.ts +0 -39
- package/tests/tree-sitter/test-files/mismatched-parens.ts +0 -39
- package/tests/tree-sitter/test-files/missing-semicolon.ts +0 -39
- package/tests/tree-sitter/test-files/partially-broken.ts +0 -20
- package/tests/tree-sitter/test-files/specific-errors.ts +0 -14
- package/tests/tree-sitter/test-files/unclosed-string.ts +0 -39
- package/tests/tree-sitter/tree-sitter.test.ts +0 -251
|
@@ -0,0 +1,540 @@
|
|
|
1
|
+
# `knowhow chat` Guide
|
|
2
|
+
|
|
3
|
+
`knowhow chat` is the primary interactive interface for the **Knowhow CLI**. It runs a REPL-style chat loop where you type messages and can control behavior using **slash commands** (`/…`).
|
|
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.
|
|
11
|
+
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
## 1) Starting a chat session
|
|
15
|
+
|
|
16
|
+
Start chat with:
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
knowhow chat
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
You then enter a prompt loop where you can type normal messages or slash commands.
|
|
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)
|
|
36
|
+
|
|
37
|
+
Examples (illustrative—verify with `--help`):
|
|
38
|
+
```bash
|
|
39
|
+
knowhow chat --agent Patcher
|
|
40
|
+
knowhow chat --renderer compact
|
|
41
|
+
knowhow chat --voice
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
---
|
|
45
|
+
|
|
46
|
+
## 2) Chat modes (agent, attached, voice)
|
|
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
|
|
52
|
+
|
|
53
|
+
### Agent mode
|
|
54
|
+
You’re using a configured agent to respond.
|
|
55
|
+
|
|
56
|
+
In this mode, commands like `/agent`, `/agents`, `/render`, `/search`, `/multi`, etc. are usually available.
|
|
57
|
+
|
|
58
|
+
### Attached mode (`agent:attached`)
|
|
59
|
+
In attached mode, Knowhow is connected to a running agent task/session and you can inspect/steer it using attached-only commands (if provided by your agent module).
|
|
60
|
+
|
|
61
|
+
### Voice mode
|
|
62
|
+
If voice is available in your build, voice mode switches input handling so speech is transcribed and sent into the chat loop.
|
|
63
|
+
|
|
64
|
+
---
|
|
65
|
+
|
|
66
|
+
## 3) Built-in slash commands (`/…`)
|
|
67
|
+
|
|
68
|
+
Below is the command reference for the commands known to be implemented by the chat modules in the Knowhow codebase (agent/search/sessions/renderer/shell/voice modules).
|
|
69
|
+
If your `Commands:` list includes additional items, use those as well—modules register commands at runtime.
|
|
70
|
+
|
|
71
|
+
### Agent switching
|
|
72
|
+
- **`/agent <name>`** — switch to a specific configured agent
|
|
73
|
+
**Example**
|
|
74
|
+
```text
|
|
75
|
+
/agent Patcher
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
- **`/agents`** — list configured agents (and/or selection help)
|
|
79
|
+
**Example**
|
|
80
|
+
```text
|
|
81
|
+
/agents
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
> In attached mode, some agent-control commands may be restricted to attached mode only (see below).
|
|
85
|
+
|
|
86
|
+
### Attached-mode controls (if provided by your agent module)
|
|
87
|
+
These commands are typically only enabled when you are attached to a running agent task:
|
|
88
|
+
|
|
89
|
+
- **`/pause`** — pause the attached agent
|
|
90
|
+
- **`/unpause`** — resume the attached agent
|
|
91
|
+
- **`/kill`** — terminate the attached agent task (and typically detach)
|
|
92
|
+
- **`/detach`** — detach from the attached agent task
|
|
93
|
+
- **`/done`** — finish/exit the current attached interaction
|
|
94
|
+
|
|
95
|
+
**Examples**
|
|
96
|
+
```text
|
|
97
|
+
/pause
|
|
98
|
+
/unpause
|
|
99
|
+
/detach
|
|
100
|
+
/done
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
### Multi-line input
|
|
104
|
+
- **`/multi`** — start a multi-line input editor for your *next* message (or until you exit the editor, depending on implementation)
|
|
105
|
+
|
|
106
|
+
**Example**
|
|
107
|
+
```text
|
|
108
|
+
/multi
|
|
109
|
+
Write a runbook for:
|
|
110
|
+
1) Setup
|
|
111
|
+
2) Daily use
|
|
112
|
+
3) Troubleshooting
|
|
113
|
+
|
|
114
|
+
Include a checklist.
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
### Rendering control
|
|
118
|
+
- **`/render`** — show current renderer / help for renderer switching
|
|
119
|
+
- **`/render <basic|compact|fancy>`** — switch built-in renderer
|
|
120
|
+
|
|
121
|
+
**Examples**
|
|
122
|
+
```text
|
|
123
|
+
/render basic
|
|
124
|
+
/render compact
|
|
125
|
+
/render fancy
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
#### Custom renderer support (from the renderer module)
|
|
129
|
+
Depending on build support, `/render` may also load a renderer from:
|
|
130
|
+
- a path
|
|
131
|
+
- an npm package specifier
|
|
132
|
+
|
|
133
|
+
**Examples**
|
|
134
|
+
```text
|
|
135
|
+
/render ./my-renderer.js
|
|
136
|
+
/render @my-org/knowhow-renderer
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
### Search
|
|
140
|
+
- **`/search`** — enter the interactive search loop (Search module)
|
|
141
|
+
|
|
142
|
+
**Example**
|
|
143
|
+
```text
|
|
144
|
+
/search
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
#### Inside `/search` (interactive sub-commands)
|
|
148
|
+
Within the search loop, Knowhow accepts:
|
|
149
|
+
|
|
150
|
+
- **`next`** — show the next result
|
|
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.
|
|
156
|
+
|
|
157
|
+
**Example session**
|
|
158
|
+
```text
|
|
159
|
+
/search
|
|
160
|
+
searching: "postgres query planner tuning"
|
|
161
|
+
|
|
162
|
+
### TEXT
|
|
163
|
+
...match content...
|
|
164
|
+
|
|
165
|
+
### METADATA
|
|
166
|
+
{ "source": "...", "chunk": 12 }
|
|
167
|
+
|
|
168
|
+
searching: next
|
|
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
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
### Session management (attach/resume/logs and listing)
|
|
180
|
+
These are implemented by the Sessions module.
|
|
181
|
+
|
|
182
|
+
- **`/attach [taskId] [--completed]`**
|
|
183
|
+
- With **no args**, opens an interactive selection of attachable sessions/tasks.
|
|
184
|
+
- With `<taskId>`, attaches directly.
|
|
185
|
+
- `--completed` may include completed items in the chooser; completed items are routed to **`/resume`**.
|
|
186
|
+
|
|
187
|
+
**Examples**
|
|
188
|
+
```text
|
|
189
|
+
/attach
|
|
190
|
+
/attach 8d9f1c2b-3a4e-...
|
|
191
|
+
/attach --completed
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
- **`/resume [taskId]`**
|
|
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
|
|
236
|
+
|
|
237
|
+
**Examples**
|
|
238
|
+
```text
|
|
239
|
+
/!
|
|
240
|
+
# (interactive shell mode, if your build uses it)
|
|
241
|
+
|
|
242
|
+
/!! ls -la
|
|
243
|
+
/!! cat ./build.log | tail -n 200
|
|
244
|
+
```
|
|
245
|
+
|
|
246
|
+
**Typical workflow**
|
|
247
|
+
```text
|
|
248
|
+
/!
|
|
249
|
+
npm test
|
|
250
|
+
/!!
|
|
251
|
+
npm test
|
|
252
|
+
# then ask the AI to explain failures based on captured output
|
|
253
|
+
```
|
|
254
|
+
|
|
255
|
+
### Voice input (if available)
|
|
256
|
+
If your build includes voice support, the Voice module typically exposes a command like:
|
|
257
|
+
|
|
258
|
+
- **`/voice`** — toggle voice mode on/off
|
|
259
|
+
|
|
260
|
+
**Example**
|
|
261
|
+
```text
|
|
262
|
+
/voice
|
|
263
|
+
```
|
|
264
|
+
|
|
265
|
+
If `/voice` isn’t present, voice may be controlled only via CLI flags—check:
|
|
266
|
+
```bash
|
|
267
|
+
knowhow chat --help
|
|
268
|
+
```
|
|
269
|
+
|
|
270
|
+
---
|
|
271
|
+
|
|
272
|
+
## 4) Switching agents (`/agent` and `/agents`)
|
|
273
|
+
|
|
274
|
+
### List agents
|
|
275
|
+
```text
|
|
276
|
+
/agents
|
|
277
|
+
```
|
|
278
|
+
|
|
279
|
+
### Switch to a configured agent
|
|
280
|
+
```text
|
|
281
|
+
/agent <AgentName>
|
|
282
|
+
```
|
|
283
|
+
|
|
284
|
+
**Example**
|
|
285
|
+
```text
|
|
286
|
+
/agents
|
|
287
|
+
/agent Researcher
|
|
288
|
+
Summarize the tradeoffs between two approaches...
|
|
289
|
+
```
|
|
290
|
+
|
|
291
|
+
> If you attach/resume a session, Knowhow may also restore the session’s agent context (when the agent still exists in your `knowhow.json`).
|
|
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).
|
|
298
|
+
|
|
299
|
+
**Example**
|
|
300
|
+
```text
|
|
301
|
+
/multi
|
|
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
|
|
313
|
+
```
|
|
314
|
+
|
|
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.
|
|
321
|
+
|
|
322
|
+
**Example**
|
|
323
|
+
```text
|
|
324
|
+
/!
|
|
325
|
+
ls -la
|
|
326
|
+
cat package.json
|
|
327
|
+
```
|
|
328
|
+
|
|
329
|
+
### `/!!` — send shell output to the AI
|
|
330
|
+
Use `/!!` when you want Knowhow to *capture* command output and include it in the AI context.
|
|
331
|
+
|
|
332
|
+
**Example**
|
|
333
|
+
```text
|
|
334
|
+
/!! npm test --silent
|
|
335
|
+
```
|
|
336
|
+
|
|
337
|
+
Then ask:
|
|
338
|
+
```text
|
|
339
|
+
What caused the failure, and what minimal changes should I make?
|
|
340
|
+
```
|
|
341
|
+
|
|
342
|
+
> **Safety note:** Shell commands run on your machine. Be careful with commands that modify or delete files.
|
|
343
|
+
|
|
344
|
+
---
|
|
345
|
+
|
|
346
|
+
## 7) Session management (attach/resume and listing)
|
|
347
|
+
|
|
348
|
+
Think of sessions in two categories:
|
|
349
|
+
- **Attach** to a **running** task/taskId
|
|
350
|
+
- **Resume** a **completed/saved** task/taskId
|
|
351
|
+
|
|
352
|
+
### List sessions/tasks
|
|
353
|
+
```text
|
|
354
|
+
/sessions
|
|
355
|
+
```
|
|
356
|
+
|
|
357
|
+
Include completed items:
|
|
358
|
+
```text
|
|
359
|
+
/sessions --completed
|
|
360
|
+
```
|
|
361
|
+
|
|
362
|
+
CSV output:
|
|
363
|
+
```text
|
|
364
|
+
/sessions --completed --csv
|
|
365
|
+
```
|
|
366
|
+
|
|
367
|
+
### Attach to a running task
|
|
368
|
+
```text
|
|
369
|
+
/attach
|
|
370
|
+
```
|
|
371
|
+
|
|
372
|
+
Direct attach:
|
|
373
|
+
```text
|
|
374
|
+
/attach <taskId>
|
|
375
|
+
```
|
|
376
|
+
|
|
377
|
+
### Resume a saved/completed session
|
|
378
|
+
Resume interactively:
|
|
379
|
+
```text
|
|
380
|
+
/resume
|
|
381
|
+
```
|
|
382
|
+
|
|
383
|
+
Resume by id:
|
|
384
|
+
```text
|
|
385
|
+
/resume <taskId>
|
|
386
|
+
```
|
|
387
|
+
|
|
388
|
+
### View logs from attached agent
|
|
389
|
+
```text
|
|
390
|
+
/attach <taskId>
|
|
391
|
+
/logs
|
|
392
|
+
```
|
|
393
|
+
|
|
394
|
+
---
|
|
395
|
+
|
|
396
|
+
## 8) Renderers (basic, compact, fancy) and switching with `/render`
|
|
397
|
+
|
|
398
|
+
Use renderers to change how output appears in your terminal.
|
|
399
|
+
|
|
400
|
+
### Switch renderer
|
|
401
|
+
```text
|
|
402
|
+
/render basic
|
|
403
|
+
/render compact
|
|
404
|
+
/render fancy
|
|
405
|
+
```
|
|
406
|
+
|
|
407
|
+
### Custom renderers (if supported)
|
|
408
|
+
```text
|
|
409
|
+
/render ./my-renderer.js
|
|
410
|
+
/render @my-org/knowhow-renderer
|
|
411
|
+
```
|
|
412
|
+
|
|
413
|
+
**Example flow**
|
|
414
|
+
```text
|
|
415
|
+
/render compact
|
|
416
|
+
Write release notes for version 1.4.2 based on these changes:
|
|
417
|
+
(multi-line text...)
|
|
418
|
+
```
|
|
419
|
+
|
|
420
|
+
---
|
|
421
|
+
|
|
422
|
+
## 9) Voice input (if available)
|
|
423
|
+
|
|
424
|
+
If voice is enabled in your build, toggle voice mode with:
|
|
425
|
+
|
|
426
|
+
```text
|
|
427
|
+
/voice
|
|
428
|
+
```
|
|
429
|
+
|
|
430
|
+
Then speak your prompt. Knowhow will transcribe and send it into the same pipeline as typed input.
|
|
431
|
+
|
|
432
|
+
If `/voice` isn’t available, use startup flags (check `knowhow chat --help`).
|
|
433
|
+
|
|
434
|
+
---
|
|
435
|
+
|
|
436
|
+
## 10) Custom agents (`knowhow.json` → `agents` array)
|
|
437
|
+
|
|
438
|
+
You can define custom agents in `knowhow.json` under an `agents` array.
|
|
439
|
+
|
|
440
|
+
### Example `knowhow.json` with custom agents
|
|
441
|
+
|
|
442
|
+
```json
|
|
443
|
+
{
|
|
444
|
+
"agents": [
|
|
445
|
+
{
|
|
446
|
+
"name": "Patcher",
|
|
447
|
+
"description": "Edits code safely and provides patch-style output.",
|
|
448
|
+
"model": "gpt-4.1-mini",
|
|
449
|
+
"provider": "openai",
|
|
450
|
+
"tools": ["repo", "diff", "tests"],
|
|
451
|
+
"systemPrompt": "You are a careful code patcher. Make minimal changes, explain reasoning, and include a test plan."
|
|
452
|
+
},
|
|
453
|
+
{
|
|
454
|
+
"name": "Researcher",
|
|
455
|
+
"description": "Focuses on explanation, tradeoffs, and decision guidance.",
|
|
456
|
+
"model": "gpt-4.1-mini",
|
|
457
|
+
"provider": "openai",
|
|
458
|
+
"tools": ["web", "search"],
|
|
459
|
+
"systemPrompt": "You are a research assistant. Provide sourced tradeoffs and clear recommendations."
|
|
460
|
+
}
|
|
461
|
+
]
|
|
462
|
+
}
|
|
463
|
+
```
|
|
464
|
+
|
|
465
|
+
### Use your custom agents in chat
|
|
466
|
+
```text
|
|
467
|
+
/agents
|
|
468
|
+
/agent Researcher
|
|
469
|
+
Ask knowhow: What are the tradeoffs between approach A and approach B?
|
|
470
|
+
```
|
|
471
|
+
|
|
472
|
+
> **Field names can vary by version/build.** The key requirement is that each agent has a unique **`name`** so it can be selected via `/agent <name>`.
|
|
473
|
+
|
|
474
|
+
---
|
|
475
|
+
|
|
476
|
+
## Practical examples
|
|
477
|
+
|
|
478
|
+
### Example A: Switch agent + compact renderer + normal prompt
|
|
479
|
+
```text
|
|
480
|
+
/agents
|
|
481
|
+
/agent Researcher
|
|
482
|
+
/render compact
|
|
483
|
+
Summarize the pros/cons of using RAG vs fine-tuning for my product.
|
|
484
|
+
```
|
|
485
|
+
|
|
486
|
+
### Example B: Multi-line spec
|
|
487
|
+
```text
|
|
488
|
+
/multi
|
|
489
|
+
You are helping me design a CLI command system.
|
|
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
|
|
500
|
+
```
|
|
501
|
+
|
|
502
|
+
### Example C: Run shell command and ask the AI to interpret
|
|
503
|
+
```text
|
|
504
|
+
/!! cat ./build.log | tail -n 200
|
|
505
|
+
What does the failure indicate, and what is the likely fix?
|
|
506
|
+
```
|
|
507
|
+
|
|
508
|
+
### Example D: Attach to a running task and inspect logs
|
|
509
|
+
```text
|
|
510
|
+
/sessions
|
|
511
|
+
/attach <taskId>
|
|
512
|
+
/logs 30
|
|
513
|
+
```
|
|
514
|
+
|
|
515
|
+
### Example E: Resume a completed session later
|
|
516
|
+
```text
|
|
517
|
+
/resume <taskId>
|
|
518
|
+
Add a brief test plan for the next iteration.
|
|
519
|
+
```
|
|
520
|
+
|
|
521
|
+
---
|
|
522
|
+
|
|
523
|
+
## Quick command reference
|
|
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).
|