gastownhall/beads · error

empty description from stdin/file requires --allow-empty-des

Error message

empty description from stdin/file requires --allow-empty-description (or use an explicit inline empty value like --description "")

What it means

When a description update sources its body from stdin or a file and the resulting text is empty, bd refuses to wipe the description silently. The caller must opt in with --allow-empty-description, or pass an explicit inline empty value, to make the intent unambiguous.

Source

Thrown at cmd/bd/update_description_guard.go:47

		message, _ := cmd.Flags().GetString("message")
		if message == "-" {
			return true
		}
	}
	return false
}

func validateDescriptionUpdate(cmd *cobra.Command, description string, descChanged bool) error {
	if !descChanged || description != "" || !descriptionUsesExternalInput(cmd) {
		return nil
	}

	allowEmptyDescription, _ := cmd.Flags().GetBool("allow-empty-description")
	if allowEmptyDescription {
		return nil
	}

	return fmt.Errorf("empty description from stdin/file requires --allow-empty-description (or use an explicit inline empty value like --description \"\")")
}

View on GitHub (pinned to 71377f2769)

Solutions

  1. Verify the stdin/file actually contains the intended text
  2. Add --allow-empty-description if clearing the description is intentional
  3. Or pass an explicit inline empty value: --description ""

Example fix

// before
bd update bd-42 --description-file notes.md   # notes.md is empty
// after
bd update bd-42 --description-file notes.md --allow-empty-description
Defensive patterns

Strategy: validation

Validate before calling

if descChanged && description == "" && usesStdinOrFile(cmd) && !allowEmpty {
    return errors.New("refusing empty description from stdin/file; pass --allow-empty-description to confirm")
}

Prevention

When it happens

Trigger: `bd update <id> --description-file empty.md`, `cat x | bd update <id> --stdin`, or `--description -` where the piped file/stream is empty, without --allow-empty-description.

Common situations: Empty or mis-pathed body file; a build script piping output that produced nothing; CI env where the file wasn't generated; accidentally redirecting an empty stream intending to clear the description.

Related errors


AI-assisted analysis of gastownhall/beads@71377f2769 (2026-08-30). Data as JSON: /api/errors/ddcc08fa54527354. Report an issue: GitHub.