multica-ai/multica · error

--title is required

Error message

--title is required

What it means

Flag guard in runProjectCreate (cmd_project.go:309): `multica project create` was invoked without a non-empty --title. Title is the only required field for creation (description and others are optional), so the CLI rejects the call locally before constructing the API client.

Source

Thrown at server/cmd/multica/cmd_project.go:309

		headers := []string{"ID", "TITLE", "STATUS", "LEAD", "DESCRIPTION"}
		rows := [][]string{{
			strVal(project, "id"),
			strVal(project, "title"),
			strVal(project, "status"),
			lead,
			strVal(project, "description"),
		}}
		cli.PrintTable(os.Stdout, headers, rows)
		return nil
	}

	return cli.PrintJSON(os.Stdout, project)
}

func runProjectCreate(cmd *cobra.Command, _ []string) error {
	title, _ := cmd.Flags().GetString("title")
	if title == "" {
		return fmt.Errorf("--title is required")
	}

	client, err := newAPIClient(cmd)
	if err != nil {
		return err
	}

	ctx, cancel := cli.APIContext(context.Background())
	defer cancel()

	body := map[string]any{"title": title}
	if v, _ := cmd.Flags().GetString("description"); v != "" {
		body["description"] = v
	}
	if v, _ := cmd.Flags().GetString("status"); v != "" {
		if err := validateProjectStatus(v); err != nil {
			return err
		}

View on GitHub (pinned to 2c0912b6ec)

Solutions

  1. Pass a non-empty title: `multica project create --title "Q3 Migration"`.
  2. Guard in scripts: `[ -n "$TITLE" ] || { echo 'title required'; exit 1; }` before the call.
  3. Use ${TITLE:?} so the shell itself fails fast on an unset variable.

Example fix

# before
multica project create --title "$TITLE"   # $TITLE unset -> --title ""
# --title is required

# after
multica project create --title "${TITLE:?TITLE must be set}"
Defensive patterns

Strategy: validation

Validate before calling

title := strings.TrimSpace(os.Getenv("PROJECT_TITLE"))
if title == "" { return fmt.Errorf("PROJECT_TITLE must be set") }

Type guard

func hasTitle(s string) bool { return strings.TrimSpace(s) != "" }

Prevention

When it happens

Trigger: Omitting --title entirely, or passing --title "" (empty string) — including scripts where $TITLE expands to nothing and the quotes keep the argument present but empty.

Common situations: Shell scripts with unset variables quoted as ""; pipelines that derive the title from an empty field; assuming an interactive prompt will ask for the title.

Related errors


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