multica-ai/multica · error

--%s, --%s-stdin, and --%s-file are mutually exclusive; pick

Error message

--%s, --%s-stdin, and --%s-file are mutually exclusive; pick one

What it means

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.

Source

Thrown at server/cmd/multica/cmd_agent.go:1389

	fromStdin, _ := cmd.Flags().GetBool(prefix + "-stdin")
	filePath, _ := cmd.Flags().GetString(prefix + "-file")
	fromFile := cmd.Flags().Changed(prefix + "-file")

	count := 0
	if inline {
		count++
	}
	if fromStdin {
		count++
	}
	if fromFile {
		count++
	}
	switch {
	case count == 0:
		return nil, false, nil
	case count > 1:
		return nil, false, fmt.Errorf("--%s, --%s-stdin, and --%s-file are mutually exclusive; pick one", prefix, prefix, prefix)
	}

	clearHint := ""
	if allowNull {
		clearHint = "; pass 'null' to clear"
	}
	var raw string
	switch {
	case inline:
		raw, _ = cmd.Flags().GetString(prefix)
	case fromStdin:
		buf, err := io.ReadAll(cmd.InOrStdin())
		if err != nil {
			return nil, false, fmt.Errorf("read --%s-stdin: %w", prefix, err)
		}
		raw = string(buf)
		if strings.TrimSpace(raw) == "" {
			return nil, false, fmt.Errorf("--%s-stdin: empty input%s", prefix, clearHint)

View on GitHub (pinned to 2c0912b6ec)

Solutions

  1. Remove all but one of the three flags — keep exactly one of --<prefix>, --<prefix>-stdin, or --<prefix>-file
  2. If you need a default plus an override, resolve it in the shell first and pass a single flag

Example fix

# before
cat cfg.json | multica agent update <id> --mcp-config '{}' --mcp-config-stdin
# after
cat cfg.json | multica agent update <id> --mcp-config-stdin
Defensive patterns

Strategy: validation

Validate before calling

# in wrapper scripts, include at most one variant
set -- --mcp-config-file "$FILE"
# do not also add --mcp-config or pipe stdin

Prevention

When it happens

Trigger: 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.

Common situations: 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'.

Related errors


AI-assisted analysis of multica-ai/multica@2c0912b6ec (2026-08-15). Data as JSON: /api/errors/4d06869bf4df30a3. Report an issue: GitHub.