@octocodeai/octocode-tools-core 17.0.2 → 18.1.0

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.
Files changed (220) hide show
  1. package/README.md +266 -123
  2. package/dist/direct.d.ts +1 -1
  3. package/dist/direct.js +51 -36
  4. package/dist/github/canonicalRepo.d.ts +14 -0
  5. package/dist/github/codeSearch/matchPositions.d.ts +11 -0
  6. package/dist/github/codeSearch.d.ts +2 -1
  7. package/dist/github/compare.d.ts +51 -0
  8. package/dist/github/dateWindow.d.ts +4 -0
  9. package/dist/github/discussions.d.ts +45 -0
  10. package/dist/github/githubAPI.d.ts +7 -13
  11. package/dist/github/history/commitFiles.d.ts +39 -0
  12. package/dist/github/history.d.ts +1 -0
  13. package/dist/github/issues/types.d.ts +8 -8
  14. package/dist/github/prTransformation.d.ts +24 -25
  15. package/dist/github/queryBuilders/base.d.ts +0 -1
  16. package/dist/github/queryBuilders/issues.d.ts +0 -6
  17. package/dist/github/releases.d.ts +9 -1
  18. package/dist/github/responseHeaders.d.ts +6 -0
  19. package/dist/index.d.ts +7 -6
  20. package/dist/index.js +55 -40
  21. package/dist/providers/github/githubPullRequests.d.ts +9 -0
  22. package/dist/providers/github/paginationMetadata.d.ts +6 -5
  23. package/dist/providers/providerQueries.d.ts +11 -6
  24. package/dist/providers/providerResults.d.ts +9 -1
  25. package/dist/schema.d.ts +0 -1
  26. package/dist/schema.js +1 -2
  27. package/dist/scheme/pagination.d.ts +5 -13
  28. package/dist/scheme/responseEnvelope.d.ts +28 -22
  29. package/dist/security/bridge.d.ts +3 -2
  30. package/dist/shared/config/index.d.ts +0 -1
  31. package/dist/shared/config/index.js +1 -1
  32. package/dist/shared/languageSelectors/classify.d.ts +2 -2
  33. package/dist/shared/languageSelectors/data.d.ts +4 -4
  34. package/dist/shared/languageSelectors.d.ts +1 -1
  35. package/dist/shared/paths.d.ts +1 -4
  36. package/dist/tools/directToolCatalog/toolCatalogDefinitions.d.ts +10 -11
  37. package/dist/tools/directToolCatalog/toolCatalogFormatters.d.ts +5 -0
  38. package/dist/tools/directToolCatalog.meta.d.ts +1 -0
  39. package/dist/tools/github_clone_repo/contentSize.d.ts +9 -0
  40. package/dist/tools/github_clone_repo/scheme.d.ts +28 -80
  41. package/dist/tools/github_fetch_content/finalizer/types.d.ts +4 -3
  42. package/dist/tools/github_fetch_content/scheme.d.ts +92 -140
  43. package/dist/tools/github_fetch_content/types.d.ts +2 -1
  44. package/dist/tools/github_search_code/scheme.d.ts +39 -87
  45. package/dist/tools/github_search_discussions/execution.d.ts +15 -0
  46. package/dist/tools/github_search_discussions/scheme.d.ts +16 -0
  47. package/dist/tools/github_search_pull_requests/contentResponse/fileSurfaces.d.ts +3 -18
  48. package/dist/tools/github_search_pull_requests/scheme.d.ts +97 -119
  49. package/dist/tools/github_search_pull_requests/splitExecutions.d.ts +8 -0
  50. package/dist/tools/github_search_pull_requests/splitSchemes.d.ts +219 -0
  51. package/dist/tools/github_search_pull_requests/types.d.ts +28 -29
  52. package/dist/tools/github_search_repos/execution.d.ts +0 -2
  53. package/dist/tools/github_search_repos/scheme.d.ts +36 -64
  54. package/dist/tools/github_view_repo_structure/scheme.d.ts +37 -66
  55. package/dist/tools/local_dead_code/deadCodeScan.d.ts +26 -0
  56. package/dist/tools/local_dead_code/entrypoints.d.ts +16 -0
  57. package/dist/tools/local_dead_code/execution.d.ts +4 -0
  58. package/dist/tools/local_dead_code/graphBuilder.d.ts +43 -0
  59. package/dist/tools/local_dead_code/importResolver.d.ts +6 -0
  60. package/dist/tools/local_dead_code/local_dead_code.d.ts +5 -0
  61. package/dist/tools/local_dead_code/reachability.d.ts +21 -0
  62. package/dist/tools/local_dead_code/retention.d.ts +22 -0
  63. package/dist/tools/local_dead_code/scheme.d.ts +51 -0
  64. package/dist/tools/local_dead_code/types.d.ts +56 -0
  65. package/dist/tools/local_fetch_content/execution.d.ts +0 -1
  66. package/dist/tools/local_fetch_content/fetchContent/extraction.d.ts +6 -0
  67. package/dist/tools/local_fetch_content/fetchContent/validation.d.ts +9 -1
  68. package/dist/tools/local_fetch_content/fetchContent.d.ts +0 -1
  69. package/dist/tools/local_fetch_content/scheme.d.ts +28 -90
  70. package/dist/tools/local_find_files/execution.d.ts +0 -1
  71. package/dist/tools/local_find_files/findFiles.d.ts +0 -3
  72. package/dist/tools/local_find_files/findFilesNext.d.ts +26 -0
  73. package/dist/tools/local_find_files/pathPatternBraces.d.ts +20 -0
  74. package/dist/tools/local_find_files/scheme.d.ts +19 -81
  75. package/dist/tools/local_ripgrep/captureBudget.d.ts +25 -0
  76. package/dist/tools/local_ripgrep/rankingProfile/rankingProfiles.d.ts +1 -0
  77. package/dist/tools/local_ripgrep/rankingProfile/rankingResults.d.ts +1 -0
  78. package/dist/tools/local_ripgrep/ripgrepResultBuilder/searchNext.d.ts +1 -1
  79. package/dist/tools/local_ripgrep/scheme.d.ts +89 -190
  80. package/dist/tools/local_view_structure/execution.d.ts +0 -1
  81. package/dist/tools/local_view_structure/local_view_structure.d.ts +0 -1
  82. package/dist/tools/local_view_structure/scheme.d.ts +34 -87
  83. package/dist/tools/local_view_structure/structureFilters.d.ts +2 -4
  84. package/dist/tools/local_view_structure/structureResponse.d.ts +1 -0
  85. package/dist/tools/local_view_structure/viewStructureNext.d.ts +25 -0
  86. package/dist/tools/lsp/semantic_content/index.d.ts +2 -1
  87. package/dist/tools/lsp/semantic_content/scheme.d.ts +167 -642
  88. package/dist/tools/lsp/semantic_content/semanticAnchored.d.ts +8 -2
  89. package/dist/tools/lsp/semantic_content/semanticEnvelopes/locationEnvelopes.d.ts +2 -1
  90. package/dist/tools/lsp/semantic_content/semanticFileOps/anchor.d.ts +17 -1
  91. package/dist/tools/lsp/semantic_content/semanticNext.d.ts +2 -0
  92. package/dist/tools/lsp/semantic_content/semanticPresentation.d.ts +1 -1
  93. package/dist/tools/lsp/shared/callHierarchyTraversal.d.ts +14 -2
  94. package/dist/tools/lsp/shared/semanticTypes.d.ts +14 -1
  95. package/dist/tools/package_search/execution.d.ts +9 -6
  96. package/dist/tools/package_search/queryHelpers.d.ts +8 -0
  97. package/dist/tools/package_search/scheme.d.ts +30 -86
  98. package/dist/tools/providerMappers/codeSearch.d.ts +0 -1
  99. package/dist/tools/providerMappers/pullRequests.d.ts +0 -13
  100. package/dist/tools/providerMappers/repoSearch.d.ts +1 -5
  101. package/dist/tools/providerMappers/repoStructure.d.ts +4 -0
  102. package/dist/tools/toolCatalogFactory.d.ts +25 -0
  103. package/dist/tools/toolConfig.d.ts +9 -24
  104. package/dist/tools/toolNames.d.ts +2 -2
  105. package/dist/tools/toolSchemaImports.d.ts +3 -1
  106. package/dist/types/execution.d.ts +1 -0
  107. package/dist/types/toolOutput.d.ts +38 -0
  108. package/dist/utils/contextUtils.d.ts +6 -0
  109. package/dist/utils/core/types.d.ts +4 -0
  110. package/dist/utils/file/configFiles.d.ts +70 -0
  111. package/dist/utils/jsSymbolNames.d.ts +6 -0
  112. package/package.json +4 -8
  113. package/dist/oql/adapters/compile.d.ts +0 -25
  114. package/dist/oql/adapters/github/execute.d.ts +0 -16
  115. package/dist/oql/adapters/github/provider-diagnostics.d.ts +0 -14
  116. package/dist/oql/adapters/github/shared.d.ts +0 -75
  117. package/dist/oql/adapters/github.d.ts +0 -14
  118. package/dist/oql/adapters/graphProof.d.ts +0 -6
  119. package/dist/oql/adapters/graphView/filters.d.ts +0 -25
  120. package/dist/oql/adapters/graphView/nativeEdges.d.ts +0 -5
  121. package/dist/oql/adapters/graphView.d.ts +0 -29
  122. package/dist/oql/adapters/local/code.d.ts +0 -3
  123. package/dist/oql/adapters/local/codeBoolean.d.ts +0 -3
  124. package/dist/oql/adapters/local/fileRowOps.d.ts +0 -11
  125. package/dist/oql/adapters/local/files.d.ts +0 -3
  126. package/dist/oql/adapters/local/filesBoolean.d.ts +0 -10
  127. package/dist/oql/adapters/local/filesContentLeaf.d.ts +0 -12
  128. package/dist/oql/adapters/local/filesUniverse.d.ts +0 -6
  129. package/dist/oql/adapters/local/findToolType.d.ts +0 -10
  130. package/dist/oql/adapters/local/predicates.d.ts +0 -18
  131. package/dist/oql/adapters/local/scope.d.ts +0 -14
  132. package/dist/oql/adapters/local/searchToolType.d.ts +0 -7
  133. package/dist/oql/adapters/local/structureContent.d.ts +0 -6
  134. package/dist/oql/adapters/local/types.d.ts +0 -34
  135. package/dist/oql/adapters/local.d.ts +0 -4
  136. package/dist/oql/adapters/materialize.d.ts +0 -11
  137. package/dist/oql/adapters/pagination.d.ts +0 -21
  138. package/dist/oql/adapters/researchTargets/diff.d.ts +0 -16
  139. package/dist/oql/adapters/researchTargets/graph.d.ts +0 -3
  140. package/dist/oql/adapters/researchTargets/history.d.ts +0 -20
  141. package/dist/oql/adapters/researchTargets/pagination.d.ts +0 -54
  142. package/dist/oql/adapters/researchTargets/repositories.d.ts +0 -4
  143. package/dist/oql/adapters/researchTargets/research.d.ts +0 -3
  144. package/dist/oql/adapters/researchTargets/rows.d.ts +0 -16
  145. package/dist/oql/adapters/researchTargets/semantics.d.ts +0 -3
  146. package/dist/oql/adapters/researchTargets/shared.d.ts +0 -11
  147. package/dist/oql/adapters/researchTargets.d.ts +0 -8
  148. package/dist/oql/adapters/resultMap.d.ts +0 -27
  149. package/dist/oql/adapters/ruleYaml.d.ts +0 -11
  150. package/dist/oql/adapters/runner.d.ts +0 -21
  151. package/dist/oql/capabilities.d.ts +0 -31
  152. package/dist/oql/defaults.d.ts +0 -26
  153. package/dist/oql/diagnostics.d.ts +0 -25
  154. package/dist/oql/diffLanes.d.ts +0 -29
  155. package/dist/oql/envelope.d.ts +0 -21
  156. package/dist/oql/features.d.ts +0 -7
  157. package/dist/oql/index.d.ts +0 -27
  158. package/dist/oql/index.js +0 -47
  159. package/dist/oql/normalize/batch.d.ts +0 -2
  160. package/dist/oql/normalize/materialize.d.ts +0 -2
  161. package/dist/oql/normalize/params.d.ts +0 -2
  162. package/dist/oql/normalize/query.d.ts +0 -2
  163. package/dist/oql/normalize/scope.d.ts +0 -2
  164. package/dist/oql/normalize/shared.d.ts +0 -7
  165. package/dist/oql/normalize/source.d.ts +0 -2
  166. package/dist/oql/normalize/where.d.ts +0 -2
  167. package/dist/oql/normalize.d.ts +0 -20
  168. package/dist/oql/planner/planDiagnostics.d.ts +0 -13
  169. package/dist/oql/planner/predicateRouting.d.ts +0 -35
  170. package/dist/oql/planner.d.ts +0 -7
  171. package/dist/oql/predicateUtils.d.ts +0 -3
  172. package/dist/oql/research/analyze/manifest-scan.d.ts +0 -4
  173. package/dist/oql/research/analyze/source-graph.d.ts +0 -7
  174. package/dist/oql/research/analyze/symbol-scoring.d.ts +0 -4
  175. package/dist/oql/research/analyze/types.d.ts +0 -163
  176. package/dist/oql/research/analyze/utils.d.ts +0 -16
  177. package/dist/oql/research/analyze.d.ts +0 -3
  178. package/dist/oql/research/packets/builders.d.ts +0 -4
  179. package/dist/oql/research/packets/types.d.ts +0 -91
  180. package/dist/oql/research/packets.d.ts +0 -21
  181. package/dist/oql/run/batch.d.ts +0 -3
  182. package/dist/oql/run/continuations/records.d.ts +0 -19
  183. package/dist/oql/run/continuations/registry.d.ts +0 -22
  184. package/dist/oql/run/continuations/semantics.d.ts +0 -3
  185. package/dist/oql/run/continuations/types.d.ts +0 -12
  186. package/dist/oql/run/dryRun.d.ts +0 -11
  187. package/dist/oql/run/paths.d.ts +0 -15
  188. package/dist/oql/run/proofGrades.d.ts +0 -8
  189. package/dist/oql/run/select.d.ts +0 -10
  190. package/dist/oql/run/single.d.ts +0 -22
  191. package/dist/oql/run.d.ts +0 -5
  192. package/dist/oql/schema/predicates.d.ts +0 -12
  193. package/dist/oql/schema.d.ts +0 -1049
  194. package/dist/oql/schemeText.d.ts +0 -152
  195. package/dist/oql/shorthand/predicates.d.ts +0 -15
  196. package/dist/oql/shorthand/query-controls.d.ts +0 -18
  197. package/dist/oql/shorthand/target-params.d.ts +0 -9
  198. package/dist/oql/shorthand/types.d.ts +0 -159
  199. package/dist/oql/shorthand/utils.d.ts +0 -7
  200. package/dist/oql/shorthand.d.ts +0 -8
  201. package/dist/oql/targetParams.d.ts +0 -7
  202. package/dist/oql/transformers/contract.d.ts +0 -19
  203. package/dist/oql/transformers/github/code.d.ts +0 -9
  204. package/dist/oql/transformers/github/common.d.ts +0 -14
  205. package/dist/oql/transformers/language.d.ts +0 -1
  206. package/dist/oql/transformers/registry.d.ts +0 -16
  207. package/dist/oql/transformers/types.d.ts +0 -11
  208. package/dist/oql/types/diagnostics.d.ts +0 -22
  209. package/dist/oql/types/envelope.d.ts +0 -78
  210. package/dist/oql/types/guards.d.ts +0 -9
  211. package/dist/oql/types/planner.d.ts +0 -46
  212. package/dist/oql/types/predicates.d.ts +0 -93
  213. package/dist/oql/types/query.d.ts +0 -143
  214. package/dist/oql/types/recordData.d.ts +0 -127
  215. package/dist/oql/types/recordRows.d.ts +0 -48
  216. package/dist/oql/types/results.d.ts +0 -118
  217. package/dist/oql/types/targets.d.ts +0 -22
  218. package/dist/oql/types.d.ts +0 -27
  219. package/dist/tools/oql_search/execution.d.ts +0 -7
  220. package/dist/tools/toolMetadata/descriptionOverrides.d.ts +0 -4
