multica-ai/multica · warning

--url and --file are mutually exclusive

Error message

--url and --file are mutually exclusive

What it means

Client-side flag validation in `multica skill import`: both `--url` and `--file` were provided, but the command accepts exactly one bundle source. The mutual-exclusion switch runs before any network activity, so this is a usage error with zero side effects.

Source

Thrown at server/cmd/multica/cmd_skill.go:462

	}

	fmt.Printf("Skill updated from source: %s (%s)\n", strVal(result, "name"), strVal(result, "id"))
	return nil
}

func runSkillImport(cmd *cobra.Command, _ []string) error {
	client, err := newAPIClient(cmd)
	if err != nil {
		return err
	}

	importURL, _ := cmd.Flags().GetString("url")
	importFile, _ := cmd.Flags().GetString("file")
	switch {
	case importURL == "" && importFile == "":
		return fmt.Errorf("either --url or --file is required")
	case importURL != "" && importFile != "":
		return fmt.Errorf("--url and --file are mutually exclusive")
	}
	onConflict, _ := cmd.Flags().GetString("on-conflict")
	if !validSkillImportConflictStrategy(onConflict) {
		return fmt.Errorf("--on-conflict must be one of: fail, overwrite, rename, skip")
	}

	ctx, cancel := context.WithTimeout(context.Background(), cli.AtLeastAPITimeout(60*time.Second))
	defer cancel()

	var result map[string]any
	if importFile != "" {
		fileData, readErr := os.ReadFile(importFile)
		if readErr != nil {
			return fmt.Errorf("read skill archive: %w", readErr)
		}
		if err := client.ImportSkillFile(ctx, fileData, filepath.Base(importFile), onConflict, &result); err != nil {
			if handledErr := handleSkillImportError(cmd, err); handledErr != nil {
				return handledErr

View on GitHub (pinned to 2c0912b6ec)

Solutions

  1. Remove one of the two flags — decide whether the bundle comes from the network or from disk.
  2. In scripts, model the source as a single variable: pass `--url "$SRC"` when it starts with http, else `--file "$SRC"`.
  3. If both a local and remote copy exist, prefer --file to avoid network flakiness.

Example fix

# before
multica skill import --url https://example.com/skill.zip --file ./skill.zip

# after
multica skill import --file ./skill.zip
Defensive patterns

Strategy: validation

Validate before calling

# single-source-of-truth: never emit both flags
if [ -n "$IMPORT_URL" ] && [ -n "$IMPORT_FILE" ]; then
  echo "pick one source: set IMPORT_URL or IMPORT_FILE, not both"; exit 1
fi

Prevention

When it happens

Trigger: Running `multica skill import --url https://… --file ./skill.zip`; a script unconditionally passes both flags with one left over from a previous edit; copy-pasting an example command that contained both.

Common situations: Wrapper scripts that always set --file as a default while an operator adds --url manually; iterating on a command in shell history and forgetting to delete the other flag.

Related errors


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