diff --git a/doc/DEVELOPING.md b/doc/DEVELOPING.md index 7d98cd6d..7864b90e 100644 --- a/doc/DEVELOPING.md +++ b/doc/DEVELOPING.md @@ -206,6 +206,17 @@ paperclipai worktree init --from-data-dir ~/.paperclip paperclipai worktree init --force ``` +Repair an already-created repo-managed worktree and reseed its isolated instance from the main default install: + +```sh +cd ~/.paperclip/worktrees/PAP-884-ai-commits-component +pnpm paperclipai worktree init --force --seed-mode minimal \ + --name PAP-884-ai-commits-component \ + --from-config ~/.paperclip/instances/default/config.json +``` + +That rewrites the worktree-local `.paperclip/config.json` + `.paperclip/.env`, recreates the isolated instance under `~/.paperclip-worktrees/instances//`, and preserves the git worktree contents themselves. + **`pnpm paperclipai worktree:make [options]`** — Create `~/NAME` as a git worktree, then initialize an isolated Paperclip instance inside it. This combines `git worktree add` with `worktree init` in a single step. | Option | Description | diff --git a/scripts/provision-worktree.sh b/scripts/provision-worktree.sh index ea5e0e0f..19b0831e 100644 --- a/scripts/provision-worktree.sh +++ b/scripts/provision-worktree.sh @@ -32,13 +32,13 @@ source_env_path="$(dirname "$source_config_path")/.env" mkdir -p "$paperclip_dir" run_isolated_worktree_init() { - if command -v paperclipai >/dev/null 2>&1; then - paperclipai worktree init --force --name "$worktree_name" --from-config "$source_config_path" + if command -v pnpm >/dev/null 2>&1 && pnpm paperclipai --help >/dev/null 2>&1; then + pnpm paperclipai worktree init --force --seed-mode minimal --name "$worktree_name" --from-config "$source_config_path" return 0 fi - if command -v pnpm >/dev/null 2>&1 && pnpm paperclipai --help >/dev/null 2>&1; then - pnpm paperclipai worktree init --force --name "$worktree_name" --from-config "$source_config_path" + if command -v paperclipai >/dev/null 2>&1; then + paperclipai worktree init --force --seed-mode minimal --name "$worktree_name" --from-config "$source_config_path" return 0 fi