octocode-cli 1.5.1 → 1.5.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (112) hide show
  1. package/README.md +28 -9
  2. package/out/chunks/chunk-375ZNU3A.js +317 -0
  3. package/out/chunks/{chunk-V64AXUWB.js → chunk-AYILFPX4.js} +1 -1
  4. package/out/chunks/chunk-BRHVQB64.js +10 -0
  5. package/out/chunks/{command-help-specs-JZXVSLZ5.js → chunk-KWJUBVXJ.js} +1 -1
  6. package/out/chunks/chunk-OMXWZJBJ.js +100 -0
  7. package/out/chunks/command-help-specs-RVJK6V6M.js +8 -0
  8. package/out/chunks/commands-JFDCC4Q7.js +8 -0
  9. package/out/chunks/{help-P7TCOYAJ.js → help-H3WGUJO7.js} +1 -1
  10. package/out/chunks/main-help-BUTDD4IR.js +10 -0
  11. package/out/chunks/{spinner-URV2OX6O.js → spinner-DXD4JQIU.js} +1 -1
  12. package/out/chunks/tool-command-L6PVHUNS.js +8 -0
  13. package/out/octocode-cli.js +1 -1
  14. package/package.json +2 -2
  15. package/skills/octocode-brainstorming/scripts/tavily-search.mjs +1 -10
  16. package/skills/octocode-chrome-devtools/scripts/cdp-runner.mjs +0 -2
  17. package/skills/octocode-chrome-devtools/scripts/cdp-sandbox.mjs +1 -5
  18. package/skills/octocode-chrome-devtools/scripts/cdp-template.mjs +1 -10
  19. package/skills/octocode-chrome-devtools/scripts/open-browser.mjs +0 -3
  20. package/skills/octocode-chrome-devtools/scripts/sourcemap-resolver.mjs +1 -4
  21. package/skills/octocode-chrome-devtools/scripts/undercover.mjs +0 -2
  22. package/skills/octocode-engineer/SKILL.md +7 -33
  23. package/skills/octocode-engineer/references/cli-reference.md +5 -11
  24. package/skills/octocode-engineer/references/externals.md +0 -4
  25. package/skills/octocode-engineer/references/quality-indicators.md +10 -50
  26. package/skills/octocode-engineer/references/tool-workflows.md +10 -13
  27. package/skills/octocode-engineer/src/analysis/dependency-summary.test.ts +2 -2
  28. package/skills/octocode-engineer/src/ast/metrics.test.ts +2 -2
  29. package/skills/octocode-engineer/src/ast/search-main.ts +2 -15
  30. package/skills/octocode-engineer/src/ast/search.ts +1 -7
  31. package/skills/octocode-engineer/src/ast/tree-sitter.test.ts +4 -4
  32. package/skills/octocode-engineer/src/ast/tree-sitter.ts +2 -2
  33. package/skills/octocode-engineer/src/collectors/chains.ts +3 -10
  34. package/skills/octocode-engineer/src/collectors/prototype-pollution.ts +3 -3
  35. package/skills/octocode-engineer/src/collectors/security.ts +3 -3
  36. package/skills/octocode-engineer/src/common/ensure-deps.ts +3 -20
  37. package/skills/octocode-engineer/src/detectors/code-quality.ts +0 -1
  38. package/skills/octocode-engineer/src/index.test.ts +1 -1
  39. package/skills/octocode-engineer/src/index.ts +1 -11
  40. package/skills/octocode-engineer/src/pipeline/affected.ts +2 -7
  41. package/skills/octocode-engineer/src/pipeline/baseline.ts +2 -8
  42. package/skills/octocode-engineer/src/pipeline/cache.ts +2 -2
  43. package/skills/octocode-engineer/src/pipeline/config-loader.test.ts +1 -2
  44. package/skills/octocode-engineer/src/pipeline/config-loader.ts +0 -9
  45. package/skills/octocode-engineer/src/pipeline/create-options.ts +2 -15
  46. package/skills/octocode-engineer/src/pipeline/reporters.ts +2 -12
  47. package/skills/octocode-engineer/src/reporting/summary-md.test.ts +2 -2
  48. package/skills/octocode-engineer/src/run.ts +1 -7
  49. package/skills/octocode-engineer/src/types/constants.ts +0 -5
  50. package/skills/octocode-engineer/src/types/core.ts +0 -5
  51. package/skills/octocode-news/eslint.config.mjs +1 -6
  52. package/skills/octocode-news/src/rss-core.ts +2 -4
  53. package/skills/octocode-research/ecosystem.config.cjs +0 -31
  54. package/skills/octocode-research/package.json +1 -1
  55. package/skills/octocode-research/scripts/server.js +272 -230
  56. package/skills/octocode-research/src/__tests__/integration/circuitBreaker.test.ts +0 -24
  57. package/skills/octocode-research/src/__tests__/integration/routes.test.ts +0 -10
  58. package/skills/octocode-research/src/__tests__/integration/serverLifecycle.test.ts +5 -22
  59. package/skills/octocode-research/src/__tests__/integration/toolsRoutes.test.ts +0 -27
  60. package/skills/octocode-research/src/__tests__/unit/circuitBreaker.test.ts +0 -29
  61. package/skills/octocode-research/src/__tests__/unit/errorHandler.test.ts +1 -12
  62. package/skills/octocode-research/src/__tests__/unit/httpPreprocess.test.ts +1 -9
  63. package/skills/octocode-research/src/__tests__/unit/logger.test.ts +0 -7
  64. package/skills/octocode-research/src/__tests__/unit/queryParser.test.ts +1 -7
  65. package/skills/octocode-research/src/__tests__/unit/responseBuilder.test.ts +0 -11
  66. package/skills/octocode-research/src/__tests__/unit/retry.test.ts +1 -18
  67. package/skills/octocode-research/src/__tests__/unit/schemas.test.ts +2 -25
  68. package/skills/octocode-research/src/index.ts +0 -27
  69. package/skills/octocode-research/src/mcpCache.ts +3 -18
  70. package/skills/octocode-research/src/middleware/errorHandler.ts +1 -4
  71. package/skills/octocode-research/src/middleware/logger.ts +1 -6
  72. package/skills/octocode-research/src/middleware/queryParser.ts +3 -22
  73. package/skills/octocode-research/src/routes/github.ts +0 -11
  74. package/skills/octocode-research/src/routes/local.ts +0 -12
  75. package/skills/octocode-research/src/routes/lsp.ts +1 -10
  76. package/skills/octocode-research/src/routes/package.ts +0 -2
  77. package/skills/octocode-research/src/routes/prompts.ts +2 -32
  78. package/skills/octocode-research/src/routes/tools.ts +12 -177
  79. package/skills/octocode-research/src/server-init.ts +0 -32
  80. package/skills/octocode-research/src/server.ts +8 -37
  81. package/skills/octocode-research/src/types/errorGuards.ts +0 -15
  82. package/skills/octocode-research/src/types/guards.ts +6 -27
  83. package/skills/octocode-research/src/types/mcp.ts +1 -8
  84. package/skills/octocode-research/src/types/responses.ts +0 -15
  85. package/skills/octocode-research/src/utils/asyncTimeout.ts +1 -63
  86. package/skills/octocode-research/src/utils/circuitBreaker.ts +43 -166
  87. package/skills/octocode-research/src/utils/colors.ts +3 -17
  88. package/skills/octocode-research/src/utils/errorQueue.ts +6 -28
  89. package/skills/octocode-research/src/utils/logger.ts +11 -93
  90. package/skills/octocode-research/src/utils/resilience.ts +22 -77
  91. package/skills/octocode-research/src/utils/responseBuilder.ts +26 -78
  92. package/skills/octocode-research/src/utils/responseFactory.ts +0 -7
  93. package/skills/octocode-research/src/utils/responseParser.ts +11 -59
  94. package/skills/octocode-research/src/utils/retry.ts +12 -75
  95. package/skills/octocode-research/src/utils/routeFactory.ts +10 -61
  96. package/skills/octocode-research/src/utils/url.ts +0 -5
  97. package/skills/octocode-research/src/validation/httpPreprocess.ts +15 -61
  98. package/skills/octocode-research/src/validation/schemas.ts +14 -101
  99. package/skills/octocode-research/src/validation/toolCallSchema.ts +5 -65
  100. package/skills/octocode-research/tsdown.config.ts +2 -7
  101. package/skills/octocode-search-skill/SKILL.md +9 -2
  102. package/skills/octocode-search-skill/references/discovery-surfaces.md +2 -1
  103. package/skills/octocode-slides/scripts/navbridge.js +1 -14
  104. package/skills/octocode-slides/scripts/presenter.js +2 -61
  105. package/skills/octocode-stats/scripts/build_dashboard.mjs +1 -19
  106. package/out/chunks/chunk-7476PETK.js +0 -309
  107. package/out/chunks/chunk-OQBJTZWK.js +0 -60
  108. package/out/chunks/chunk-UCZCF3BQ.js +0 -9
  109. package/out/chunks/commands-XBFPLHSQ.js +0 -8
  110. package/out/chunks/main-help-ULF5PAQY.js +0 -10
  111. package/out/chunks/tool-command-M6VA7P2F.js +0 -8
  112. package/skills/octocode-research/AGENTS.md +0 -349
