paperclipai/paperclip · error
Use either --from or…
Error message
Use either --from <worktree> or --from-config/--from-data-dir/--from-instance, not both.
What it means
Mutually-exclusive source-selection guard for reseed: the caller passed both a --from worktree selector and one of the config-based source flags (--from-config/--from-data-dir/--from-instance), which name two different kinds of reseed source.
Solutions
- Use either --from <worktree> or --from-config/--from-data-dir/--from-instance, not both.
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at cli/src/commands/worktree.ts:858 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of paperclipai/paperclip@01ad858492 (2026-08-18).
Data as JSON: /api/errors/ed6d47a0b7599adb.
Report an issue: GitHub.
Appendix: source
Thrown at cli/src/commands/worktree.ts:874
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 01ad858492)