feat: octocode-cli research commands + skill#336
Conversation
Add a standalone CLI package (packages/octocode-tools/) that exposes all 13 octocode-mcp tools as CLI commands, reusing the existing execution functions directly. Usable via `npx octocode-tools`. - 6 GitHub commands: search-code, get-file, tree, search-repos, search-prs, search-packages - 4 Local commands: local-search, local-file, local-find, local-tree - 3 LSP commands: lsp-definition, lsp-references, lsp-call-hierarchy - Auth auto-resolves from gh CLI, env vars, or stored credentials - JSON output by default, --pretty for human-readable Add octocode-cli skill (skills/octocode-cli/) with CLI usage guide, funnel research methodology, command reference, workflow patterns, and adapted reference skills (documentation-writer, plan, PR reviewer, RFC generator, prompt optimizer, roast).
Consolidate the separate octocode-tools package (13 research CLI commands) into octocode-cli, creating a single unified CLI. Port all commands from Commander.js to the custom parser, reorganize into src/cli/commands/ directory (setup.ts, github.ts, local.ts, lsp.ts), and update all skill references from octocode-tools to octocode-cli. Delete packages/octocode-tools/ entirely.
Eliminate three sources of duplication: - CLI command options now derived from MCP Zod schemas via createToolCommand() - help.ts generates command listings from the commands array using category field - parser.ts derives OPTIONS_WITH_VALUES lazily from command definitions Add schema-bridge.ts with zodToCliOptions(), cliArgsToQuery(), and createToolCommand() factory. Update all 13 research commands and skill reference files for the new schema-derived kebab-case option names.
…kills - Delete skills/octocode-cli/references/ (duplicated copies of other skills) - Rewrite octocode-cli SKILL.md as self-contained with MCP→CLI mapping, usage patterns, and --help guidance - Add octocode-cli as alternative in each skill's MCP discovery section (documentation-writer, plan, PR reviewer, RFC generator, roast)
The CLI skill should stand on its own — describe commands directly without framing them as MCP alternatives.
JiwaniZakir
left a comment
There was a problem hiding this comment.
In github.ts, the searchPackagesCommand handler has two input validation gaps worth addressing. First, the ecosystem parameter is checked for presence via requireOption but its value is never validated against the allowed set ('npm' | 'python') — passing --ecosystem pip or --ecosystem pypi would silently forward an invalid value to searchPackages. Second, the parseInt call on line ~109 for search-limit doesn't guard against NaN: parseInt('abc', 10) returns NaN, which would be passed as searchLimit: NaN to the query without error.
In init.ts, the module-level initialized boolean works fine for a CLI process but will cause the singleton to stay "initialized" across test suites that import this module without resetting state between runs — worth either exporting a resetForTesting() helper or using a class-based approach if tests are planned.
Summary
Adds 13 research commands and an octocode-cli skill to enable code research via CLI.
CLI
search-code,get-file,tree,search-repos,search-prs,search-packages,local-search,local-file,local-find,local-tree,lsp-definition,lsp-references,lsp-call-hierarchycreateToolCommand()factory that auto-generates CLI options from Zod schemas — eliminates duplication between MCP tool definitions and CLI commandscategoryfield (GitHub / Local / LSP grouping)OPTIONS_WITH_VALUESfrom command definitions instead of hardcodingSkills
octocode-cliskill: Command table, Funnel Method, usage patterns per category,--helpguidanceoctocode-clias alternative when MCP is not installedP.S.
This PR follows the shift toward CLI + Skill-centric AI agent ecosystems. While sufficiently tested, this was largely vibe-coded — treat it more as a feature proposal than production-ready code.