worktree-launcher 1.1.0 → 1.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -73,6 +73,7 @@ wt new <branch-name> [options]
73
73
  Options:
74
74
  - `-i, --install` - Run package manager install after creating worktree
75
75
  - `-s, --skip-launch` - Create worktree without launching AI assistant
76
+ - `-p, --push` - Push branch to remote (makes it visible on GitHub immediately)
76
77
 
77
78
  Examples:
78
79
 
@@ -80,11 +81,17 @@ Examples:
80
81
  # Create worktree and launch AI selector
81
82
  wt new feature-auth
82
83
 
84
+ # Create worktree and push to GitHub
85
+ wt new feature-auth --push
86
+
83
87
  # Create worktree and run npm/yarn/pnpm install
84
88
  wt new feature-auth --install
85
89
 
86
90
  # Just create the worktree
87
91
  wt new feature-auth --skip-launch
92
+
93
+ # Combine options
94
+ wt new feature-auth --push --install --skip-launch
88
95
  ```
89
96
 
90
97
  The worktree is created at `../<repo-name>-<branch-name>/`. For example, if you run `wt new feature-auth` in `/code/myproject`, the worktree is created at `/code/myproject-feature-auth`.
@@ -132,6 +132,10 @@ async function findWorktree(identifier) {
132
132
  (wt) => wt.branch === identifier || wt.path === identifier || path.basename(wt.path) === identifier || wt.path.endsWith(identifier)
133
133
  );
134
134
  }
135
+ async function pushBranch(branchName, cwd) {
136
+ const args = ["push", "-u", "origin", branchName];
137
+ await execFileAsync("git", args, cwd ? { cwd } : void 0);
138
+ }
135
139
 
136
140
  // src/utils/env.ts
137
141
  import { glob } from "glob";
@@ -300,6 +304,15 @@ Creating worktree for branch: ${chalk.bold(branchName)}`));
300
304
  console.error(chalk.red(error.message || error));
301
305
  process.exit(1);
302
306
  }
307
+ if (options.push) {
308
+ const pushSpinner = ora("Pushing branch to remote...").start();
309
+ try {
310
+ await pushBranch(branchName, worktreePath);
311
+ pushSpinner.succeed(chalk.green(`Pushed ${branchName} to origin`));
312
+ } catch (error) {
313
+ pushSpinner.fail(chalk.yellow(`Could not push: ${error.message}`));
314
+ }
315
+ }
303
316
  const envSpinner = ora("Copying .env files...").start();
304
317
  try {
305
318
  const copiedFiles = await copyEnvFiles(mainRepoPath, worktreePath);
package/dist/index.js CHANGED
@@ -14,7 +14,7 @@ import {
14
14
  removeWorktree,
15
15
  selectAITool,
16
16
  selectMultiple
17
- } from "./chunk-U3OPVTLP.js";
17
+ } from "./chunk-KGMGW33P.js";
18
18
 
19
19
  // src/index.ts
20
20
  import { Command } from "commander";
@@ -320,7 +320,7 @@ async function handleNewWorktree(mainRepoPath) {
320
320
  }
321
321
  ]);
322
322
  if (!branchName.trim()) return;
323
- const { newCommand: newCommand2 } = await import("./new-KE3RQFLK.js");
323
+ const { newCommand: newCommand2 } = await import("./new-DHGI74HT.js");
324
324
  await newCommand2(branchName.trim(), { skipLaunch: false });
325
325
  }
326
326
  async function handleWorktreeActions(wt, mainRepoPath) {
@@ -424,13 +424,14 @@ async function pause() {
424
424
 
425
425
  // src/index.ts
426
426
  var program = new Command();
427
- program.name("wt").description("CLI tool to streamline git worktrees with AI coding assistants").version("1.1.0").action(async () => {
427
+ program.name("wt").description("CLI tool to streamline git worktrees with AI coding assistants").version("1.2.1").action(async () => {
428
428
  await interactiveCommand();
429
429
  });
430
- program.command("new <branch-name>").description("Create a new worktree and launch AI assistant").option("-i, --install", "Run package manager install after creating worktree").option("-s, --skip-launch", "Create worktree without launching AI assistant").action(async (branchName, options) => {
430
+ program.command("new <branch-name>").description("Create a new worktree and launch AI assistant").option("-i, --install", "Run package manager install after creating worktree").option("-s, --skip-launch", "Create worktree without launching AI assistant").option("-p, --push", "Push branch to remote (visible on GitHub)").action(async (branchName, options) => {
431
431
  await newCommand(branchName, {
432
432
  install: options.install,
433
- skipLaunch: options.skipLaunch
433
+ skipLaunch: options.skipLaunch,
434
+ push: options.push
434
435
  });
435
436
  });
436
437
  program.command("list").alias("ls").description("List all worktrees for the current repository").action(async () => {
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  newCommand
3
- } from "./chunk-U3OPVTLP.js";
3
+ } from "./chunk-KGMGW33P.js";
4
4
  export {
5
5
  newCommand
6
6
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "worktree-launcher",
3
- "version": "1.1.0",
3
+ "version": "1.2.1",
4
4
  "description": "CLI tool for managing git worktrees with AI coding assistants",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",