package/README.md CHANGED
@@ -36,7 +36,7 @@ npx octocode-cli install
36
36
  Verify, then sign in:
37
37
 
38
38
  ```bash
39
- octocode --version # → octocode v1.5.0
39
+ octocode --version # → octocode v1.5.3
40
40
  octocode login # GitHub OAuth (device flow)
41
41
  ```
42
42
 
@@ -74,23 +74,28 @@ Call any tool directly from the terminal. Great for scripts, pipelines, and one-
74
74
  | **LSP** | `lspGotoDefinition` | Navigate to a symbol's definition |
75
75
  | | `lspFindReferences` | Find all usages of a symbol |
76
76
  | | `lspCallHierarchy` | Trace function call relationships |
77
- | **Package** | `packageSearch` | Resolve npm / PyPI packages to their source repo |
77
+ | **Package** | `packageSearch` | Resolve an npm package to its source repo + metadata |
78
78
 
79
79
  ```bash
80
80
  # Discover
81
+ octocode --agent # agent bootstrap: protocol + tools + input fields
82
+ octocode --agent --full # …plus every tool's full JSON schema inline
81
83
  octocode tools # list all tools
82
84
  octocode tools localSearchCode # show one tool's schema
83
85
  octocode tools localSearchCode githubSearchCode # batch schemas
84
- octocode instructions # full MCP instructions + all schemas
86
+ octocode instructions # alias of --agent (add --full for all schemas)
85
87
 
86
88
  # Run
87
89
  octocode tools localSearchCode --queries '{"path":".","pattern":"TODO"}'
88
90
  octocode tools githubSearchCode --queries '{"keywordsToSearch":["useReducer"],"owner":"facebook","repo":"react"}'
89
- octocode tools localSearchCode --queries '{"path":".","pattern":"TODO"}' --json # machine-readable
91
+ octocode tools localSearchCode --queries '{"path":".","pattern":"TODO"}' --json # full MCP envelope
92
+ octocode tools localSearchCode --queries '{"path":".","pattern":"TODO"}' --compact # leanest (structuredContent only)
90
93
  ```
