paperclipai/paperclip · error · Error

Use either --from <worktree> or --from-config/--from-data-di

Error message

Use either --from <worktree> or --from-config/--from-data-dir/--from-instance, not both.

What it means

Thrown by resolveWorktreeReseedSource when both a worktree selector (--from) and an explicit config source (--from-config/--from-data-dir/--from-instance) are supplied. The reseed source must be unambiguous, so mixing the two selection modes is rejected up front.

Source

Thrown at cli/src/commands/worktree.ts:858

  if (opts.sourceConfigPathOverride) return path.resolve(opts.sourceConfigPathOverride);
  if (opts.fromConfig) return path.resolve(opts.fromConfig);
  if (!opts.fromDataDir && !opts.fromInstance) {
    return resolveConfigPath();
  }
  const sourceHome = path.resolve(expandHomePrefix(opts.fromDataDir ?? "~/.paperclip"));
  const sourceInstanceId = sanitizeWorktreeInstanceId(opts.fromInstance ?? "default");
  return path.resolve(sourceHome, "instances", sourceInstanceId, "config.json");
}

export function resolveWorktreeReseedSource(input: WorktreeReseedOptions): ResolvedWorktreeReseedSource {
  const fromSelector = nonEmpty(input.from);
  const fromConfig = nonEmpty(input.fromConfig);
  const fromDataDir = nonEmpty(input.fromDataDir);
  const fromInstance = nonEmpty(input.fromInstance);
  const hasExplicitConfigSource = Boolean(fromConfig || fromDataDir || fromInstance);

  if (fromSelector && hasExplicitConfigSource) {
    throw new Error(
      "Use either --from <worktree> or --from-config/--from-data-dir/--from-instance, not both.",
    );
  }

  if (fromSelector) {
    const endpoint = resolveWorktreeEndpointFromSelector(fromSelector, { allowCurrent: true });
    return {
      configPath: endpoint.configPath,
      label: endpoint.label,
    };
  }

  if (hasExplicitConfigSource) {
    const configPath = resolveSourceConfigPath({
      fromConfig: fromConfig ?? undefined,
      fromDataDir: fromDataDir ?? undefined,
      fromInstance: fromInstance ?? undefined,
    });

View on GitHub (pinned to 67001ec6eb)

Solutions

  1. Use exactly one source mode: either `--from <worktree>` OR one of `--from-config`/`--from-data-dir`/`--from-instance`.
  2. Audit wrapper scripts/aliases for injected --from-config that conflict with a typed --from.
  3. Remove the redundant flag and re-run.

Example fix

# before
paperclipai worktree reseed --from feat-x --from-config ~/.paperclip/instances/default/config.json
# after
paperclipai worktree reseed --from feat-x
Defensive patterns

Strategy: validation

Validate before calling

function assertSingleSourceMode(opts: { from?: string; fromConfig?: string; fromDataDir?: string; fromInstance?: string }): void {
  const selector = nonEmpty(opts.from);
  const explicit = nonEmpty(opts.fromConfig) || nonEmpty(opts.fromDataDir) || nonEmpty(opts.fromInstance);
  if (selector && explicit) throw new Error('Pass only one source mode.');
}

Prevention

When it happens

Trigger: Invoking a reseed/repair command with flags like `--from myworktree --from-config /path/config.json` simultaneously; a script or alias that always passes --from-config while the user also types --from.

Common situations: Copy-pasting flags from docs without removing the conflicting one; wrapper scripts that inject default --from-config; misunderstanding that --from is itself a source selector equivalent to the config flags.

Related errors


AI-assisted analysis of paperclipai/paperclip@67001ec6eb (2026-08-12). Data as JSON: /api/errors/ed6d47a0b7599adb. Report an issue: GitHub.