gastownhall/beads · error

cannot use both --ephemeral and --pour

Error message

cannot use both --ephemeral and --pour

What it means

bd mol bond accepts either --ephemeral (bond without persisting a pour target) or --pour, but not both; gatherMolBondInput rejects the conflicting combination at flag-parse time.

Source

Thrown at cmd/bd/mol_bond.go:187

	customTitle string
	dryRun      bool
	vars        map[string]string
	ephemeral   bool
	pour        bool
	childRef    string
}

func gatherMolBondInput(cmd *cobra.Command, args []string) (molBondInput, error) {
	in := molBondInput{argA: args[0], argB: args[1]}
	in.bondType, _ = cmd.Flags().GetString("type")
	in.customTitle, _ = cmd.Flags().GetString("as")
	in.dryRun, _ = cmd.Flags().GetBool("dry-run")
	in.ephemeral, _ = cmd.Flags().GetBool("ephemeral")
	in.pour, _ = cmd.Flags().GetBool("pour")
	in.childRef, _ = cmd.Flags().GetString("ref")

	if in.ephemeral && in.pour {
		return in, fmt.Errorf("cannot use both --ephemeral and --pour")
	}
	if in.bondType != types.BondTypeSequential && in.bondType != types.BondTypeParallel && in.bondType != types.BondTypeConditional {
		return in, fmt.Errorf("invalid bond type '%s', must be: sequential, parallel, or conditional", in.bondType)
	}

	varFlags, _ := cmd.Flags().GetStringArray("var")
	vars, err := parseVarFlags(varFlags)
	if err != nil {
		return in, err
	}
	in.vars = vars
	return in, nil
}

func renderMolBondDryRun(in molBondInput, issueA *types.Issue, formulaA string, issueB *types.Issue, formulaB string) {
	idA := in.argA
	idB := in.argB
	aIsProto := false

View on GitHub (pinned to 71377f2769)

Solutions

  1. Remove one of the two flags: use --pour to persist the pour, or --ephemeral for a non-persisted bond.
  2. If a wrapper script sets flags conditionally, ensure the two branches are mutually exclusive (if/else, not both).
  3. Run `bd mol bond --help` to confirm which mode you intend.

Example fix

// before (wrapper script)
FLAGS="$FLAGS --ephemeral --pour"
// after
if [ "$PERSIST" = "1" ]; then FLAGS="$FLAGS --pour"; else FLAGS="$FLAGS --ephemeral"; fi
Defensive patterns

Strategy: validation

Validate before calling

# shell pre-check
if [ -n "$EPHEMERAL" ] && [ -n "$POUR" ]; then echo "choose --ephemeral OR --pour"; exit 1; fi

Prevention

When it happens

Trigger: Running `bd mol bond ... --ephemeral --pour` — both boolean flags set on the same invocation.

Common situations: Script or shell alias accumulating flags, or a user unsure of the semantics passing both to be safe.

Related errors


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