{"record":{"id":"4d06869bf4df30a3","repo":"multica-ai/multica","slug":"s-s-stdin-and-s-file-are-mutually-exclu","errorCode":null,"errorMessage":"--%s, --%s-stdin, and --%s-file are mutually exclusive; pick one","messagePattern":"--(.+?), --(.+?)-stdin, and --(.+?)-file are mutually exclusive; pick one","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"server/cmd/multica/cmd_agent.go","lineNumber":1389,"sourceCode":"\tfromStdin, _ := cmd.Flags().GetBool(prefix + \"-stdin\")\n\tfilePath, _ := cmd.Flags().GetString(prefix + \"-file\")\n\tfromFile := cmd.Flags().Changed(prefix + \"-file\")\n\n\tcount := 0\n\tif inline {\n\t\tcount++\n\t}\n\tif fromStdin {\n\t\tcount++\n\t}\n\tif fromFile {\n\t\tcount++\n\t}\n\tswitch {\n\tcase count == 0:\n\t\treturn nil, false, nil\n\tcase count > 1:\n\t\treturn nil, false, fmt.Errorf(\"--%s, --%s-stdin, and --%s-file are mutually exclusive; pick one\", prefix, prefix, prefix)\n\t}\n\n\tclearHint := \"\"\n\tif allowNull {\n\t\tclearHint = \"; pass 'null' to clear\"\n\t}\n\tvar raw string\n\tswitch {\n\tcase inline:\n\t\traw, _ = cmd.Flags().GetString(prefix)\n\tcase fromStdin:\n\t\tbuf, err := io.ReadAll(cmd.InOrStdin())\n\t\tif err != nil {\n\t\t\treturn nil, false, fmt.Errorf(\"read --%s-stdin: %w\", prefix, err)\n\t\t}\n\t\traw = string(buf)\n\t\tif strings.TrimSpace(raw) == \"\" {\n\t\t\treturn nil, false, fmt.Errorf(\"--%s-stdin: empty input%s\", prefix, clearHint)","sourceCodeStart":1371,"sourceCodeEnd":1407,"githubUrl":"https://github.com/multica-ai/multica/blob/2c0912b6ec764b373d44eeea1e80f0d9f11ab417/server/cmd/multica/cmd_agent.go#L1371-L1407","documentation":"Thrown by the shared resolver (used for --mcp-config and similar flag triples) when more than one of the three input channels — inline flag, -stdin, and -file — is supplied at once. The CLI counts changed flags and rejects count > 1 because there would be no way to decide which value wins. It is a usage error detected before any I/O or API call.","triggerScenarios":"E.g. `multica agent update <id> --mcp-config '{}' --mcp-config-file cfg.json`, or combining --mcp-config-stdin with --mcp-config, on any command that registers the flag triple.","commonSituations":"Copy-pasting a command from docs and adding a file variant on top; shell scripts that set a default inline value and also pipe stdin; CI pipelines that pass both a file and an inline override 'to be safe'.","solutions":["Remove all but one of the three flags — keep exactly one of --<prefix>, --<prefix>-stdin, or --<prefix>-file","If you need a default plus an override, resolve it in the shell first and pass a single flag"],"exampleFix":"# before\ncat cfg.json | multica agent update <id> --mcp-config '{}' --mcp-config-stdin\n# after\ncat cfg.json | multica agent update <id> --mcp-config-stdin","handlingStrategy":"validation","validationCode":"# in wrapper scripts, include at most one variant\nset -- --mcp-config-file \"$FILE\"\n# do not also add --mcp-config or pipe stdin","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Pick one input channel (inline, stdin, or file) per invocation and document it in the script","Avoid 'belt and braces' flag stacking — the CLI rejects it by design","When wrapping the CLI, expose a single --config option and map it to exactly one flag"],"tags":["cli","usage","flags","validation","go"],"backgroundTag":null,"analyzedSha":"2c0912b6ec764b373d44eeea1e80f0d9f11ab417","analyzedAt":"2026-08-15T13:25:18.241Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}