Skip to content

Expose worktree import (openExternalWorktree/importAllWorktrees) via CLI and MCP #6051

Open

Description

@roeex5

Summary

The desktop app can import an already-existing git worktree into a workspace (Project Settings → Import), backed by openExternalWorktree / importAllWorktrees in apps/desktop/src/lib/trpc/routers/workspaces/procedures/create.ts. Neither packages/cli nor packages/mcp expose this capability — workspaces create / the MCP create_workspace tool only ever create a new worktree; there's no way to hand Superset a worktree path that already exists on disk from the CLI or MCP surface.

Use case

Automation flows that need to pre-create a worktree/branch under their own naming rules (e.g. a Linear "Work on issue → Custom script" integration that derives branch names from a team's own git workflow conventions) before handing the workspace over to Superset for session/agent management. Today there's no scriptable way to do this without either:

  • letting Superset create its own worktree (losing control over branch naming/pre-flight checks), or
  • manually clicking Import in the desktop UI (breaks full automation).

Request

Expose the existing import capability on the automatable surfaces:

  • CLI: superset workspaces import --project <id> --path <worktree-path> --branch <branch> (mirroring the existing openExternalWorktree mutation's inputs: projectId, worktreePath, branch)
  • MCP: a matching import_workspace (or similar) tool alongside create_workspace

Notes

workspaces create --branch <name> does reuse an orphaned worktree/workspace if one already exists for that exact branch that Superset itself tracks, but there's no way to point it at an arbitrary pre-existing worktree path it doesn't already know about.

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions