{"record":{"id":"d803e57d059be7ee","repo":"multica-ai/multica","slug":"name-is-required-d803e5","errorCode":null,"errorMessage":"--name is required","messagePattern":"--name is required","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"server/cmd/multica/cmd_workspace.go","lineNumber":285,"sourceCode":"\t\t}\n\t\tfmt.Fprintf(w, \"%s\\t%s\\t%s\\t%s\\n\", marker, displayID(ws.ID, fullID), ws.Name, ws.Slug)\n\t}\n\tif err := w.Flush(); err != nil {\n\t\treturn err\n\t}\n\tif currentID != \"\" {\n\t\tfmt.Fprintln(os.Stderr, \"\\n* = current default workspace (use 'multica workspace switch <id|slug|prefix>' to change)\")\n\t} else {\n\t\tfmt.Fprintln(os.Stderr, \"\\nNo default workspace set. Use 'multica workspace switch <id|slug|prefix>' to pick one.\")\n\t}\n\tfmt.Fprintln(os.Stderr, \"Tip: pass the ID column, SLUG, or full UUID (--full-id) to 'workspace get/update/switch'.\")\n\treturn nil\n}\n\nfunc buildWorkspaceCreateBody(cmd *cobra.Command) (map[string]any, error) {\n\tname, _ := cmd.Flags().GetString(\"name\")\n\tif strings.TrimSpace(name) == \"\" {\n\t\treturn nil, fmt.Errorf(\"--name is required\")\n\t}\n\n\t// The server requires both name and slug (POST /api/workspaces returns 400\n\t// without them) and the slug is immutable after creation, so it must be\n\t// chosen explicitly here rather than silently omitted.\n\tslug, _ := cmd.Flags().GetString(\"slug\")\n\tif strings.TrimSpace(slug) == \"\" {\n\t\treturn nil, fmt.Errorf(\"--slug is required\")\n\t}\n\n\t// A single stdin stream cannot feed two fields: whichever field reads first\n\t// drains it and the other gets EOF. Reject the ambiguous combination up\n\t// front instead of surfacing a misleading \"content is empty\" error.\n\tdescStdin, _ := cmd.Flags().GetBool(\"description-stdin\")\n\tctxStdin, _ := cmd.Flags().GetBool(\"context-stdin\")\n\tif descStdin && ctxStdin {\n\t\treturn nil, fmt.Errorf(\"--description-stdin and --context-stdin cannot be combined; a single stdin cannot feed both fields — pass one of them inline\")\n\t}","sourceCodeStart":267,"sourceCodeEnd":303,"githubUrl":"https://github.com/multica-ai/multica/blob/2c0912b6ec764b373d44eeea1e80f0d9f11ab417/server/cmd/multica/cmd_workspace.go#L267-L303","documentation":"`multica workspace create` requires an explicit --name; buildWorkspaceCreateBody rejects a missing or whitespace-only value before any network call. The server mandates the field, so the CLI validates locally to fail fast.","triggerScenarios":"Running `multica workspace create --slug my-team` without --name, or with `--name \" \"` (trimmed to empty).","commonSituations":"Scripts where the name variable is empty due to a skipped prompt or a typo'd variable name.","solutions":["Pass a non-empty name: `multica workspace create --name \"My Team\" --slug my-team`.","In scripts, check the variable is non-empty before invoking (e.g. `: \"${NAME:?name required}\"`)."],"exampleFix":"# before\nmultica workspace create --slug my-team\n\n# after\nmultica workspace create --name \"My Team\" --slug my-team","handlingStrategy":"validation","validationCode":": \"${NAME:?--name is required}\"\nmultica workspace create --name \"$NAME\" --slug \"$SLUG\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use shell parameter expansion guards (`:?`) for required script inputs.","Trim and check name/slug before composing the command line."],"tags":["cli","validation","flag","workspace"],"backgroundTag":null,"analyzedSha":"2c0912b6ec764b373d44eeea1e80f0d9f11ab417","analyzedAt":"2026-08-15T13:25:18.241Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}