{"record":{"id":"23a90176826b3e42","repo":"siyuan-note/siyuan","slug":"id-is-required-23a901","errorCode":null,"errorMessage":"--id is required","messagePattern":"--id is required","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"kernel/cli/cmd/inbox.go","lineNumber":91,"sourceCode":"\t\t\t\turl, _ := sh[\"shorthandURL\"].(string)\n\t\t\t\thCreated, _ := sh[\"hCreated\"].(string)\n\t\t\t\tfmt.Fprintf(w, \"%s\\t%s\\t%s\\t%s\\n\", id, title, url, hCreated)\n\t\t\t}\n\t\t\tw.Flush()\n\t\t\tfmt.Printf(\"\\n%d item(s) on page %d\\n\", len(shorthands), page)\n\t\t}\n\t\treturn nil\n\t},\n}\n\n// inboxGetCmd 取单条收集箱详情，返回完整 markdown 正文（shorthandMd）。\nvar inboxGetCmd = &cobra.Command{\n\tUse:   \"get --id <id>\",\n\tShort: \"Get a cloud inbox shorthand with full markdown\",\n\tRunE: func(cmd *cobra.Command, args []string) error {\n\t\tid, _ := cmd.Flags().GetString(\"id\")\n\t\tif id == \"\" {\n\t\t\treturn fmt.Errorf(\"--id is required\")\n\t\t}\n\n\t\tsh, err := model.GetCloudShorthand(id)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tswitch outputFormat {\n\t\tcase \"json\":\n\t\t\tdata, _ := json.MarshalIndent(sh, \"\", \"  \")\n\t\t\tfmt.Println(string(data))\n\t\tdefault:\n\t\t\ttitle, _ := sh[\"shorthandTitle\"].(string)\n\t\t\turl, _ := sh[\"shorthandURL\"].(string)\n\t\t\thCreated, _ := sh[\"hCreated\"].(string)\n\t\t\tmd, _ := sh[\"shorthandMd\"].(string)\n\t\t\tfmt.Println(\"ID:     \", id)\n\t\t\tfmt.Println(\"TITLE:  \", title)","sourceCodeStart":73,"sourceCodeEnd":109,"githubUrl":"https://github.com/siyuan-note/siyuan/blob/251596fc0de2f9528c00c224252fd073a99973f4/kernel/cli/cmd/inbox.go#L73-L109","documentation":"Thrown by the `inbox get` subcommand when `--id` is empty. The flag names a specific cloud inbox shorthand (web-clip) to fetch; it is forwarded to `model.GetCloudShorthand`, which calls the SiYuan cloud service. Without an ID the lookup has no target.","triggerScenarios":"Running `siyuan inbox get` with no `--id`. The RunE validates the flag before calling `model.GetCloudShorthand(id)`. Note this requires cloud connectivity and authentication.","commonSituations":"Forgetting the shorthand ID; not having run `inbox list` to discover IDs; cloud sync not configured so no shorthands exist.","solutions":["List inbox entries first: `siyuan inbox list`","Fetch by ID: `siyuan inbox get --id <shorthandID>`"],"exampleFix":"// before\nsiyuan inbox get\n// after\nsiyuan inbox get --id 16890001","handlingStrategy":"validation","validationCode":"if id == \"\" {\n    out, _ := cmd.Output(\"siyuan\", \"inbox\", \"list\")\n    log.Fatalf(\"shorthand ID required. Inbox:\\n%s\", out)\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Run `inbox list` to discover shorthand IDs","Confirm cloud sync is configured before inbox commands","Pass the numeric shorthand ID to `--id`"],"tags":["cli","validation","missing-argument","inbox","cloud","go","siyuan"],"backgroundTag":null,"analyzedSha":"251596fc0de2f9528c00c224252fd073a99973f4","analyzedAt":"2026-08-12T21:18:37.123Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}