multica-ai/multica · warning

--content is required

Error message

--content is required

What it means

Client-side validation in `multica skill files upsert`: content resolution via resolveSkillContentFlag produced nothing — neither --content nor whatever alternate source that helper supports (e.g. --content-file/stdin) yielded non-empty text. The check requires both hasContent (a source was given) and non-empty text, so this fires for a missing flag, an empty string, or an empty auxiliary file/stdin.

Source

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

	return nil
}

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

	filePath, _ := cmd.Flags().GetString("path")
	if filePath == "" {
		return fmt.Errorf("--path is required")
	}
	content, hasContent, err := resolveSkillContentFlag(cmd)
	if err != nil {
		return err
	}
	if !hasContent || content == "" {
		return fmt.Errorf("--content is required")
	}

	body := map[string]any{
		"path":    filePath,
		"content": content,
	}

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

	var result map[string]any
	if err := client.PutJSON(ctx, "/api/skills/"+args[0]+"/files", body, &result); err != nil {
		return fmt.Errorf("upsert skill file: %w", err)
	}

	output, _ := cmd.Flags().GetString("output")
	if output == "json" {
		return cli.PrintJSON(os.Stdout, result)

View on GitHub (pinned to 2c0912b6ec)

Solutions

  1. Provide the text explicitly: `--content "..."` or a non-empty file/stdin source per the command's --help.
  2. If generating content in a pipeline, verify it first: `test -s /tmp/content.txt && multica skill files upsert ...`.
  3. Check `multica skill files upsert --help` for all accepted content-source flags so you use the intended one.

Example fix

# before
cat empty.txt | multica skill files upsert sk-1 --path SKILL.md

# after
printf '# My skill\n' > content.md
test -s content.md && multica skill files upsert sk-1 --path SKILL.md --content "$(cat content.md)"
Defensive patterns

Strategy: validation

Validate before calling

test -s "$CONTENT_FILE" || { echo "content file empty or missing: $CONTENT_FILE"; exit 1; }
multica skill files upsert "$SKILL_ID" --path p.md --content "$(cat "$CONTENT_FILE")"

Prevention

When it happens

Trigger: Omitting --content entirely; passing `--content ""`; piping empty stdin (`multica skill files upsert ... < /dev/null`) when the helper reads stdin; --content-file pointing at an empty file.

Common situations: Script pipes a generator whose output was empty (grep found nothing upstream); heredoc with a typo producing zero lines; user expects the command to open an editor.

Related errors


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