{"record":{"id":"b30b2dd779be2dee","repo":"multica-ai/multica","slug":"nothing-to-update-pass-description-descripti","errorCode":null,"errorMessage":"nothing to update; pass --description, --description-stdin, --description-file, or --clear","messagePattern":"nothing to update; pass --description, --description-stdin, --description-file, or --clear","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"server/cmd/multica/cmd_user.go","lineNumber":105,"sourceCode":"\treturn nil\n}\n\nfunc runUserProfileUpdate(cmd *cobra.Command, _ []string) error {\n\t// `--clear` is its own flag (not \"pass an empty string\") because cobra's\n\t// default value for a Changed(\"\") flag would otherwise be ambiguous with\n\t// \"user typed `--description \"\"`\". Keep both forms supported — the inline\n\t// empty string is what someone scripting bash would reach for.\n\tclearFlag, _ := cmd.Flags().GetBool(\"clear\")\n\tdesc, hasDesc, err := resolveTextFlag(cmd, \"description\")\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif clearFlag && hasDesc {\n\t\treturn fmt.Errorf(\"--clear cannot be combined with --description / --description-stdin / --description-file\")\n\t}\n\tif !clearFlag && !hasDesc && !cmd.Flags().Changed(\"description\") {\n\t\treturn fmt.Errorf(\"nothing to update; pass --description, --description-stdin, --description-file, or --clear\")\n\t}\n\n\tif clearFlag {\n\t\tdesc = \"\"\n\t}\n\n\tbody := map[string]any{\"profile_description\": desc}\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\tvar me map[string]any\n\tif err := client.PatchJSON(ctx, \"/api/me\", body, &me); err != nil {","sourceCodeStart":87,"sourceCodeEnd":123,"githubUrl":"https://github.com/multica-ai/multica/blob/2c0912b6ec764b373d44eeea1e80f0d9f11ab417/server/cmd/multica/cmd_user.go#L87-L123","documentation":"`multica user profile update` was invoked with none of the mutating flags: no --description (or its -stdin/-file variants) and no --clear. Because the command would otherwise send a no-op PATCH, it fails fast and lists the accepted flags.","triggerScenarios":"Running bare `multica user profile update`, or passing only non-mutating flags like --output. The guard `!clearFlag && !hasDesc && !Changed(\"description\")` covers both the explicit-empty-string case and the absent case.","commonSituations":"Scripts where the description variable expands to empty, or users exploring the command without arguments.","solutions":["Pass exactly one of --description \"text\", --description-stdin (pipe text), --description-file path, or --clear.","In scripts, guard before invoking: only run the command when at least one of those inputs is non-empty.","Use `multica user profile get` if you only wanted to view the profile."],"exampleFix":"# before\nmultica user profile update\n\n# after\necho \"bio text\" | multica user profile update --description-stdin","handlingStrategy":"validation","validationCode":"[ -n \"$DESC\" ] || [ \"$CLEAR\" = \"true\" ] || { echo 'nothing to update: pass a description or --clear'; exit 1; }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Guard scripts: skip the command entirely when no field is being changed.","Prefer --description-file for scripted edits; empty file is still a deliberate clear via --clear."],"tags":["cli","validation","flag","user-profile"],"backgroundTag":null,"analyzedSha":"2c0912b6ec764b373d44eeea1e80f0d9f11ab417","analyzedAt":"2026-08-15T13:25:18.241Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}