91
94
 
92
95
  The shared metadata fields (`id`, `researchGoal`, `reasoning`, `mainResearchGoal`) are auto-filled. Provide only tool-specific fields.
93
96
 
97
+ > **For agents:** run `octocode --agent` once for the full bootstrap (protocol + every tool + input fields + the mandatory "read the schema before calling" rule + the exit-code table). Then `octocode tools <name>` to confirm a tool's exact schema before calling it. This checklist is also printed at the top of `octocode --help`.
98
+
94
99
  ---
95
100
 
96
101
  ## GitHub Token
@@ -103,6 +108,8 @@ For env-based setup, any of these are accepted (checked in this priority): `OCTO
103
108
  export GITHUB_TOKEN=ghp_xxx # or OCTOCODE_TOKEN / GH_TOKEN
104
109
  octocode token --source # show which token & source is being used
105
110
  octocode token --validate # ping the GitHub API to verify it
111
+ octocode token # masked on screen; raw when piped, e.g. export GH_TOKEN=$(octocode token)
112
+ octocode token --reveal # print the full token on screen
106
113
  ```
107
114
 
108
115
  ---
@@ -113,7 +120,7 @@ octocode token --validate # ping the GitHub API to verify it
113
120
  |---------|---------|--------------|
114
121
  | `install --ide <ide>` | `i`, `setup` | Configure octocode-mcp for an IDE |
