Skip to content

feat(workspace): loom reset command to discard work and rebase to origin/main #51

Description

@BalduinLandolt

Summary

Add a loom reset command that discards all local changes in a workspace, fetches from origin, and rebases all workspace branches onto origin/main. This provides a clean way to start fresh without tearing down and recreating the workspace.

Motivation

When working in a workspace, branches can drift from origin/main over time, or you may want to abandon the current direction and start over. Currently, the only way to get a clean slate is to loom down the workspace and recreate it with loom new. A dedicated reset command would be faster and preserve the workspace structure.

This is especially useful when:

  • An agent has made changes you want to fully discard
  • origin/main has moved significantly and you want all worktrees rebased
  • You want to restart work on a feature from a clean state without recreating the workspace

Commands affected

  • loom init
  • loom new
  • loom add
  • loom remove
  • loom down
  • loom list
  • loom status
  • loom exec
  • loom shell
  • loom save
  • loom open
  • loom registry
  • TUI
  • New command

Modules affected

  • cli
  • workspace
  • git

Proposed behavior

loom reset [name]
  • No argument: resets the workspace detected from the current directory
  • With <name>: resets the named workspace

For each repository worktree in the workspace, the command should:

  1. Discard all uncommitted changes (staged and unstaged)
  2. Fetch origin
  3. Hard-reset / rebase the worktree branch onto origin/main (or the configured default branch)

Before executing, the command should show a confirmation prompt warning that all local work will be lost — e.g.:

⚠ This will discard ALL uncommitted changes and reset branches to origin/main.
  Workspace: my-feature
  Repos: repo-a, repo-b, repo-c

  Continue? [y/N]

A --force flag could skip the confirmation for scripting use cases.

If progress indication is available (see #50), it should be used here as well.

Acceptance criteria

  • loom reset resets the workspace detected from the current directory
  • loom reset <name> resets a named workspace
  • All uncommitted changes (staged and unstaged) are discarded in every worktree
  • origin is fetched for each repository
  • Worktree branches are rebased onto origin/main (or the repo's default branch)
  • A confirmation prompt is shown before destructive action
  • --force skips the confirmation prompt
  • Clear error message if the workspace is not found

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions