multica-ai/multica · warning

--color is required (e.g. #3b82f6)

Error message

--color is required (e.g. #3b82f6)

What it means

Thrown by `multica label create` when --color is omitted or empty. Color is mandatory for label creation (the example hint #3b82f6 indicates a hex format is expected), enforced client-side before the POST.

Source

Thrown at server/cmd/multica/cmd_label.go:173

			strVal(label, "id"),
			strVal(label, "name"),
			strVal(label, "color"),
			created,
		}}
		cli.PrintTable(os.Stdout, headers, rows)
		return nil
	}
	return cli.PrintJSON(os.Stdout, label)
}

func runLabelCreate(cmd *cobra.Command, _ []string) error {
	name, _ := cmd.Flags().GetString("name")
	color, _ := cmd.Flags().GetString("color")
	if name == "" {
		return fmt.Errorf("--name is required")
	}
	if color == "" {
		return fmt.Errorf("--color is required (e.g. #3b82f6)")
	}

	client, err := newAPIClient(cmd)
	if err != nil {
		return err
	}
	ctx, cancel := cli.APIContext(context.Background())
	defer cancel()

	body := map[string]any{"name": name, "color": color}
	var result map[string]any
	if err := client.PostJSON(ctx, "/api/labels", body, &result); err != nil {
		return fmt.Errorf("create label: %w", err)
	}

	output, _ := cmd.Flags().GetString("output")
	if output == "table" {
		headers := []string{"ID", "NAME", "COLOR"}

View on GitHub (pinned to 2c0912b6ec)

Solutions

  1. Pass a hex color: `multica label create --name bug --color #3b82f6`
  2. Pick colors server-side conventions accept — the error message suggests the #RRGGBB form
  3. Guard scripts to supply a fallback color constant

Example fix

# before
multica label create --name bug
# after
multica label create --name bug --color #ef4444
Defensive patterns

Strategy: validation

Validate before calling

# bash: require hex color
[[ "${COLOR:-}" =~ ^#[0-9a-fA-F]{6}$ ]] || { echo "--color must be #RRGGBB" >&2; exit 2; }

Prevention

When it happens

Trigger: Running `multica label create --name bug` without --color, or with an empty color value.

Common situations: Users expect a default color to be assigned; scripts that only parameterize the name.

Related errors


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