worktree-launcher 1.5.4 → 1.5.5

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.
Files changed (2) hide show
  1. package/dist/index.js +79 -4
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -770,7 +770,7 @@ function showNewWorktreeForm() {
770
770
  });
771
771
  input.focus();
772
772
  screen.render();
773
- input.on("submit", async () => {
773
+ input.on("submit", () => {
774
774
  const value = input.getValue()?.trim();
775
775
  if (!value) {
776
776
  form.destroy();
@@ -782,10 +782,11 @@ function showNewWorktreeForm() {
782
782
  validateBranchName(value);
783
783
  form.destroy();
784
784
  screen.render();
785
- await createNewWorktree(value, null);
785
+ showAIToolSelector(value);
786
786
  } catch (e) {
787
787
  setStatus(`Error: ${e.message}`);
788
- worktreeList.focus();
788
+ input.clearValue();
789
+ input.focus();
789
790
  screen.render();
790
791
  }
791
792
  });
@@ -796,6 +797,80 @@ function showNewWorktreeForm() {
796
797
  });
797
798
  input.readInput();
798
799
  }
800
+ function showAIToolSelector(branchName) {
801
+ let handled = false;
802
+ const form = blessed.box({
803
+ parent: screen,
804
+ top: "center",
805
+ left: "center",
806
+ width: 40,
807
+ height: 9,
808
+ border: { type: "line" },
809
+ style: { fg: "default", border: { fg: "cyan" } },
810
+ label: " Launch AI Tool "
811
+ });
812
+ blessed.text({
813
+ parent: form,
814
+ top: 1,
815
+ left: 2,
816
+ content: "Which AI assistant to launch?",
817
+ style: { fg: "default" }
818
+ });
819
+ blessed.text({
820
+ parent: form,
821
+ top: 3,
822
+ left: 2,
823
+ content: " [1] Claude Code",
824
+ style: { fg: "default" }
825
+ });
826
+ blessed.text({
827
+ parent: form,
828
+ top: 4,
829
+ left: 2,
830
+ content: " [2] Codex",
831
+ style: { fg: "default" }
832
+ });
833
+ blessed.text({
834
+ parent: form,
835
+ top: 5,
836
+ left: 2,
837
+ content: " [3] Skip",
838
+ style: { fg: "default" }
839
+ });
840
+ blessed.text({
841
+ parent: form,
842
+ top: 7,
843
+ left: 2,
844
+ content: "[Esc] cancel",
845
+ style: { fg: "cyan" }
846
+ });
847
+ form.focus();
848
+ screen.render();
849
+ const selectTool = async (tool) => {
850
+ if (handled) return;
851
+ handled = true;
852
+ form.destroy();
853
+ screen.render();
854
+ try {
855
+ await createNewWorktree(branchName, tool);
856
+ } catch (e) {
857
+ setStatus(`Error: ${e.message}`);
858
+ worktreeList.focus();
859
+ screen.render();
860
+ }
861
+ };
862
+ const cancel = () => {
863
+ if (handled) return;
864
+ handled = true;
865
+ form.destroy();
866
+ screen.render();
867
+ worktreeList.focus();
868
+ };
869
+ form.key(["1"], () => selectTool("claude"));
870
+ form.key(["2"], () => selectTool("codex"));
871
+ form.key(["3"], () => selectTool(null));
872
+ form.key(["escape"], cancel);
873
+ }
799
874
  async function createNewWorktree(branchName, tool) {
800
875
  setStatus(`Creating ${branchName}...`);
801
876
  screen.render();
@@ -907,7 +982,7 @@ async function deleteSelected() {
907
982
 
908
983
  // src/index.ts
909
984
  var program = new Command();
910
- program.name("wt").description("CLI tool to streamline git worktrees with AI coding assistants").version("1.5.4").action(async () => {
985
+ program.name("wt").description("CLI tool to streamline git worktrees with AI coding assistants").version("1.5.5").action(async () => {
911
986
  await interactiveCommand();
912
987
  });
913
988
  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) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "worktree-launcher",
3
- "version": "1.5.4",
3
+ "version": "1.5.5",
4
4
  "description": "CLI tool for managing git worktrees with AI coding assistants",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",