{"record":{"id":"dd330e58ccefc44e","repo":"multica-ai/multica","slug":"content-content-stdin-or-content-file-is-r","errorCode":null,"errorMessage":"--content, --content-stdin, or --content-file is required","messagePattern":"--content, --content-stdin, or --content-file is required","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"server/cmd/multica/cmd_issue.go","lineNumber":1959,"sourceCode":"\t\t\tstrVal(c, \"id\"),\n\t\t\tparentID,\n\t\t\tactors.actor(strVal(c, \"author_type\"), strVal(c, \"author_id\")),\n\t\t\tstrVal(c, \"type\"),\n\t\t\tcontent,\n\t\t\tcreated,\n\t\t})\n\t}\n\tcli.PrintTable(os.Stdout, headers, rows)\n\treturn nil\n}\n\nfunc runIssueCommentAdd(cmd *cobra.Command, args []string) error {\n\tcontent, hasContent, err := resolveTextFlag(cmd, \"content\")\n\tif err != nil {\n\t\treturn err\n\t}\n\tif !hasContent {\n\t\treturn fmt.Errorf(\"--content, --content-stdin, or --content-file is required\")\n\t}\n\tif err := guardLocalPathLinks(content, \"comment body\",\n\t\t\"Deliver the file itself with `multica issue comment add <issue-id> --attachment <path>` (repeatable) and drop the link.\"); err != nil {\n\t\treturn err\n\t}\n\n\tclient, err := newAPIClient(cmd)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// Use a longer timeout when attachments are present (file uploads can be slow).\n\ttimeout := cli.APITimeout()\n\tattachments, _ := cmd.Flags().GetStringSlice(\"attachment\")\n\tif len(attachments) > 0 {\n\t\ttimeout = cli.AtLeastAPITimeout(60 * time.Second)\n\t}\n\tctx, cancel := context.WithTimeout(context.Background(), timeout)","sourceCodeStart":1941,"sourceCodeEnd":1977,"githubUrl":"https://github.com/multica-ai/multica/blob/2c0912b6ec764b373d44eeea1e80f0d9f11ab417/server/cmd/multica/cmd_issue.go#L1941-L1977","documentation":"`multica issue comment add` requires a comment body from one of three sources: --content (inline string), --content-stdin (piped input), or --content-file (path). resolveTextFlag found none of them set, so the command aborts before contacting the server.","triggerScenarios":"Running `multica issue comment add <issue>` with no --content/--content-stdin/--content-file; passing an empty string to --content also counts as unset.","commonSituations":"Building the command in a script where the content variable is empty; intending to pipe but forgetting --content-stdin; pointing --content-file at a missing file so the flag resolves to nothing.","solutions":["Pass the body inline: --content \"text\".","Pipe it: echo \"text\" | multica issue comment add <issue> --content-stdin.","Or use --content-file <path> with an existing non-empty file."],"exampleFix":"# before\nmultica issue comment add ISS-1\n# after\necho \"Looks fixed to me\" | multica issue comment add ISS-1 --content-stdin","handlingStrategy":"validation","validationCode":"# bash: guarantee a body before invoking the CLI\nif [[ -z \"$CONTENT\" && -z \"$CONTENT_FILE\" && -t stdin ]]; then\n  echo \"refusing: no --content, --content-stdin, or --content-file\" >&2\n  exit 2\nfi\nif [[ -n \"$CONTENT_FILE\" && ! -s \"$CONTENT_FILE\" ]]; then\n  echo \"refusing: $CONTENT_FILE is empty\" >&2; exit 2\nfi","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Fail fast in scripts when the content variable expands to empty.","Prefer --content-file for templated bodies; check the file is non-empty first."],"tags":["cli","flag-validation","comments","required-argument"],"backgroundTag":null,"analyzedSha":"2c0912b6ec764b373d44eeea1e80f0d9f11ab417","analyzedAt":"2026-08-15T13:25:18.241Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}