gastownhall/beads · error
cannot use both --pull-only and --push-only
Error message
cannot use both --pull-only and --push-only
What it means
`bd ado sync` rejects mutually exclusive direction flags: --pull-only (ADO→local) and --push-only (local→ADO) cannot both be given, since a sync cannot run both directions-only simultaneously. runADOSync checks this before any I/O and returns this plain error.
Source
Thrown at cmd/bd/ado.go:507
}
evt := metrics.NewCommandEvent("ado-sync")
defer func() {
if c := metrics.Global(); c != nil {
c.CloseEventAndAdd(evt)
}
}()
cfg := getADOConfig()
if err := validateADOConfig(cfg); err != nil {
return err
}
if !adoSyncDryRun {
CheckReadonly("ado sync")
}
if adoSyncPullOnly && adoSyncPushOnly {
return fmt.Errorf("cannot use both --pull-only and --push-only")
}
// Validate conflict flags
conflictStrategy, err := getADOConflictStrategy(adoPreferLocal, adoPreferADO, adoPreferNewer)
if err != nil {
return fmt.Errorf("%w (--prefer-local, --prefer-ado, --prefer-newer)", err)
}
if err := ensureStoreActive(); err != nil {
return fmt.Errorf("database not available: %w", err)
}
out := cmd.OutOrStdout()
ctx := context.Background()
// Create and initialize the ADO tracker
at := &ado.Tracker{}
cliProjects, _ := cmd.Flags().GetStringSlice("project")View on GitHub (pinned to 71377f2769)
Solutions
- Remove one of the flags — run either `--pull-only` or `--push-only`.
- Omit both flags for a full bidirectional sync.
- In scripts, make the flags mutually exclusive (if/else) before exec'ing bd.
Example fix
// before bd ado sync --pull-only --push-only // after bd ado sync --pull-only
Defensive patterns
Strategy: validation
Validate before calling
if pullOnly && pushOnly {
return errors.New("--pull-only and --push-only are mutually exclusive")
} Try / catch
if err := bd("ado", "sync", "--pull-only"); err != nil && strings.Contains(err.Error(), "both --pull-only and --push-only") {
// fix the flag construction in the wrapper script
} Prevention
- Build sync invocations with an if/else choosing one direction.
- Encapsulate flag assembly in a single function that enforces exclusivity.
- Avoid blindly concatenating extra flag variables in shell wrappers.
When it happens
Trigger: Invoking `bd ado sync --pull-only --push-only`, e.g. in a script that appends both flags conditionally.
Common situations: Shell scripts building flags dynamically where both variables end up true; copy-pasting flag examples from docs; a wrapper alias accumulating flags.
Related errors
- %w (--prefer-local, --prefer-ado, --prefer-newer)
- cannot use multiple conflict resolution flags
- cannot specify both --reason-file and --reason/--resolution/
- --strategy %s contradicts --%s
- invalid --dolt-auto-commit=%q (valid: off, on, batch)
AI-assisted analysis of gastownhall/beads@71377f2769 (2026-08-30).
Data as JSON: /api/errors/92e1c9988102bbdf.
Report an issue: GitHub.