115
122
  | `install --ide <ide> --check` | | Pre-flight: verify config path is writable, show what would change |
116
- | `install --ide <ide> -m <npx\|direct>` | | Choose install method (default `npx`; `direct` points at a local binary) |
123
+ | `install --ide <ide> --method npx` | | Installation method (`npx` is the only/default method) |
117
124
  | `install --ide <ide> --force` | | Overwrite an existing configuration |
118
125
  | `install --ide <ide> --rollback` | | Restore the most recent backup configuration |
119
126
  | `install --ide <ide> --rollback --backup-path <file>` | | Restore a specific backup file |
@@ -127,6 +134,7 @@ octocode token --validate # ping the GitHub API to verify it
127
134
  | `token --type <auto\|octocode\|gh>` | | Force a specific token source instead of auto-resolution |
128
135
  | `token --source` | | Show which source resolved the token |
129
136
  | `token --validate` | | Ping the GitHub API to verify the token and show rate-limit |
137
+ | `token --reveal` | | Print the full token on screen (default: masked on a terminal, raw when piped) |
130
138
  | `status` | `s` | Full health check: auth + MCP clients + cache |
131
139
  | `status --sync` | | Also include per-MCP sync analysis |
132
140
  | `sync` | `sy` | Sync MCP configs across all IDEs |
@@ -134,9 +142,10 @@ octocode token --validate # ping the GitHub API to verify it
134
142
  | `sync --status` | | Show sync analysis without syncing |
135
143
  | `sync --force` | | Auto-resolve conflicts (use first variant found) |
136
144
  | `skills` | `sk` | Install / remove / list / search / read / sync skills |
137
- | `skills search --direct` | | Search skills.sh directly (human-readable) |
145
+ | `skills search <query>` | | In a terminal: immediate results from skills.sh. In scripts/agents (non-TTY): emits the research protocol |
146
+ | `skills search --direct` | | Force direct results from skills.sh (auto-enabled in a terminal; use this in scripts/pipes) |
138
147
  | `skills search --direct --install` | | Fetch and install top result automatically |
139
- | `skills read <path\|github:owner/repo/name>` | | Preview a SKILL.md from disk or GitHub (`--full` for untruncated) |
148
+ | `skills read <path \| owner/repo/path \| github-url>` | | Preview a SKILL.md from disk or GitHub (`--full` for untruncated) |
140
149
  | `skills install --targets <t1,t2>` | | Install all bundled skills to targets |
141
150
  | `skills install --skill <name> --targets <t>` | | Install one specific skill |
142
151
  | `skills install --local <path> --targets <t>` | | Install a local skill folder |
@@ -174,7 +183,10 @@ Most subcommands accept `--hostname <host>` for GitHub Enterprise.
174
183
 
175
184
  | Flag | Description |
176
185
  |------|-------------|
177
- | `--json`, `-j` | Raw JSON output (machine-readable) |
186
+ | `--json`, `-j` | Raw JSON output (full MCP envelope) for tool runs |
187
+ | `--compact` | Leanest tool output: minified `structuredContent` only (~60% smaller than `--json`) |
188
+ | `--agent` | Print the agent bootstrap: protocol + every tool + input fields (add `--full` for all JSON schemas) |
189
+ | `--no-color` | Disable ANSI colors (also honored via `NO_COLOR=1`) |
178
190
  | `--version`, `-v` | Print the CLI version |
179
191
  | `--help`, `-h` | Show help for the CLI or a command |
180
192
 
@@ -192,7 +204,14 @@ Most subcommands accept `--hostname <host>` for GitHub Enterprise.
192
204
  | Code | Meaning |
193
205
  |------|---------|
194
206
  | `0` | Success |
195
- | `1` | Error |
207
+ | `1` | General error |
208
+ | `2` | Invalid input / unsupported flags |
209
+ | `3` | Unknown tool or command |
210
+ | `4` | Authentication failure |
211
+ | `5` | Tool / API execution error |
212
+ | `7` | Rate limited |
213
+
214
+ Typed codes `2`–`7` apply to the tool surface (`tools`, `--tool`) and command dispatch, so agents can branch on the failure mode without parsing output. Management commands (`install`, `auth`, `sync`, …) use `0`/`1`.
196
215
 
197
216
  ---
198
217