opencode icon indicating copy to clipboard operation
opencode copied to clipboard

fix(cli): add help text to debug command and subcommands

Open assagman opened this issue 1 week ago • 1 comments

Summary

Add describe property to debug command and all its subcommands so they appear in --help output.

Fixes: #7330
Supersedes: #1524 (stale since Aug 2025, missing newer subcommands)

Changes

  • Add help text to debug command and subcommands (config, lsp, file, skill, agent, ripgrep, scrap, snapshot)
  • Fix web command description (differentiate from serve)
  • Handle null message in yargs fail handler

Before

$ opencode --help | rg "debug"
opencode --help | rg "web"
opencode debug --help 2>&1 | rg "config|lsp|file|skill|agent|rg|scrap|snapshot|paths|wait"
opencode debug lsp --help 2>&1 | rg "diagnostics|symbols|document-symbols"
opencode debug file --help 2>&1 | rg "read|status"
opencode debug rg --help 2>&1 | rg "tree|files|search"
opencode debug snapshot --help 2>&1 | rg "track|patch|diff"

  opencode web                 starts a headless opencode server

After

$ bun run dev --help | rg "debug"
bun run dev --help | rg "web"
bun run dev debug --help 2>&1 | rg "config|lsp|file|skill|agent|rg|scrap|snapshot|paths|wait"
bun run dev debug lsp --help 2>&1 | rg "diagnostics|symbols|document-symbols"
bun run dev debug file --help 2>&1 | rg "read|status"
bun run dev debug rg --help 2>&1 | rg "tree|files|search"
bun run dev debug snapshot --help 2>&1 | rg "track|patch|diff"

  opencode debug               debugging and troubleshooting tools

  opencode web                 start opencode server and open web interface

  opencode debug config        show resolved configuration
  opencode debug lsp           LSP debugging utilities
  opencode debug rg            ripgrep debugging utilities
  opencode debug file          file system debugging utilities
  opencode debug scrap         list all known projects
  opencode debug skill         list all available skills
  opencode debug snapshot      snapshot debugging utilities
  opencode debug agent <name>  show agent configuration details
  opencode debug paths         show global paths (data, config, cache, state)
  opencode debug wait          wait indefinitely (for debugging)
  opencode debug lsp diagnostics <file>      get diagnostics for a file
  opencode debug lsp symbols <query>         search workspace symbols
  opencode debug lsp document-symbols <uri>  get symbols from a document
  opencode debug file read <path>     read file contents as JSON
  opencode debug file status          show file status information
  opencode debug rg tree              show file tree using ripgrep
  opencode debug rg files             list files using ripgrep
  opencode debug rg search <pattern>  search file contents using ripgrep
  opencode debug snapshot track         track current snapshot state
  opencode debug snapshot patch <hash>  show patch for a snapshot hash
  opencode debug snapshot diff <hash>   show diff for a snapshot hash

assagman avatar Jan 08 '26 12:01 assagman