Skip to content

feat: add t3 project move command with --dry-run flag#2467

Open
shoaib050326 wants to merge 1 commit intopingdotgg:mainfrom
shoaib050326:issue-2358-dry-run-move
Open

feat: add t3 project move command with --dry-run flag#2467
shoaib050326 wants to merge 1 commit intopingdotgg:mainfrom
shoaib050326:issue-2358-dry-run-move

Conversation

@shoaib050326
Copy link
Copy Markdown

@shoaib050326 shoaib050326 commented May 2, 2026

Summary

  • Adds t3 project move <project> <path> command that physically moves a project workspace directory and updates the workspace root in the orchestration system
  • Adds --dry-run flag that previews the move operation without making any changes
  • Validates source exists, target parent exists and is writable, and target doesn't already exist

Changes

  • apps/server/src/cli.ts: New projectMoveCommand following existing patterns (add/remove/rename)
  • apps/server/src/cli.test.ts: 4 new tests covering success, dry-run no-op, missing source, and existing target

Testing

  • All 13 CLI tests pass
  • Lint and typecheck pass with no new warnings

Risk/Rollback

  • Low risk: additive feature, no changes to existing commands
  • Rollback: remove projectMoveCommand and revert projectCommand subcommands array

Closes #2358


Note

Medium Risk
Adds a new command that renames directories on disk and updates persisted project metadata; mistakes could move/delete user workspaces or leave state inconsistent, though validations and rollback reduce this risk.

Overview
Adds a new t3 project move <project> <path> subcommand that physically renames the project workspace directory and then dispatches project.meta.update to persist the new workspaceRoot (with rollback if the metadata update fails).

Includes --dry-run output-only mode and preflight checks for missing source, non-existent/non-writable target parent, existing target path, and collisions with another active project’s workspaceRoot. CLI tests are extended to cover the happy path, dry-run no-op, and key rejection/error cases.

Reviewed by Cursor Bugbot for commit 381a39e. Bugbot is set up for automated code reviews on this repo. Configure here.

Note

Add project move subcommand to the t3 CLI with --dry-run support

  • Adds a t3 project move <project> <path> command in cli.ts that renames a project's workspace directory and updates its workspaceRoot metadata via a project.meta.update dispatch.
  • Validates that the source directory exists, the target parent is writable, the target path does not already exist, and no other active project is registered at the target path.
  • --dry-run flag prints a preview of the source and target paths without making any filesystem or metadata changes.
  • On dispatch error after a successful rename, the command attempts to rename the directory back to its original path.
  • Test coverage in cli.test.ts covers success, dry-run, and all validation failure cases.

Macroscope summarized 381a39e.

@chatgpt-codex-connector
Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 2, 2026

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: d9dd2adb-3ba2-4fd0-b182-93782fc5ba01

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions Bot added vouch:unvouched PR author is not yet trusted in the VOUCHED list. size:M 30-99 changed lines (additions + deletions). labels May 2, 2026
Comment thread apps/server/src/cli.ts Outdated
Comment thread apps/server/src/cli.ts
Comment thread apps/server/src/cli.ts Outdated
@macroscopeapp
Copy link
Copy Markdown
Contributor

macroscopeapp Bot commented May 2, 2026

Approvability

Verdict: Needs human review

This PR introduces a new CLI command (project move) with filesystem operations to relocate project directories. New user-facing features and workflows warrant human review regardless of code quality or test coverage.

You can customize Macroscope's approvability policy. Learn more.

@shoaib050326 shoaib050326 force-pushed the issue-2358-dry-run-move branch from 55b0f5a to 1d722c2 Compare May 2, 2026 14:19
@github-actions github-actions Bot added size:L 100-499 changed lines (additions + deletions). and removed size:M 30-99 changed lines (additions + deletions). labels May 2, 2026
Comment thread apps/server/src/cli.ts
@shoaib050326 shoaib050326 force-pushed the issue-2358-dry-run-move branch from 1d722c2 to 36025a7 Compare May 2, 2026 15:04
Copy link
Copy Markdown
Contributor

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 36025a7. Configure here.

Comment thread apps/server/src/cli.ts
- Adds t3 project move <project> <path> to physically move workspace dirs
- Adds --dry-run flag that previews without making changes
- Validates source exists, target parent exists+writable, target not taken
- Reuses existing project.meta.update orchestration command for metadata
- Adds 4 tests: success, dry-run no-op, missing source, existing target

Closes pingdotgg#2358
@shoaib050326 shoaib050326 force-pushed the issue-2358-dry-run-move branch from 36025a7 to 381a39e Compare May 2, 2026 15:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L 100-499 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add --dry-run flag to move command

1 participant