Skip to content

Per-project setup script auto-run on worktree creation, plus named quick actions #153

Closed

Description

@currentbits

What competitors do

T3 Code: project-scoped named shell commands with optional keybindings, configurable to run automatically when a worktree is created (e.g. npm install) (guide). Vibe Kanban automates setup scripts on worktree creation; Emdash has per-project setup commands.

Solenta today

setupWorktree (electron/worktrees.js:501-544) is exactly git worktree add + store update. No hook for npm install, pnpm i, direnv, .env symlinks. Dev servers are limited to detected npm scripts (electron/devservers.js:7,178).

Why it matters

Every fresh worktree needs dependency install before the agent or the user can run anything; agents that cannot run tests because deps were never installed is a daily papercut. Every competitor treats "worktree created -> env ready" as one step.

Scope suggestion

Per-project setup command run (async, logged) on worktree creation, plus named quick actions in the thread header ("run lint", "reset db").

Activity

  1. added
    enhancementNew feature or request
    and removed on Aug 16, 2026
  2. currentbits commented on Aug 22, 2026

    @currentbits
    OwnerAuthor

    Implementing as two project-scoped fields, not a generic environment contract (#396 stays separate):

    • setupCommand: one shell string, fired after a new worktree is created (git worktree add already succeeded). Async, logged as [setup] transcript events, never undoes the worktree on failure. Idempotent setupWorktree (already has a path) does not re-run.
    • quickActions: up to 8 named {id, name, command} rows. Shown as compact buttons in the thread header. Same shell runner as verify (/bin/sh -c, Git Bash on Windows, WSL wrap when needed).

    Config lives in Edit project. Re-run setup from the header if the auto-run failed.

    Out of scope: honoring devcontainer.json / Copilot setup steps (#396), copying .env (#185), keybindings.

  3. currentbits commented on Aug 22, 2026

    @currentbits
    OwnerAuthor

    Implemented on this branch.

    • Edit project: Worktree setup field + named quick actions (name + command, up to 8).
    • New worktree (git worktree add) fires setupCommand in the worktree, async. [setup] events go on the thread. Failure does not remove the worktree. A second setupWorktree on an existing path does not re-run.
    • Thread header: Setup button (when a setup command is set) plus one button per named action. Same shell runner as verify (/bin/sh -c, Git Bash on Windows). Re-run setup from the header if the auto-run failed.

    Not in this change: honoring devcontainer.json (#396), copying .env (#185), keybindings.

  4. added and removed on Sep 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions