diff --git a/README.md b/README.md index 25dae61..6fb7806 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ pnpm install -g . ### Create a new worktree ```bash -cursor-worktree new [options] +cwt new [options] ``` Options: @@ -22,27 +22,27 @@ Options: Example: ```bash -cursor-worktree new feature/login -cursor-worktree new feature/chat --checkout -cursor-worktree new feature/auth -p ./auth-worktree +cwt new feature/login +cwt new feature/chat --checkout +cwt new feature/auth -p ./auth-worktree ``` ### List worktrees ```bash -cursor-worktree list +cwt list ``` ### Remove a worktree ```bash -cursor-worktree remove +cwt remove ``` You can remove a worktree by either its path or branch name: ```bash -cursor-worktree remove ./feature/login-worktree -cursor-worktree remove feature/chat +cwt remove ./feature/login-worktree +cwt remove feature/chat ``` ## Requirements diff --git a/TESTING.md b/TESTING.md index 18e425f..3d4f9e6 100644 --- a/TESTING.md +++ b/TESTING.md @@ -14,26 +14,50 @@ 1. In a test repository, run: ```bash - cursor-worktree new editor + cwt new editor ``` 2. Verify that a new sibling directory named `editor` is created. 3. Confirm that the worktree is added to the Git repository and that the Cursor editor opens the new directory. +## Manual Test for CLI Command Name Change + +1. Install the package globally: + ```bash + pnpm install -g . + ``` +2. Run the command help to verify the new command: + ```bash + cwt --help + ``` +3. Optionally, test additional commands: + - Create a new worktree: + ```bash + cwt new feature/test + ``` + - List worktrees: + ```bash + cwt list + ``` + - Remove a worktree: + ```bash + cwt remove feature/test + ``` + ## Remove Worktree Force Flag Test 1. Create a test worktree: ```bash - cursor-worktree new test-branch + cwt new test-branch ``` 2. Make some changes in the worktree that would prevent normal removal 3. Try removing the worktree without the force flag: ```bash - cursor-worktree remove test-branch + cwt remove test-branch ``` This should fail if there are uncommitted changes 4. Try removing the worktree with the force flag: ```bash - cursor-worktree remove --force test-branch + cwt remove --force test-branch ``` This should succeed and remove the worktree regardless of its state -5. Verify that the worktree directory is removed and the Git worktree reference is cleaned up \ No newline at end of file +5. Verify that the worktree directory is removed and the Git worktree reference is cleaned up diff --git a/package.json b/package.json index 084ea6f..fe7ad5a 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "license": "MIT", "type": "module", "bin": { - "cursor-worktree": "dist/index.js" + "cwt": "dist/index.js" }, "scripts": { "build": "tsc", diff --git a/src/index.ts b/src/index.ts index 281285b..d8ec76b 100644 --- a/src/index.ts +++ b/src/index.ts @@ -9,7 +9,7 @@ import { removeWorktreeHandler } from "./commands/remove.js"; const program = new Command(); program - .name("cursor-worktree") + .name("cwt") .description("Manage git worktrees and open them in the Cursor editor.") .version("1.0.0");