{"record":{"id":"ebdb2c280d2a15db","repo":"gastownhall/beads","slug":"line-d-unsupported-batch-command-q-supported","errorCode":null,"errorMessage":"line %d: unsupported batch command %q (supported: close, update, create, dep add, dep remove)","messagePattern":"line (.+?): unsupported batch command %q \\(supported: close, update, create, dep add, dep remove\\)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/bd/batch.go","lineNumber":288,"sourceCode":"\t\t\top.args = tokens[1:]\n\t\tcase \"create\":\n\t\t\top.cmd = \"create\"\n\t\t\top.args = tokens[1:]\n\t\tcase \"dep\":\n\t\t\tif len(tokens) < 2 {\n\t\t\t\treturn nil, fmt.Errorf(\"line %d: 'dep' requires a subcommand (add|remove)\", lineNo)\n\t\t\t}\n\t\t\tswitch tokens[1] {\n\t\t\tcase \"add\":\n\t\t\t\top.cmd = \"dep.add\"\n\t\t\tcase \"remove\", \"rm\":\n\t\t\t\top.cmd = \"dep.remove\"\n\t\t\tdefault:\n\t\t\t\treturn nil, fmt.Errorf(\"line %d: unknown dep subcommand %q (want add|remove)\", lineNo, tokens[1])\n\t\t\t}\n\t\t\top.args = tokens[2:]\n\t\tdefault:\n\t\t\treturn nil, fmt.Errorf(\"line %d: unsupported batch command %q (supported: close, update, create, dep add, dep remove)\", lineNo, tokens[0])\n\t\t}\n\t\tops = append(ops, op)\n\t}\n\tif err := scanner.Err(); err != nil {\n\t\treturn nil, err\n\t}\n\treturn ops, nil\n}\n\n// tokenizeBatchLine splits a line into whitespace-separated tokens with\n// support for double-quoted strings. Escape sequences inside quotes: \\\" and\n// \\\\. Anything else after a backslash inside quotes is treated literally.\nfunc tokenizeBatchLine(s string) ([]string, error) {\n\tvar tokens []string\n\tvar cur strings.Builder\n\tinQuote := false\n\thasToken := false\n\tfor i := 0; i < len(s); i++ {","sourceCodeStart":270,"sourceCodeEnd":306,"githubUrl":"https://github.com/gastownhall/beads/blob/71377f276968b452ee607177637970a4ff888584/cmd/bd/batch.go#L270-L306","documentation":"Batch mode supports only `close`, `update`, `create`, `dep add`, and `dep remove`. Any line whose first token is not one of these causes `parseBatchScript` to reject the entire script (before any writes) and report the unsupported command with the list of supported ones.","triggerScenarios":"A batch script line starting with an unknown command, e.g. `delete bd-1`, `comment bd-1 \"note\"`, or a regular CLI verb not implemented in batch mode, passed to `bd batch`.","commonSituations":"Scripts written for `bd create`-style CLI syntax pasted into batch mode; generated scripts using verbs from other tools; typos like `clos`.","solutions":["Rewrite the reported line using only close/update/create/dep add/dep remove.","Run unsupported operations as separate `bd` commands outside the batch file.","Fix typos in supported command names (e.g. `clos` -> `close`).","Validate the whole script with `bd batch --dry-run` before executing."],"exampleFix":"// before (batch file)\ndelete bd-1\n// after\nclose bd-1","handlingStrategy":"validation","validationCode":"# Check first tokens against the supported command set:\nawk '!/^#/ && NF && !($1==\"close\"||$1==\"update\"||$1==\"create\"||$1==\"dep\") { print \"line \" NR \": unsupported: \" $1 }' batch.txt","typeGuard":null,"tryCatchPattern":"if err := runBdBatch(file); err != nil {\n    if strings.Contains(err.Error(), \"unsupported batch command\") {\n        return fmt.Errorf(\"rewrite the line using close/update/create/dep add/dep remove: %w\", err)\n    }\n    return err\n}","preventionTips":["Memorize the supported set: close, update, create, dep add, dep remove.","Translate other CLI verbs (delete, comment, etc.) to equivalent batch ops or run them separately.","Wire `bd batch --dry-run` into script-generation pipelines."],"tags":["cli","batch","parsing"],"backgroundTag":"batch-script-parse-error","analyzedSha":"71377f276968b452ee607177637970a4ff888584","analyzedAt":"2026-08-30T18:55:39.744Z","schemaVersion":2},"datasetVersion":"2026-08-30T23:17:21.991Z"}