package/README.md CHANGED
@@ -5,6 +5,7 @@
5
5
 
6
6
  [![MCP Community Server](https://img.shields.io/badge/Model_Context_Protocol-Official_Community_Server-blue?style=flat-square)](https://github.com/modelcontextprotocol/servers)
7
7
  [![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/bgauryy/octocode)
8
+ [![Glama score](https://glama.ai/mcp/servers/bgauryy/octocode/badges/score.svg)](https://glama.ai/mcp/servers/bgauryy/octocode)
8
9
 
9
10
  [![Website](https://img.shields.io/badge/Website-007ACC?style=for-the-badge&logo=link&logoColor=white)](https://octocode.ai)
10
11
  [![YouTube](https://img.shields.io/badge/YouTube-FF0000?style=for-the-badge&logo=youtube&logoColor=white)](https://www.youtube.com/@Octocode-ai)
@@ -13,7 +14,7 @@
13
14
 
14
15
  **Evidence-first code research for AI agents and developers.**
15
16
 
16
- Evidence from your **local workspace** and **external** sources (GitHub repos, PRs, npm). One toolset: ripgrep + AST search, trees, precise reads, and LSP as a **CLI** or **MCP server**, backed by a **Rust engine** for fast, token-efficient results across single files or mega-repos.
17
+ Octocode researches **your local code and external code alike** (GitHub repos, PRs, npm) with one toolset: ripgrep + AST search, trees, precise reads, and LSP. Use it as a **CLI** or **MCP server**, backed by a **Rust engine** for fast, token-efficient results across single files or mega-repos.
17
18
 
18
19
  ---
19
20
 
@@ -21,7 +22,7 @@ Evidence from your **local workspace** and **external** sources (GitHub repos, P
21
22
 
22
23
  - [Quick Start](#quick-start)
23
24
  - [Why Octocode](#why-octocode)
24
- - [What You Can Do](#what-you-can-do)
25
+ - [Built for Research (Benchmarks)](#built-for-research-benchmarks)
25
26
  - [Tools](#tools)
26
27
  - [MCP](#mcp)
27
28
  - [CLI](#cli)
@@ -33,36 +34,45 @@ Evidence from your **local workspace** and **external** sources (GitHub repos, P
33
34
  - [Architecture](#architecture)
34
35
  - [Documentation](#documentation)
35
36
  - [Troubleshooting](#troubleshooting)
37
+ - [Agent Workflows](#agent-workflows)
36
38
 
37
39
  ---
38
40
 
39
41
  ## Quick Start
40
42
 
43
+ **Prerequisites:** Node.js 20.12+
44
+
41
45
  **1. Run the Octocode CLI with `npx`**
42
46
 
43
47
  ```bash
44
48
  npx octocode --help
45
49
  ```
46
50
 
47
- **2. Authenticate with GitHub** optional, but unlocks private repositories and higher API rate limits:
51
+ **2. Authenticate with GitHub** - optional, but unlocks private repositories and higher API rate limits:
48
52
 
49
53
  ```bash
50
54
  npx octocode auth login
51
55
  npx octocode status # verify the active token source
52
56
  ```
53
57
 
54
- **3. Choose your interface.** The same engine and 12 tools run identically either way.
58
+ **3. Choose your interface.** Same tools and Rust engine on both. (Clone is on by
59
+ default in the CLI, opt-in for MCP.)
55
60
 
56
- **🖥️ CLI** research straight from your terminal:
61
+ **🖥️ CLI** - research straight from your terminal:
57
62
 
58
63
  ```bash
59
64
  npx octocode
60
65
  ```
61
66
 
62
- **🤖 MCP** one-click install:
67
+ **🤖 MCP** - one-click install:
63
68
 
64
69
  - [<img src="https://cursor.com/deeplink/mcp-install-dark.svg" alt="Install in Cursor">](https://cursor.com/en/install-mcp?name=octocode&config=eyJjb21tYW5kIjoibnB4IiwidHlwZSI6InN0ZGlvIiwiYXJncyI6WyJAb2N0b2NvZGVhaS9tY3BAbGF0ZXN0Il19)
65
70
  - [<img src="https://img.shields.io/badge/VS_Code-Install_Server-0098FF?style=flat-square&logo=visualstudiocode&logoColor=white" alt="Install in VS Code">](https://insiders.vscode.dev/redirect/mcp/install?name=octocode&config=%7B%22command%22%3A%22npx%22%2C%22type%22%3A%22stdio%22%2C%22args%22%3A%5B%22%40octocodeai%2Fmcp%40latest%22%5D%7D)
71
+
72
+ <details>
73
+ <summary><b>Show more install options (Windsurf, Kiro, Goose, LM Studio, Claude Code)</b></summary>
74
+ <br>
75
+
66
76
  - [<img src="https://img.shields.io/badge/VS_Code_Insiders-Install_Server-24bfa5?style=flat-square&logo=visualstudiocode&logoColor=white" alt="Install in VS Code Insiders">](https://insiders.vscode.dev/redirect/mcp/install?name=octocode&config=%7B%22command%22%3A%22npx%22%2C%22type%22%3A%22stdio%22%2C%22args%22%3A%5B%22%40octocodeai%2Fmcp%40latest%22%5D%7D&quality=insiders)
67
77
  - [<img src="https://img.shields.io/badge/Windsurf-Install_Server-1a1a1a?style=flat-square&logoColor=white" alt="Install in Windsurf">](windsurf://mcp/install?name=octocode&config=%7B%22command%22%3A%22npx%22%2C%22type%22%3A%22stdio%22%2C%22args%22%3A%5B%22%40octocodeai%2Fmcp%40latest%22%5D%7D)
68
78
  - [<img src="https://kiro.dev/images/add-to-kiro.svg" alt="Install in Kiro">](https://kiro.dev/launch/mcp/add?name=octocode&config=%7B%22command%22%3A%22npx%22%2C%22type%22%3A%22stdio%22%2C%22args%22%3A%5B%22%40octocodeai%2Fmcp%40latest%22%5D%7D)
@@ -72,31 +82,76 @@ npx octocode
72
82
  **Claude Code:**
73
83
 
74
84
  ```bash
75
- claude mcp add-json octocode --scope user '{"command":"npx","type":"stdio","args":["@octocodeai/mcp@latest"]}'
85
+ claude mcp add-json octocode --scope user '{"command":"npx","type":"stdio","args":["octocode-mcp@latest"]}'
76
86
  ```
87
+ </details>
77
88
 
78
89
  **Any other client:** `npx octocode install`
79
90
 
80
- ➡️ Learn more at **[octocode.ai](https://octocode.ai)**.
91
+ ---
92
+
93
+ ### Use it as an MCP server
94
+
95
+ Add to your MCP client config (or use a one-click install above):
96
+
97
+ ```json
98
+ {
99
+ "octocode": {
100
+ "command": "npx",
101
+ "type": "stdio",
102
+ "args": ["octocode-mcp@latest"]
103
+ }
104
+ }
105
+ ```
106
+
107
+ Put a GitHub token and options under `env` (see [Configuration](#configuration)).
108
+
109
+ ### Use it as an agentic-friendly CLI
110
+
111
+ Just run `npx octocode`, agents figure out the rest. The bare command prints built-in usage and the full tool catalog, so any coding agent knows how to drive it out of the box, no MCP client or extra wiring required.
112
+
113
+ ```bash
114
+ npx octocode # self-describing usage for agents
115
+ npx octocode tools # list every tool
116
+ npx octocode tools localSearchCode --scheme # inspect a tool's schema
117
+ ```
118
+
119
+ Every MCP tool is also a plain command: JSON in, token-efficient YAML out. Local paths route to local tools; `owner/repo[/path]` routes to GitHub.
120
+
121
+ ```bash
122
+ npx octocode tools localSearchCode \
123
+ --queries '{"path":".","searchText":"authenticate","maxFiles":20}'
124
+ ```
125
+ ```yaml
126
+ results:
127
+ - id: localSearchCode-1
128
+ data:
129
+ files:
130
+ - path: src/auth.ts
131
+ matches:
132
+ - line: 12
133
+ value: "export async function authenticate(req: Request) {"
134
+ ```
135
+
136
+ Learn more at **[octocode.ai](https://octocode.ai)**.
81
137
 
82
138
  ---
83
139
 
84
140
  ## Why Octocode
85
141
 
86
- Agents write better code from evidence than from assumptions. Octocode turns *guess-driven* work into **research-driven** work. Before an agent changes, reviews, or explains code, it gathers real evidence from your local workspace **and** from GitHub repositories, pull requests, and npm packages, then hands it back as compact, citable context. *Code is truth; context is the map.*
142
+ Agents code better from evidence than from guesses. Octocode researches **two worlds with one flow**, your **local code** and **external code** on GitHub and npm, and hands back compact, citable context before an agent changes, reviews, or explains code. *Code is truth; context is the map.*
87
143
 
88
- Most tools cover one slice: searching the web, or grepping your repo. Octocode covers the **whole research flow, end to end**:
144
+ Most tools do one slice (web search, or grep your repo) and hand back a fixed blob. Octocode covers the whole loop and lets the **agent decide what data it needs next**:
89
145
 
90
- - **Built for scale.** In organizations with thousands of repositories and endless code, Octocode is the solution: spot a pattern in one repo, follow it through the pull request that introduced it, then trace the same shape across other repos and your own files without leaving the conversation. Clone any repo and study it locally, on any machine.
91
- - **Smart GitHub workflows.** Parallel bulk queries and built-in **next-step hints** keep the agent on the cheapest path: search broadly, read narrowly, trace semantically. Each result points to the natural follow-up.
92
- - **No GitHub required.** Even without GitHub, clone any repository locally and point Octocode's local tools (search, structural AST, LSP, content) at it for the same evidence-first research.
93
- - **Reads the shape, not the noise.** Code is minified and skeletonized on the fly across 70+ languages, so an agent grasps a 100 KB file in a few hundred tokens instead of spending its context on boilerplate.
94
- - **Fast and self-contained.** Search, parsing, semantic navigation, and redaction run in one prebuilt **Rust engine**: quick on a laptop or a mega-repo, with no extra toolchain to install.
95
- - **Safe by default.** Every byte returned to the model is scanned and secrets redacted first (see [Security](#security)).
146
+ - **Agent-driven, efficient flows.** Instead of one-shot dumps, Octocode chains cheap steps into an optimized research flow: broad code search, then fetch only the **exact matched lines/region**, with **smart pagination** and **out-of-the-box minification** so the model never over-fetches. Every result carries **next-step hints** to the cheapest follow-up.
147
+ - **Scales to monorepos.** Spot a pattern in one repo, follow the PR that introduced it, then trace it across other repos and your own files, without leaving the chat. Clone any repo and study it locally.
148
+ - **Smart GitHub flow.** Parallel bulk queries across code, PRs, commits, issues, and repos, all with the same search-broad, read-narrow, trace-semantically discipline.
149
+ - **Works without GitHub.** Clone any repo and point the local tools (search, AST, LSP, content) at it, same evidence-first flow.
150
+ - **Reads shape, not noise.** On-the-fly minify/skeletonize across 70+ languages: a 100 KB file in a few hundred tokens, not walls of boilerplate.
151
+ - **Fast, self-contained.** Search, parsing, navigation, and redaction run in one prebuilt **Rust engine**: quick on a laptop or a mega-repo, nothing extra to install.
152
+ - **Safe by default.** Every byte to the model is scanned and secrets redacted first (see [Security](#security)).
96
153
 
97
- ## What You Can Do
98
-
99
- Octocode is useful whenever the next coding step depends on finding and proving context, not guessing it.
154
+ **What you can do** (whenever the next step needs proven context, not a guess):
100
155
 
101
156
  | Need | Use Octocode to |
102
157
  |------|-----------------|
@@ -105,15 +160,88 @@ Octocode is useful whenever the next coding step depends on finding and proving
105
160
  | **Semantic navigation** | Resolve definitions, references, callers/callees, call hierarchy, hovers, symbols, diagnostics, and type relationships through LSP. |
106
161
  | **Structural matching** | Run AST-shaped searches with patterns or YAML rules so comments and strings do not become false positives. |
107
162
  | **Large-file context** | Minify, skeletonize, or paginate code so agents spend tokens on relevant structure instead of boilerplate. |
108
- | **Agent workflows** | Same engine via MCP, CLI, OQL, and Agent Skills. |
163
+ | **Agent workflows** | Same engine via MCP, CLI, and Agent Skills. |
164
+
165
+ ---
166
+
167
+ ## Built for Research (Benchmarks)
168
+
169
+ Octocode is a **research layer for coding agents**: it finds and proves the context an agent
170
+ needs *before* it writes, reviews, or explains code, via **CLI or MCP**. It shines at **deep
171
+ research across many repositories**: connecting the dots from a symbol to its source, the PR
172
+ that changed it, and the same pattern in other repos. The benchmark measures the two things a
173
+ developer actually pays for:
174
+
175
+ - **Accuracy**: did the agent get the answer right?
176
+ - **Context cost**: how many characters the model had to read to get there. Fewer characters =
177
+ **lower token spend, faster turns, and sharper focus** (the model isn't buried in boilerplate).
178
+
179
+ We ran **30 real cross-repo questions** (dependency traces, call graphs, commit ranges, blast
180
+ radius, PR reviews), 3 passes each, against three GitHub setups a developer might use today:
181
+ plain `gh`, `gh` + Headroom (compression), and `gh` + RTK. A blind, neutral judge (gpt-5.5)
182
+ graded every answer.
183
+
184
+ ### Scorecard (30 Q × 3 passes per matchup, local build v18.1.1, blind neutral gpt-5.5 judge, 95% bootstrap CIs)
109
185
 
110
- See [Quick Start](#quick-start) to install in your terminal or AI assistant.
186
+ **Typical context per question**: how many characters the model reads to answer, relative to
187
+ Octocode (lower is better):
188
+
189
+ ```text
190
+ Octocode ███ 1.0× (baseline)
191
+ plain gh ██████ 2.0× more context
192
+ gh + Headroom ████████ 2.6× more context
193
+ gh + RTK ██████████ 3.2× more context
194
+ ```
195
+
196
+ | Dimension | Octocode | plain gh | gh + Headroom | gh + RTK |
197
+ |---|---:|---:|---:|---:|
198
+ | Correctness (/10) | ~9.2–9.3 | 9.3 | 8.6 | **9.4** |
199
+ | Chars, per-Q geo-mean (baseline÷Octo, 95% CI) | 1.0× | **2.0×** (1.5–2.6) | **2.6×** (1.9–3.7) | **3.2×** (2.4–4.5) |
200
+ | Correct-and-leaner wins (Octo / baseline) | n/a | 51 / 38 | 60 / 28 | 57 / 33 |
201
+ | Questions Octocode leaner | n/a | 67/89 | 63/88 | 68/90 |
202
+
203
+ **What this means for you:** at the **same accuracy** (all arms tie at ~9/10), Octocode answers
204
+ in **2–3× fewer characters** than every baseline, every 95% CI stays above 1×, and it is
205
+ leaner on ~72–75% of questions. That is directly less token spend and context bloat on each
206
+ research step. Even versus bare, disciplined `gh` (the leanest baseline) it is ~2× leaner, and
207
+ the lead grows on the hard multi-hop, large-file questions where agents usually derail.
208
+
209
+ **Why it's leaner without losing anything:**
210
+ - **Exact slices, not dumps**: reads the region, symbol, or diff you asked for, never a whole file or tree.
211
+ - **Lossless minification**: strips boilerplate across 70+ languages with zero data loss: a 100 KB file becomes a few hundred tokens of real structure.
212
+ - **No silent truncation**: you get the full slice; large results continue on demand via exact cursors.
213
+ - **One research loop**: GitHub + local + LSP + npm behind a single flow: structure → search → exact read → prove.
214
+
215
+ Full reports:
216
+ [vs plain gh](https://github.com/bgauryy/octocode/blob/main/packages/octocode-benchmark/results/full-octocode-vs-gh-152630-2026-08-07.md) ·
217
+ [vs gh+Headroom](https://github.com/bgauryy/octocode/blob/main/packages/octocode-benchmark/results/full-octocode-vs-headroom-134213-2026-08-07.md) ·
218
+ [vs gh+RTK](https://github.com/bgauryy/octocode/blob/main/packages/octocode-benchmark/results/full-octocode-vs-rtk-162848-2026-08-07.md).
219
+
220
+ ### When to reach for Octocode vs a quick check
221
+
222
+ | Reach for **Octocode** when… | A **quick check** is enough when… |
223
+ |---|---|
224
+ | You need **exact field membership** (peer vs optional vs dev, version ranges). | You already know the file+line and just want to eyeball it. |
225
+ | The answer is a **trace across files/repos** (dependency → source → transport → parser chain). | You need one PR title, issue state, or a single `--json` field. |
226
+ | You want to **stay lean in context**: targeted reads, not whole-file/tree dumps. | The file is tiny and a full fetch is trivially cheap. |
227
+ | You need **reachability / call-graph proof** before a change. | A single grep hit already answers it. |
228
+
229
+ **Dig deeper:** [run](https://github.com/bgauryy/octocode/tree/main/packages/octocode-benchmark/skills/octocode-benchmark) ·
230
+ [design](https://github.com/bgauryy/octocode/blob/main/packages/octocode-benchmark/skills/octocode-benchmark/references/BENCHMARK.md) ·
231
+ [questions](https://github.com/bgauryy/octocode/tree/main/packages/octocode-benchmark/compare/github-questions) ·
232
+ [stats method](https://github.com/bgauryy/octocode/blob/main/packages/octocode-benchmark/skills/octocode-benchmark/references/aggregation-and-stats.md) ·
233
+ [all reports](https://github.com/bgauryy/octocode/tree/main/packages/octocode-benchmark/results) (historical runs carry their own caveats).
111
234
 
112
235
  ---
113
236
 
114
237
  ## Tools
115
238
 
116
- **12 always-on tools** (same on [MCP](#mcp) and [CLI](#cli)). Local tools on by default (`ENABLE_LOCAL=false` to disable). `ghCloneRepo` is MCP opt-in (`ENABLE_CLONE=true`), CLI on by default. Flags: [Configuration](https://github.com/bgauryy/octocode/blob/main/docs/CONFIGURATION.md).
239
+ **17 tools in the full catalog.** MCP registers 14 by default; the CLI exposes 15
240
+ because clone is enabled there by default. `ghCloneRepo` is opt-in on MCP
241
+ (`ENABLE_CLONE=true`), while `ghListReleases` and `ghSearchDiscussions` are opt-in
242
+ on both surfaces. Local tools default on for the **CLI** and off for the **MCP
243
+ server** (`ENABLE_LOCAL=true` enables them on MCP; `ENABLE_LOCAL=false` disables on
244
+ CLI). Flags: [Configuration](https://github.com/bgauryy/octocode/blob/main/docs/CONFIGURATION.md).
117
245
 
118
246
  **Token knobs.** `concise:true` returns path/title-only lists. `minify` controls file read density: `symbols` = skeleton with line numbers, `standard` = comments/blanks stripped (default), `none` = exact bytes.
119
247
 
@@ -123,18 +251,23 @@ See [Quick Start](#quick-start) to install in your terminal or AI assistant.
123
251
  |------|--------------|------|
124
252
  | `ghSearchCode` | Code and path search across GitHub by owner, repo, path, filename, extension, and match filters. Accepts 1 to 5 parallel queries. | `concise` |
125
253
  | `ghGetFileContent` | Read a GitHub file or region: full file, line range, match slice, or paginated chars. | `minify` |
126
- | `ghViewRepoStructure` | Browse a GitHub repository's directory tree before reading files. | |
127
- | `ghSearchRepos` | Discover repositories by keywords, owner, topic, language, stars, forks, size, dates, license, visibility. | `concise` |
128
- | `ghHistoryResearch` | Search PR history, or deep-read one PR: files, patches, comments, reviews, commits. | `concise` |
129
- | `ghCloneRepo` | Clone a repo or sparse subtree into the local cache for local/LSP analysis. **Opt-in** (`ENABLE_CLONE=true`). | `sparsePath` |
254
+ | `ghViewRepoStructure` | Browse a repository's directory tree, plus opt-in repo enrichments. | `include` |
255
+ | `ghSearchRepos` | Discover repositories by keywords, owner, topic, language, stars, updated, license, visibility. | `concise` |
256
+ | `ghSearchPullRequests` | Search pull requests, or deep-read one PR: files, patches, comments, reviews, commits. | `content` |
257
+ | `ghSearchIssues` | Search issues, or read one issue's body and comments. | `content` |
258
+ | `ghSearchCommits` | Walk a repo's commit history, or compare two refs (`base`+`head`). | `includeDiff` |
259
+ | `ghListReleases` | List releases + latest, with opt-in assets. **Opt-in** (`ENABLE_RELEASES=true`). | `includeAssets` |
260
+ | `ghSearchDiscussions` | Search a repo's Discussions (Q&A, RFCs, announcements) via GraphQL. **Opt-in** (`ENABLE_DISCUSSIONS=true`). | `keywordsToSearch` |
261
+ | `ghCloneRepo` | Clone a repo or sparse subtree into the local cache for local/LSP analysis. **Opt-in** on MCP (`ENABLE_CLONE=true`; CLI on by default). | `sparsePath` |
130
262
 
131
263
  ### Local Tools
132
264
 
133
265
  | Tool | What it does | Knob |
134
266
  |------|--------------|------|
135
267
  | `localSearchCode` | Local code/text search returning file and line anchors. `mode:"structural"` runs Octocode AST shape queries (`pattern` or `rule`). | `mode` |
136
- | `localViewStructure` | Browse a local directory tree: depth, filters, pagination, metadata. | `concise` |
268
+ | `localViewStructure` | Browse a local directory tree: depth, filters, pagination, metadata. | `detail` |
137
269
  | `localFindFiles` | Find local files and directories by name, path, regex, extension, size, time, permissions, type. | |
270
+ | `localFindDeadCode` | Find likely-unreferenced exports and dead-code clusters using whole-repository reachability analysis. | `entrypoints` |
138
271
  | `localGetFileContent` | Read a local file or region: exact slice, match string, line range, or paginated chars. | `minify` |
139
272
 
140
273
  ### Package Search
@@ -147,13 +280,7 @@ See [Quick Start](#quick-start) to install in your terminal or AI assistant.
147
280
 
148
281
  | Tool | What it does |
149
282
  |------|--------------|
150
- | `lspGetSemantics` | Typed semantic navigation. Raw tools support `definition`, `references`, `callers`, `callees`, `callHierarchy`, `hover`, `documentSymbols`, `typeDefinition`, `implementation`, `workspaceSymbol`, `supertypes`, `subtypes`, and `diagnostic`. The CLI uses `npx octocode search <file> --op <type>` for semantics and `npx octocode search <file> --symbols` for file or directory symbol outlines. Navigation runs through installed language servers (see the [LSP Tools Reference](https://github.com/bgauryy/octocode/blob/main/docs/OCTOCODE_TOOLS.md#lsp-tools-reference)). |
151
-
152
- ### OQL Search
153
-
154
- | Tool | What it does |
155
- |------|--------------|
156
- | `oqlSearch` | Runs typed OQL queries across code, content, structure, files, semantics, repositories, packages, pull requests, commits, diff, research, graph, and materialization targets. |
283
+ | `lspGetSemantics` | Typed semantic navigation: `definition`, `references`, `callers`, `callees`, `callHierarchy`, `hover`, `documentSymbols`, `typeDefinition`, `implementation`, `workspaceSymbol`, `supertypes`, `subtypes`, and `diagnostic`. From the CLI, invoke it directly: `npx octocode tools lspGetSemantics --queries '<json>'`. Navigation runs through installed language servers (see the [LSP Tools Reference](https://github.com/bgauryy/octocode/blob/main/docs/OCTOCODE_TOOLS.md#lsp-tools-reference)). |
157
284
 
158
285
  Full schemas, fields, and examples for every tool live in [`docs/OCTOCODE_TOOLS.md`](https://github.com/bgauryy/octocode/blob/main/docs/OCTOCODE_TOOLS.md) (linked under [Documentation](#documentation)).
159
286
 
@@ -167,23 +294,7 @@ https://github.com/user-attachments/assets/de8d14c0-2ead-46ed-895e-09144c9b5071
167
294
 
168
295
  ### Manual Configuration
169
296
 
170
- Add to your MCP client config. Pick the package that matches the version you want:
171
-
172
- **New Octocode (Rust-powered engine)** — use `@octocodeai/mcp`:
173
-
174
- ```json
175
- {
176
- "octocode": {
177
- "command": "npx",
178
- "type": "stdio",
179
- "args": [
180
- "@octocodeai/mcp@latest"
181
- ]
182
- }
183
- }
184
- ```
185
-
186
- **Classic octocode-mcp** — use `octocode-mcp`:
297
+ Add to your MCP client config, using `octocode-mcp`:
187
298
 
188
299
  ```json
189
300
  {
@@ -197,42 +308,33 @@ Add to your MCP client config. Pick the package that matches the version you wan
197
308
  }
198
309
  ```
199
310
 
200
- Add a GitHub token and options under `env` see [Authentication](#authentication-methods) and [Configuration](#configuration).
311
+ Add a GitHub token and options under `env` - see [Authentication](#authentication-methods) and [Configuration](#configuration).
201
312
 
202
313
  ---
203
314
 
204
315
  ## CLI
205
316
 
206
- Same research engine, no MCP client needed. Local paths route to local tools; `owner/repo[/path]` routes to GitHub.
207
-
208
- ```bash
209
- npx octocode auth login # authenticate once
210
- npx octocode status # verify setup
211
- npx octocode --help # full usage
212
- ```
317
+ Same research engine, no MCP client needed. Local paths route to local tools; `owner/repo[/path]` routes to GitHub. Authenticate once with `npx octocode auth login` (see [Authentication](#authentication-methods)); run `npx octocode --help` for full usage.
213
318
 
214
319
  ### Commands
215
320
 
216
- #### Search
321
+ #### Tools
217
322
 
218
323
  | Command | What it does |
219
324
  |---------|--------------|
220
- | `npx octocode search <term> <path\|owner/repo>` | Text, regex, AST structural (`--pattern`), or full OQL (`--query`) |
221
- | `npx octocode search <path\|owner/repo> --tree` | Browse directory or repository structure |
222
- | `npx octocode search <file>` | Read file content; `--content-view exact\|compact\|symbols` or `--raw` |
223
- | `npx octocode search <file> --symbols` | Symbol outline for a file or source tree |
224
- | `npx octocode search --query <oql-json>` | Full OQL across all target types (code, commits, PRs, packages, …) |
325
+ | `npx octocode tools <name> --scheme` | Show one tool's schema: fields, types, bounds, defaults |
326
+ | `npx octocode tools <name> --queries '<json>'` | Run a tool (same tools as MCP), YAML output |
327
+ | `npx octocode tools <name> --queries '<json>' --json` | Run a tool, full `CallToolResult` JSON |
328
+ | `npx octocode tools` | List every available tool |
225
329
 
226
330
  #### More commands
227
331
 
228
- - **GitHub & npm** `npx octocode search <…> --target repositories|packages|pullRequests|commits|diff`
229
- - **LSP** `npx octocode search <file> --op definition|references|callers|callees|hover|diagnostic|callHierarchy` (`--symbol`, `--line` to narrow)
230
- - **Cache & clone** `npx octocode clone`, `npx octocode cache fetch|status|clear`
231
- - **Skills** `npx octocode skill --list | --name <skill> | --add <github-path> | --install-all`
232
- - **Language servers** — `npx octocode lsp-server list|install|status|uninstall|clean`
233
- - **Setup & introspection** — `npx octocode install`, `npx octocode auth`, `npx octocode status`, `npx octocode tools`, `npx octocode context`
332
+ - **Cache & clone** - `npx octocode clone`, `npx octocode cache fetch|status|clear`
333
+ - **Skills** - `npx octocode skill list|install|check|info|remove` for bundled Octocode skills
334
+ - **Language servers** - `npx octocode lsp-server list|install|status|uninstall|clean`
335
+ - **Setup & introspection** - `npx octocode install`, `npx octocode auth`, `npx octocode status`, `npx octocode context`
234
336
 
235
- Full syntax, flags, and exit codes: [Octocode CLI Guide](https://github.com/bgauryy/octocode/blob/main/docs/OCTOCODE_CLI.md)
337
+ Full syntax, flags, and exit codes: [Octocode CLI Guide](https://github.com/bgauryy/octocode/blob/main/packages/octocode/docs/OCTOCODE_CLI.md)
236
338
 
237
339
  ---
238
340
 
@@ -256,27 +358,40 @@ environment variables > <octocode-home>/.octocoderc > built-in defaults
256
358
  | Linux | `${XDG_CONFIG_HOME:-~/.config}/.octocode` |
257
359
  | Windows | `%APPDATA%\.octocode` |
258
360
 
259
- Set values as MCP `env` entries (per client; these win over `.octocoderc`) or globally in `<octocode-home>/.octocoderc` (JSON with comments). **Tokens never go in `.octocoderc`** use `env` or `npx octocode auth login`.
361
+ Set values as MCP `env` entries (per client; these win over `.octocoderc`) or globally in `<octocode-home>/.octocoderc` (JSON with comments). **Tokens never go in `.octocoderc`** - use `env` or `npx octocode auth login`.
260
362
 
261
363
  ### Common settings
262
364
 
263
- The **Scope** column shows where a setting applies: `Both`, or `MCP` (the CLI ignores it).
365
+ Most-used settings (both CLI and MCP unless noted):
264
366
 
265
- | Env var | `.octocoderc` key | Default | Scope | What it does |
266
- |---------|-------------------|---------|-------|--------------|
267
- | `OCTOCODE_HOME` | env only | platform default | Both | Overrides the Octocode data directory for config, credentials, sessions, stats, and caches. |
268
- | `OCTOCODE_TOKEN` / `GH_TOKEN` / `GITHUB_TOKEN` | env only | unset | Both | GitHub token, in priority order. Tokens stay in env, never in `.octocoderc`. |
269
- | `GITHUB_API_URL` | `github.apiUrl` | `https://api.github.com` | Both | API endpoint; use `/api/v3` for GitHub Enterprise. |
270
- | `ENABLE_LOCAL` | `local.enabled` | `true` | Both | Turns local filesystem + LSP tools on/off; set `false` to disable. |
271
- | `ENABLE_CLONE` | `local.enableClone` | CLI `true`, MCP `false` | Both | `ghCloneRepo` and directory fetch. Default differs by surface; set `false` to disable in either. |
272
- | `WORKSPACE_ROOT` | `local.workspaceRoot` | `cwd` | Both | Absolute root for resolving relative local paths. |
273
- | `ALLOWED_PATHS` | `local.allowedPaths` | `[]` | Both | Extra path allowlist for local access; empty means home directory only after validation. |
274
- | `TOOLS_TO_RUN` / `ENABLE_TOOLS` / `DISABLE_TOOLS` | `tools.*` | unset | **MCP** | Whitelist, add to, or remove from the registered tool set. The CLI exposes every tool. |
275
- | `REQUEST_TIMEOUT` | `network.timeout` | `30000` | Both | Request timeout in ms (clamped `5000..300000`). |
276
- | `MAX_RETRIES` | `network.maxRetries` | `3` | Both | Retry attempts (clamped `0..10`). |
277
- | `OCTOCODE_OUTPUT_FORMAT` | `output.format` | `yaml` | Both | Response format: `yaml` or `json`. |
367
+ | Env var | `.octocoderc` key | Default | What it does |
368
+ |---------|-------------------|---------|--------------|
369
+ | `OCTOCODE_TOKEN` / `GH_TOKEN` / `GITHUB_TOKEN` | env only | unset | GitHub token, in priority order. Never in `.octocoderc`. |
370
+ | `ENABLE_LOCAL` | `local.enabled` | CLI `true`, MCP `false` | Local filesystem + LSP tools on/off. |
371
+ | `ENABLE_CLONE` | `local.enableClone` | CLI `true`, MCP `false` | `ghCloneRepo` + directory fetch on/off. |
372
+ | `WORKSPACE_ROOT` | `local.workspaceRoot` | `cwd` | Root for resolving relative local paths. |
373
+ | `ALLOWED_PATHS` | `local.allowedPaths` | `[]` | Extra path allowlist for local access. |
374
+ | `OCTOCODE_OUTPUT_FORMAT` | `output.format` | `yaml` | Response format: `yaml` or `json`. |
278
375
 
279
- > **Local defaults on; clone differs by surface.** Both CLI and MCP default local tools on; set `ENABLE_LOCAL=false` to disable them. The **CLI** defaults clone on, while the **MCP server** requires `ENABLE_CLONE=true`.
376
+ `OCTOCODE_HOME`, GitHub Enterprise (`GITHUB_API_URL`), MCP tool whitelisting (`TOOLS_TO_RUN`/`ENABLE_TOOLS`/`DISABLE_TOOLS`), and network timeouts/retries: see the [Configuration Reference](https://github.com/bgauryy/octocode/blob/main/docs/CONFIGURATION.md).
377
+
378
+ ### Example Configuration
379
+
380
+ **`~/.octocode/.octocoderc`:**
381
+ ```json
382
+ {
383
+ "github": {
384
+ "apiUrl": "https://api.github.com"
385
+ },
386
+ "local": {
387
+ "enabled": true,
388
+ "enableClone": true
389
+ },
390
+ "output": {
391
+ "format": "yaml"
392
+ }
393
+ }
394
+ ```
280
395
 
281
396
  Per-project overrides and custom LSP servers live in a workspace `.octocode/` folder. For the full `.octocoderc` schema, a ready-to-copy example, clone-cache tuning, GitHub Enterprise setup, and precedence details, see the [Configuration Reference](https://github.com/bgauryy/octocode/blob/main/docs/CONFIGURATION.md).
282
397
 
@@ -301,7 +416,7 @@ Interactive login lets you choose Octocode browser OAuth or `gh auth login`. Oct
301
416
  gh auth login
302
417
  ```
303
418
 
304
- Octocode reads the `gh` token automatically no further config needed.
419
+ Octocode reads the `gh` token automatically - no further config needed.
305
420
 
306
421
  ### Option 3: Personal Access Token (also supported)
307
422
 
@@ -315,21 +430,17 @@ Create a token at [github.com/settings/tokens](https://github.com/settings/token
315
430
 
316
431
  ## Security
317
432
 
318
- **Every byte that reaches the model is scanned and redacted first.** All content (local files, GitHub and npm responses, error messages, and tool outputs) passes through the Rust engine's secret scanner on the way *in* (tool inputs) and on the way *out* (results), so secrets never reach the LLM. The same enforcement runs identically under MCP and the CLI.
433
+ **Every byte to the model is scanned and redacted first.** All content (local files, GitHub/npm responses, errors, tool output) passes through the Rust engine's secret scanner on the way *in* and *out*, so secrets never reach the LLM. Identical under MCP and CLI.
319
434
 
320
435
  - **Secret redaction, in and out.** 300+ provider credential patterns (AWS, Azure, GCP, GitHub, OpenAI, Anthropic, Stripe, Slack, 1Password, and more) plus generic JWTs, PEM/private keys, bearer tokens, database connection strings, and high-entropy strings. Masked values surface a redaction warning so the agent knows.
321
436
  - **Content sanitized at the source.** Local reads (`localGetFileContent`, ripgrep, structural search, binary, file discovery, structure) and external fetches (GitHub code/files, npm) are scanned as they are read, not only at the boundary.
322
437
  - **Path safety.** Relative inputs resolve from `WORKSPACE_ROOT` / config / `cwd`, then local reads are bounded to the engine's allowed roots (home by default, plus `ALLOWED_PATHS` and Octocode-registered roots). Symlinks are resolved and the real target is **re-validated**, so a link cannot escape into a blocked location.
323
- - **Sensitive files and directories are blocked by default.** Octocode refuses to read known secret-bearing files and folders wherever they live, returning a redacted error instead of contents. Blocked patterns include:
324
- - **Keys and certs:** `*.pem`, `*.key`, `*.crt`/`*.cer`/`*.csr`, `*.p12`/`*.pfx`/`*.jks`/`*.keystore`, and SSH keys (`id_rsa`, `*_ed25519`, `authorized_keys`, `known_hosts`, `.ssh/`).
325
- - **Credentials and tokens:** `.env` / `.env.*`, `.netrc`, `.npmrc`, `.pgpass`, `.git-credentials`, `*_token` / `.token`, `client_secret*.json`, `*service-account*.json`, `auth.json`, `.htpasswd`.
326
- - **Cloud and infra:** `.aws/`, `.azure/`, `.config/gcloud/`, `.kube/` / `kubeconfig`, `.docker/`, `.terraform/` and `*.tfstate`.
327
- - **OS and app secret stores:** `.git/`, `secrets/`, `private/`, browser login data (Chrome/Firefox), OS keychains, password managers (`*.kdbx`), shell history files, and crypto wallets.
438
+ - **Sensitive files blocked by default.** Reads of known secret-bearing files and folders return a redacted error instead of contents: keys/certs, `.env*`, `.npmrc`/`.netrc`, cloud/infra credentials (`.aws/`, `.kube/`, `*.tfstate`), `.git/`, browser logins, OS keychains, and wallets. Full list in [SECURITY.md](https://github.com/bgauryy/octocode/blob/main/docs/SECURITY.md).
328
439
  - **Command safety.** Normal local search runs in-process inside `octocode-engine`. External helpers are fixed per lane, command/argument allowlisted, and run via `spawn` with argument arrays: no shell strings, no injection.
329
440
  - **Schema validation** runs before any tool executes; untrusted input size and shape are bounded.
330
441
  - **Credentials.** GitHub auth via env tokens, AES-256-GCM-encrypted on-disk OAuth, or the `gh` CLI; tokens are never logged.
331
442
 
332
- **Full security model, pipeline, and threat coverage: [SECURITY.md](https://github.com/bgauryy/octocode/blob/main/docs/SECURITY.md).** Related: [Authentication](https://github.com/bgauryy/octocode/blob/main/docs/CONFIGURATION.md) · [Configuration](https://github.com/bgauryy/octocode/blob/main/docs/CONFIGURATION.md) · [Credentials](https://github.com/bgauryy/octocode/blob/main/docs/CONFIGURATION.md#github-token)
443
+ **Full security model, pipeline, and threat coverage: [SECURITY.md](https://github.com/bgauryy/octocode/blob/main/docs/SECURITY.md).** Related: [Configuration & Authentication](https://github.com/bgauryy/octocode/blob/main/docs/CONFIGURATION.md) · [Credentials](https://github.com/bgauryy/octocode/blob/main/docs/CONFIGURATION.md#github-token)
333
444
 
334
445
  ---
335
446
 
@@ -339,12 +450,14 @@ Four code-intelligence axes; three are native to the Rust engine and need no ext
339
450
 
340
451
  | Axis | What it does | How to use it |
341
452
  |------|--------------|---------------|
342
- | **Structural AST** | Tree-sitter shape queries (`pattern` or YAML `rule`) across 60+ extensions. | `localSearchCode mode:"structural"` · CLI `search --pattern`/`--rule` |
343
- | **Signature outline** | Body-free skeleton with line numbers from real tree-sitter parsing, no heuristics. An anti-growth guard returns the real file when a skeleton wouldn't be smaller. | `minify:"symbols"` · CLI `search <file> --content-view symbols` |
453
+ | **Structural AST** | Tree-sitter shape queries (`pattern` or YAML `rule`) across 60+ extensions. | `localSearchCode mode:"structural"` · CLI `tools localSearchCode --scheme` |
454
+ | **Signature outline** | Body-free skeleton with line numbers from real tree-sitter parsing, no heuristics. An anti-growth guard returns the real file when a skeleton wouldn't be smaller. | `minify:"symbols"` · CLI `tools localGetFileContent --scheme` |
344
455
  | **Content minification** | Comment/whitespace stripping for 70+ languages and config formats; HTML/Vue/Svelte also minify embedded `<style>`/`<script>`. | `minify:"standard"` (default) |
345
- | **LSP navigation** | definition, references, callers/callees, callHierarchy, hover, typeDefinition, implementation, documentSymbols, via an installed language server; JS/TS also have a native, no-server path. | `lspGetSemantics` · CLI `search --op` / `search --symbols` |
456
+ | **LSP navigation** | definition, references, callers/callees, callHierarchy, hover, typeDefinition, implementation, documentSymbols, via an installed language server; JS/TS also have a native, no-server path. | `lspGetSemantics` · CLI `tools lspGetSemantics --scheme` |
346
457
 
347
- 📋 **Full support matrix:** every extension with its exact AST, signature, LSP, and minify capability, machine-generated from the shipped binary, lives in the **[Full format support matrix](https://github.com/bgauryy/octocode/blob/main/docs/LSP_SERVER_LIFECYCLE.md#full-format-support-matrix)** (151 extensions: 61 AST, 47 signature, 32 LSP, 90 minify-only). Regenerate or verify with `yarn workspace @octocodeai/octocode-benchmark matrix:check`.
458
+ 📋 **Full support matrix:** every extension with its exact AST, signature, LSP,
459
+ and minify capability lives in the
460
+ **[Full format support matrix](https://github.com/bgauryy/octocode/blob/main/packages/octocode-engine/docs/LSP_SERVER_LIFECYCLE.md#full-format-support-matrix)**.
348
461
 
349
462
  ---
350
463
 
@@ -353,17 +466,45 @@ Four code-intelligence axes; three are native to the Rust engine and need no ext
353
466
  > [Agent Skills](https://agentskills.io/what-are-skills) are a lightweight, open format for extending AI agent capabilities.
354
467
  > Browse and install on [**skills.sh/bgauryy/octocode-mcp**](https://www.skills.sh/bgauryy/octocode-mcp)
355
468
 
356
- **1 skill** under [`skills/`](https://github.com/bgauryy/octocode/tree/main/skills), bundled in the `octocode` package. Start with ⭐ [Research](https://www.skills.sh/bgauryy/octocode-mcp/octocode-research) for evidence-first code work.
469
+ **13 skills** under [`skills/`](https://github.com/bgauryy/octocode/tree/main/skills), bundled in the `octocode` package. Each is a lean `SKILL.md` that loads references only when needed, so they compose. Start with ⭐ [Research](https://www.skills.sh/bgauryy/octocode-mcp/octocode-research) for evidence-first code work.
357
470
 
358
471
  ```bash
359
- npx octocode skill --list
360
- npx octocode skill --name octocode-research
361
- npx octocode skill --help
472
+ npx octocode skill list
473
+ npx octocode skill install octocode-research --platform pi
474
+ npx octocode skill check --json
475
+ npx octocode skill help
362
476
  ```
363
477
 
364
- | Skill | Install | Use when |
365
- |-------|---------|----------|
366
- | ⭐ [**Research**](https://www.skills.sh/bgauryy/octocode-mcp/octocode-research) | `npx octocode skill --name octocode-research` | Evidence-first research, review, refactor, architecture. |
478
+ #### Core Research & Extraction
479
+ | Skill | Use when |
480
+ |-------|----------|
481
+ | ⭐ [**octocode-research**](https://github.com/bgauryy/octocode/tree/main/skills/octocode-research) | Evidence-first research, review, debugging, refactors, prior-art validation. |
482
+ | [**octocode-scraping**](https://github.com/bgauryy/octocode/tree/main/skills/octocode-scraping) | Public page extraction and crawl triage: static corpus + graph v2 (pages/data/actions/risks/evidence), then CDP handoff for dynamic actions and blocked pages. |
483
+ | [**octocode-chrome-devtools**](https://github.com/bgauryy/octocode/tree/main/skills/octocode-chrome-devtools) | Browser/CDP evidence: network, console, performance, cookies/storage, screenshots, auth-gated pages, and live validation of scrape-graph actions. |
484
+
485
+ #### Planning & Architecture
486
+ | Skill | Use when |
487
+ |-------|----------|
488
+ | [**octocode-brainstorming**](https://github.com/bgauryy/octocode/tree/main/skills/octocode-brainstorming) | Disciplined idea exploration before building: options, worth-building tests, prior-art maps. |
489
+ | [**octocode-rfc-generator**](https://github.com/bgauryy/octocode/tree/main/skills/octocode-rfc-generator) | Evidence-backed RFCs, design docs, migration plans, option comparisons. |
490
+ | [**octocode-documentation**](https://github.com/bgauryy/octocode/tree/main/skills/octocode-documentation) | Writing or updating README, API docs, runbooks, AGENTS.md, ADRs. |
491
+
492
+ #### Evaluation & Review
493
+ | Skill | Use when |
494
+ |-------|----------|
495
+ | [**octocode-roast**](https://github.com/bgauryy/octocode/tree/main/skills/octocode-roast) | Blunt, evidence-backed code critique with severity ranking and repair paths. |
496
+ | [**octocode-graph-eval**](https://github.com/bgauryy/octocode/tree/main/skills/octocode-graph-eval) | Measuring whether a change helped: goal→KPI contracts, baselines, accept/revert loops, eval suites. |
497
+ | [**octocode-prompt-optimizer**](https://github.com/bgauryy/octocode/tree/main/skills/octocode-prompt-optimizer) | Making prompts, tool schemas, and agent contracts clearer, safer, cheaper, measurable. |
498
+
499
+ #### Agent Orchestration
500
+ | Skill | Use when |
501
+ |-------|----------|
502
+ | [**octocode-subagent**](https://github.com/bgauryy/octocode/tree/main/skills/octocode-subagent) | Delegation: spawn gates, decomposition, sealed packets, coordination, synthesis. |
503
+ | [**octocode-awareness**](https://github.com/bgauryy/octocode/tree/main/skills/octocode-awareness) | Shared-repo coordination: collision avoidance, handoffs, verification debt, durable memory. |
504
+ | [**octocode-skills**](https://github.com/bgauryy/octocode/tree/main/skills/octocode-skills) | Agent-skill lifecycle: discover, review, create, improve, install, sync. |
505
+ | [**octocode-orchestrator-local-worker**](https://github.com/bgauryy/octocode/tree/main/skills/octocode-orchestrator-local-worker) | Offloading token-heavy text work to a local Ollama worker under a verify gate. |
506
+
507
+ **Web automation workflow:** `octocode-scraping` performs the safe static pass first (fetch/crawl/extract → local corpus → graph v2). When the graph exposes dynamic actions or static output is blocked/thin, `octocode-chrome-devtools` validates live actionability, cookies/storage, network/HAR bodies, screenshots, or auth-gated state; discovered URLs/data/artifacts can be fed back into the scraping corpus for continued proof.
367
508
 
368
509
  ---
369
510
 
@@ -403,13 +544,13 @@ client → sanitize inputs (Rust) → run tool (GitHub / FS / LSP) → sanitize
403
544
  | Directory | npm package | Role |
404
545
  |-----------|-------------|------|
405
546
  | [`packages/octocode`](https://github.com/bgauryy/octocode/tree/main/packages/octocode) | `octocode` | CLI: quick commands, raw tool runner, skill installs, auth/login/logout, install, status, context. |
406
- | [`packages/octocode-mcp`](https://github.com/bgauryy/octocode/tree/main/packages/octocode-mcp) | `@octocodeai/mcp` | MCP server (stdio) that registers the tool catalog for AI assistants. |
547
+ | [`packages/octocode-mcp`](https://github.com/bgauryy/octocode/tree/main/packages/octocode-mcp) | `octocode-mcp` | MCP server (stdio) that registers the tool catalog for AI assistants. |
407
548
  | [`packages/octocode-tools-core`](https://github.com/bgauryy/octocode/tree/main/packages/octocode-tools-core) | `@octocodeai/octocode-tools-core` | Shared tool core: implementations, GitHub client, credentials and token resolution, session, pagination, security bridge. |
408
549
  | [`packages/octocode-engine`](https://github.com/bgauryy/octocode/tree/main/packages/octocode-engine) | `@octocodeai/octocode-engine` | Rust/napi native engine: security scanning, minification, signatures, structural AST, ripgrep/diff/YAML, LSP. |
409
550
  | [`packages/octocode-config`](https://github.com/bgauryy/octocode/tree/main/packages/octocode-config) | `@octocodeai/config` | Zero-dep env + config loader: `getOctocodeHome`, `.env` parsing, `.octocoderc` reading. Single source used by every package and skill. |
410
551
  | [`packages/octocode-vscode`](https://github.com/bgauryy/octocode/tree/main/packages/octocode-vscode) | `octocode-mcp-vscode` | VS Code extension: GitHub OAuth + multi-editor MCP install. |
411
552
 
412
- `packages/octocode-benchmark` (private, not published) holds benchmark methodology, evals, and run artifacts see [Documentation](#documentation).
553
+ `packages/octocode-benchmark` (private, not published) holds benchmark methodology, evals, and run artifacts - see [Documentation](#documentation).
413
554
 
414
555
  ---
415
556
 
@@ -419,25 +560,29 @@ Website: **[octocode.ai](https://octocode.ai)** · Product docs: **[github.com/b
419
560
 
420
561
  | Area | Docs |
421
562
  |---|---|
422
- | MCP server | [Octocode MCP Server](https://github.com/bgauryy/octocode/blob/main/docs/OCTOCODE_MCP.md) · [Configuration](https://github.com/bgauryy/octocode/blob/main/docs/CONFIGURATION.md) · [Authentication](https://github.com/bgauryy/octocode/blob/main/docs/CONFIGURATION.md) |
423
- | Tools and workflows | [Octocode Tools Reference](https://github.com/bgauryy/octocode/blob/main/docs/OCTOCODE_TOOLS.md) · [Octocode Research Skill](https://github.com/bgauryy/octocode/tree/main/skills/octocode-research) · [Search Guide](https://github.com/bgauryy/octocode/blob/main/docs/context/SEARCH_GUIDE.md) |
424
- | CLI and query language | [Octocode CLI Guide](https://github.com/bgauryy/octocode/blob/main/docs/OCTOCODE_CLI.md) · [Octocode Query Language](https://github.com/bgauryy/octocode/blob/main/docs/OCTOCODE_QUERY_LANGUAGE.md) · [OQL Research Graph Flow](https://github.com/bgauryy/octocode/blob/main/docs/context/OQL_RESEARCH_GRAPH_FLOW.md) |
563
+ | MCP server | [Octocode MCP Server](https://github.com/bgauryy/octocode/blob/main/docs/OCTOCODE_MCP.md) · [Configuration & Authentication](https://github.com/bgauryy/octocode/blob/main/docs/CONFIGURATION.md) |
564
+ | Tools and workflows | [Octocode Tools Reference](https://github.com/bgauryy/octocode/blob/main/docs/OCTOCODE_TOOLS.md) · [RDD Manifest & Workflows](https://github.com/bgauryy/octocode/blob/main/MANIFEST.md) · [Octocode Research Skill](https://github.com/bgauryy/octocode/tree/main/skills/octocode-research) · [Search Guide](https://github.com/bgauryy/octocode/blob/main/docs/context/SEARCH_GUIDE.md) |
565
+ | CLI | [Octocode CLI Guide](https://github.com/bgauryy/octocode/blob/main/packages/octocode/docs/OCTOCODE_CLI.md) |
425
566
  | Skills | [Skills](https://github.com/bgauryy/octocode/tree/main/skills) |
426
- | Development and security | [Security Model](https://github.com/bgauryy/octocode/blob/main/docs/SECURITY.md) · [LSP Server Lifecycle](https://github.com/bgauryy/octocode/blob/main/docs/LSP_SERVER_LIFECYCLE.md) |
427
- | Benchmarks and evals | [Benchmark Summary](https://github.com/bgauryy/octocode/blob/main/packages/octocode-benchmark/BENCHMARK.md) · [Unified CLI/Tool/OQL Eval](https://github.com/bgauryy/octocode/blob/main/packages/octocode-benchmark/benchmark/octocode/README.md) · [Benchmark Runbook](https://github.com/bgauryy/octocode/blob/main/packages/octocode-benchmark/recipes/agent-benchmark-runbook.md) · [Support Matrix](https://github.com/bgauryy/octocode/blob/main/docs/LSP_SERVER_LIFECYCLE.md#full-format-support-matrix) |
567
+ | Development and security | [Security Model](https://github.com/bgauryy/octocode/blob/main/docs/SECURITY.md) · [LSP Server Lifecycle](https://github.com/bgauryy/octocode/blob/main/packages/octocode-engine/docs/LSP_SERVER_LIFECYCLE.md) |
568
+ | Benchmarks and evals | [Benchmark Results](https://github.com/bgauryy/octocode/tree/main/packages/octocode-benchmark/results) · [Benchmark Design](https://github.com/bgauryy/octocode/blob/main/packages/octocode-benchmark/skills/octocode-benchmark/references/BENCHMARK.md) · [Benchmark Runbook](https://github.com/bgauryy/octocode/blob/main/packages/octocode-benchmark/skills/octocode-benchmark/references/INSTRUCTIONS.md) · [Support Matrix](https://github.com/bgauryy/octocode/blob/main/packages/octocode-engine/docs/LSP_SERVER_LIFECYCLE.md#full-format-support-matrix) |
428
569
  | Shared internals | [Credentials Architecture](https://github.com/bgauryy/octocode/blob/main/docs/CONFIGURATION.md#github-token) · [Session Persistence](https://github.com/bgauryy/octocode/blob/main/docs/OCTOCODE_MCP.md#session-persistence) |
429
570
 
430
571
  ---
431
572
 
432
573
  ## Troubleshooting
433
574
 
434
- Having Node.js issues? Run:
575
+ **Node.js or Environment Issues?**
576
+ Run the built-in doctor command to check your environment:
435
577
 
436
578
  ```bash
437
579
  npx node-doctor check --json
438
580
  ```
439
581
 
440
- Read the output and fix accordingly.
582
+ **Common Pitfalls:**
583
+ - **GitHub Auth Failures:** Ensure your Personal Access Token (PAT) has the `repo` and `read:user` scopes. If using the CLI, run `npx octocode auth login` to refresh.
584
+ - **MCP Connection Issues:** If your AI assistant (like Cursor or Windsurf) fails to connect, ensure you have run `npx octocode auth login` in your terminal first, or explicitly pass your `OCTOCODE_TOKEN` in the MCP `env` configuration.
585
+ - **Native Engine Errors:** Octocode uses a prebuilt Rust engine. If it fails to load on Linux, ensure your system has `glibc` or `musl` compatibility. On macOS/Windows, ensure you are on a supported architecture (x64 or arm64).
441
586
 
442
587
  ---
443
588
 
@@ -445,21 +590,19 @@ Read the output and fix accordingly.
445
590
 
446
591
  ### Recommended dev mode: Pi + Octocode
447
592
 
448
- [Pi](https://github.com/earendil-works/pi) is a fast, local-first coding agent whose stated philosophy is *"CLI tools with READMEs (Skills) over MCP."* Pairing it with Octocode gives a lean, evidence-driven dev loop **Pi edits, Octocode researches**. Two routes, pick by how much surface you need:
593
+ [Pi](https://github.com/earendil-works/pi) is a fast, local-first coding agent whose stated philosophy is *"CLI tools with READMEs (Skills) over MCP."* Pairing it with Octocode gives a lean, evidence-driven dev loop - **Pi edits, Octocode researches**. Two routes, pick by how much surface you need:
449
594
 
450
- - **Skill route recommended, leanest.** Drop the [`octocode-research`](https://www.skills.sh/bgauryy/octocode-mcp/octocode-research) skill into Pi's global skills dir. It drives the Octocode **CLI** directly no MCP transport, minimal token overhead and Pi auto-discovers it:
595
+ - **Skill route - recommended, leanest.** Drop the [`octocode-research`](https://www.skills.sh/bgauryy/octocode-mcp/octocode-research) skill into Pi's global skills dir. It drives the Octocode **CLI** directly - no MCP transport, minimal token overhead - and Pi auto-discovers it:
451
596
 
452
597
  ```bash
453
- npx octocode skill --name octocode-research --platform pi
598
+ npx octocode skill install octocode-research --platform pi
454
599
  ```
455
600
 
456
- - **Adapter route full tool surface.** Install [`pi-mcp-adapter`](https://github.com/nicobailon/pi-mcp-adapter) to expose Octocode MCP tools behind a single ~200-token proxy tool, so servers stay disconnected until a tool is actually called. Enable clone tools with `ENABLE_CLONE=true`.
601
+ - **Adapter route - full tool surface.** Install [`pi-mcp-adapter`](https://github.com/nicobailon/pi-mcp-adapter) to expose Octocode MCP tools behind a single ~200-token proxy tool, so servers stay disconnected until a tool is actually called. Enable clone tools with `ENABLE_CLONE=true`.
457
602
 
458
603
  ### Research-driven loop
459
604
 
460
- Most agent failures start before implementation: the agent guesses the owner of a behavior, trusts a snippet without reading the exact source, or edits before proving blast radius. Prefer a cheaper loop first: orient with trees and discovery output, search with Octocode, read exact evidence, use AST/LSP when identity matters, then patch and verify.
461
-
462
- That shape keeps the editing surface small while preserving context for what matters: file anchors, symbols, call paths, PR/history evidence, package sources, and the verification command that proves the change. In short, the host edits, Octocode is the map, and skills encode the habit.
605
+ Most agent failures happen before the edit: guessing who owns a behavior, trusting a snippet without reading the source, editing before proving blast radius. Run a cheaper loop instead: orient with trees, search, read exact evidence, use AST/LSP when identity matters, then patch and verify. The host edits, Octocode is the map, and skills encode the habit.
463
606
 
464
607
  ### The Manifest
465
608