Skip to content

Commit adae0d1

Browse files
authored
fix(cli): add help text to debug command and subcommands (#7328)
Signed-off-by: assagman <[email protected]>
1 parent 61aeb2a commit adae0d1

File tree

11 files changed

+29
-4
lines changed

11 files changed

+29
-4
lines changed

packages/opencode/src/cli/cmd/debug/agent.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { cmd } from "../cmd"
66

77
export const AgentCommand = cmd({
88
command: "agent <name>",
9+
describe: "show agent configuration details",
910
builder: (yargs) =>
1011
yargs.positional("name", {
1112
type: "string",

packages/opencode/src/cli/cmd/debug/config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { cmd } from "../cmd"
55

66
export const ConfigCommand = cmd({
77
command: "config",
8+
describe: "show resolved configuration",
89
builder: (yargs) => yargs,
910
async handler() {
1011
await bootstrap(process.cwd(), async () => {

packages/opencode/src/cli/cmd/debug/file.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { Ripgrep } from "@/file/ripgrep"
66

77
const FileSearchCommand = cmd({
88
command: "search <query>",
9+
describe: "search files by query",
910
builder: (yargs) =>
1011
yargs.positional("query", {
1112
type: "string",
@@ -22,6 +23,7 @@ const FileSearchCommand = cmd({
2223

2324
const FileReadCommand = cmd({
2425
command: "read <path>",
26+
describe: "read file contents as JSON",
2527
builder: (yargs) =>
2628
yargs.positional("path", {
2729
type: "string",
@@ -38,6 +40,7 @@ const FileReadCommand = cmd({
3840

3941
const FileStatusCommand = cmd({
4042
command: "status",
43+
describe: "show file status information",
4144
builder: (yargs) => yargs,
4245
async handler() {
4346
await bootstrap(process.cwd(), async () => {
@@ -49,6 +52,7 @@ const FileStatusCommand = cmd({
4952

5053
const FileListCommand = cmd({
5154
command: "list <path>",
55+
describe: "list files in a directory",
5256
builder: (yargs) =>
5357
yargs.positional("path", {
5458
type: "string",
@@ -65,6 +69,7 @@ const FileListCommand = cmd({
6569

6670
const FileTreeCommand = cmd({
6771
command: "tree [dir]",
72+
describe: "show directory tree",
6873
builder: (yargs) =>
6974
yargs.positional("dir", {
7075
type: "string",
@@ -79,6 +84,7 @@ const FileTreeCommand = cmd({
7984

8085
export const FileCommand = cmd({
8186
command: "file",
87+
describe: "file system debugging utilities",
8288
builder: (yargs) =>
8389
yargs
8490
.command(FileReadCommand)

packages/opencode/src/cli/cmd/debug/index.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import { AgentCommand } from "./agent"
1212

1313
export const DebugCommand = cmd({
1414
command: "debug",
15+
describe: "debugging and troubleshooting tools",
1516
builder: (yargs) =>
1617
yargs
1718
.command(ConfigCommand)
@@ -25,6 +26,7 @@ export const DebugCommand = cmd({
2526
.command(PathsCommand)
2627
.command({
2728
command: "wait",
29+
describe: "wait indefinitely (for debugging)",
2830
async handler() {
2931
await bootstrap(process.cwd(), async () => {
3032
await new Promise((resolve) => setTimeout(resolve, 1_000 * 60 * 60 * 24))
@@ -37,6 +39,7 @@ export const DebugCommand = cmd({
3739

3840
const PathsCommand = cmd({
3941
command: "paths",
42+
describe: "show global paths (data, config, cache, state)",
4043
handler() {
4144
for (const [key, value] of Object.entries(Global.Path)) {
4245
console.log(key.padEnd(10), value)

packages/opencode/src/cli/cmd/debug/lsp.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,15 @@ import { EOL } from "os"
66

77
export const LSPCommand = cmd({
88
command: "lsp",
9+
describe: "LSP debugging utilities",
910
builder: (yargs) =>
1011
yargs.command(DiagnosticsCommand).command(SymbolsCommand).command(DocumentSymbolsCommand).demandCommand(),
1112
async handler() {},
1213
})
1314

1415
const DiagnosticsCommand = cmd({
1516
command: "diagnostics <file>",
17+
describe: "get diagnostics for a file",
1618
builder: (yargs) => yargs.positional("file", { type: "string", demandOption: true }),
1719
async handler(args) {
1820
await bootstrap(process.cwd(), async () => {
@@ -25,6 +27,7 @@ const DiagnosticsCommand = cmd({
2527

2628
export const SymbolsCommand = cmd({
2729
command: "symbols <query>",
30+
describe: "search workspace symbols",
2831
builder: (yargs) => yargs.positional("query", { type: "string", demandOption: true }),
2932
async handler(args) {
3033
await bootstrap(process.cwd(), async () => {
@@ -37,6 +40,7 @@ export const SymbolsCommand = cmd({
3740

3841
export const DocumentSymbolsCommand = cmd({
3942
command: "document-symbols <uri>",
43+
describe: "get symbols from a document",
4044
builder: (yargs) => yargs.positional("uri", { type: "string", demandOption: true }),
4145
async handler(args) {
4246
await bootstrap(process.cwd(), async () => {

packages/opencode/src/cli/cmd/debug/ripgrep.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,14 @@ import { cmd } from "../cmd"
66

77
export const RipgrepCommand = cmd({
88
command: "rg",
9+
describe: "ripgrep debugging utilities",
910
builder: (yargs) => yargs.command(TreeCommand).command(FilesCommand).command(SearchCommand).demandCommand(),
1011
async handler() {},
1112
})
1213

1314
const TreeCommand = cmd({
1415
command: "tree",
16+
describe: "show file tree using ripgrep",
1517
builder: (yargs) =>
1618
yargs.option("limit", {
1719
type: "number",
@@ -25,6 +27,7 @@ const TreeCommand = cmd({
2527

2628
const FilesCommand = cmd({
2729
command: "files",
30+
describe: "list files using ripgrep",
2831
builder: (yargs) =>
2932
yargs
3033
.option("query", {
@@ -56,6 +59,7 @@ const FilesCommand = cmd({
5659

5760
const SearchCommand = cmd({
5861
command: "search <pattern>",
62+
describe: "search file contents using ripgrep",
5963
builder: (yargs) =>
6064
yargs
6165
.positional("pattern", {

packages/opencode/src/cli/cmd/debug/scrap.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { cmd } from "../cmd"
55

66
export const ScrapCommand = cmd({
77
command: "scrap",
8+
describe: "list all known projects",
89
builder: (yargs) => yargs,
910
async handler() {
1011
const timer = Log.Default.time("scrap")

packages/opencode/src/cli/cmd/debug/skill.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { cmd } from "../cmd"
55

66
export const SkillCommand = cmd({
77
command: "skill",
8+
describe: "list all available skills",
89
builder: (yargs) => yargs,
910
async handler() {
1011
await bootstrap(process.cwd(), async () => {

packages/opencode/src/cli/cmd/debug/snapshot.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,14 @@ import { cmd } from "../cmd"
44

55
export const SnapshotCommand = cmd({
66
command: "snapshot",
7+
describe: "snapshot debugging utilities",
78
builder: (yargs) => yargs.command(TrackCommand).command(PatchCommand).command(DiffCommand).demandCommand(),
89
async handler() {},
910
})
1011

1112
const TrackCommand = cmd({
1213
command: "track",
14+
describe: "track current snapshot state",
1315
async handler() {
1416
await bootstrap(process.cwd(), async () => {
1517
console.log(await Snapshot.track())
@@ -19,6 +21,7 @@ const TrackCommand = cmd({
1921

2022
const PatchCommand = cmd({
2123
command: "patch <hash>",
24+
describe: "show patch for a snapshot hash",
2225
builder: (yargs) =>
2326
yargs.positional("hash", {
2427
type: "string",
@@ -34,6 +37,7 @@ const PatchCommand = cmd({
3437

3538
const DiffCommand = cmd({
3639
command: "diff <hash>",
40+
describe: "show diff for a snapshot hash",
3741
builder: (yargs) =>
3842
yargs.positional("hash", {
3943
type: "string",

packages/opencode/src/cli/cmd/web.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ function getNetworkIPs() {
3030
export const WebCommand = cmd({
3131
command: "web",
3232
builder: (yargs) => withNetworkOptions(yargs),
33-
describe: "starts a headless opencode server",
33+
describe: "start opencode server and open web interface",
3434
handler: async (args) => {
3535
const opts = await resolveNetworkOptions(args)
3636
const server = Server.listen(opts)

0 commit comments

Comments
 (0)