{"record":{"id":"c6f81d7f7fd542b2","repo":"multica-ai/multica","slug":"title-is-required-c6f81d","errorCode":null,"errorMessage":"--title is required","messagePattern":"--title is required","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"server/cmd/multica/cmd_project.go","lineNumber":309,"sourceCode":"\t\theaders := []string{\"ID\", \"TITLE\", \"STATUS\", \"LEAD\", \"DESCRIPTION\"}\n\t\trows := [][]string{{\n\t\t\tstrVal(project, \"id\"),\n\t\t\tstrVal(project, \"title\"),\n\t\t\tstrVal(project, \"status\"),\n\t\t\tlead,\n\t\t\tstrVal(project, \"description\"),\n\t\t}}\n\t\tcli.PrintTable(os.Stdout, headers, rows)\n\t\treturn nil\n\t}\n\n\treturn cli.PrintJSON(os.Stdout, project)\n}\n\nfunc runProjectCreate(cmd *cobra.Command, _ []string) error {\n\ttitle, _ := cmd.Flags().GetString(\"title\")\n\tif title == \"\" {\n\t\treturn fmt.Errorf(\"--title is required\")\n\t}\n\n\tclient, err := newAPIClient(cmd)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tctx, cancel := cli.APIContext(context.Background())\n\tdefer cancel()\n\n\tbody := map[string]any{\"title\": title}\n\tif v, _ := cmd.Flags().GetString(\"description\"); v != \"\" {\n\t\tbody[\"description\"] = v\n\t}\n\tif v, _ := cmd.Flags().GetString(\"status\"); v != \"\" {\n\t\tif err := validateProjectStatus(v); err != nil {\n\t\t\treturn err\n\t\t}","sourceCodeStart":291,"sourceCodeEnd":327,"githubUrl":"https://github.com/multica-ai/multica/blob/2c0912b6ec764b373d44eeea1e80f0d9f11ab417/server/cmd/multica/cmd_project.go#L291-L327","documentation":"Flag guard in runProjectCreate (cmd_project.go:309): `multica project create` was invoked without a non-empty --title. Title is the only required field for creation (description and others are optional), so the CLI rejects the call locally before constructing the API client.","triggerScenarios":"Omitting --title entirely, or passing --title \"\" (empty string) — including scripts where $TITLE expands to nothing and the quotes keep the argument present but empty.","commonSituations":"Shell scripts with unset variables quoted as \"\"; pipelines that derive the title from an empty field; assuming an interactive prompt will ask for the title.","solutions":["Pass a non-empty title: `multica project create --title \"Q3 Migration\"`.","Guard in scripts: `[ -n \"$TITLE\" ] || { echo 'title required'; exit 1; }` before the call.","Use ${TITLE:?} so the shell itself fails fast on an unset variable."],"exampleFix":"# before\nmultica project create --title \"$TITLE\"   # $TITLE unset -> --title \"\"\n# --title is required\n\n# after\nmultica project create --title \"${TITLE:?TITLE must be set}\"","handlingStrategy":"validation","validationCode":"title := strings.TrimSpace(os.Getenv(\"PROJECT_TITLE\"))\nif title == \"\" { return fmt.Errorf(\"PROJECT_TITLE must be set\") }","typeGuard":"func hasTitle(s string) bool { return strings.TrimSpace(s) != \"\" }","tryCatchPattern":null,"preventionTips":["Use ${TITLE:?} shell parameter expansion to fail before the CLI runs.","Trim whitespace when deriving titles from files or tickets.","Assert required flags up front in wrapper scripts instead of relying on CLI guards."],"tags":["cli","project","usage","flags","go"],"backgroundTag":null,"analyzedSha":"2c0912b6ec764b373d44eeea1e80f0d9f11ab417","analyzedAt":"2026-08-15T13:25:18.241Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}