worktree-launcher 1.4.0 → 1.4.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.
Files changed (2) hide show
  1. package/dist/index.js +63 -52
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -627,7 +627,10 @@ async function interactiveCommand() {
627
627
  const repoName = path8.basename(mainRepoPath);
628
628
  screen = blessed.screen({
629
629
  smartCSR: true,
630
- title: `wt - ${repoName}`
630
+ fullUnicode: true,
631
+ title: `wt - ${repoName}`,
632
+ terminal: "xterm-256color",
633
+ warnings: false
631
634
  });
632
635
  headerBox = blessed.box({
633
636
  parent: screen,
@@ -637,9 +640,8 @@ async function interactiveCommand() {
637
640
  height: 1,
638
641
  content: ` ${repoName} (${currentBranch})`,
639
642
  style: {
640
- fg: "white",
641
- bg: "blue",
642
- bold: true
643
+ fg: "black",
644
+ bg: "cyan"
643
645
  }
644
646
  });
645
647
  worktreeList = blessed.list({
@@ -653,16 +655,16 @@ async function interactiveCommand() {
653
655
  mouse: true,
654
656
  style: {
655
657
  selected: {
656
- bg: "blue",
657
- fg: "white"
658
+ bg: "cyan",
659
+ fg: "black"
658
660
  },
659
661
  item: {
660
- fg: "white"
662
+ fg: "default"
661
663
  }
662
664
  },
663
665
  scrollbar: {
664
666
  ch: " ",
665
- style: { bg: "grey" }
667
+ style: { bg: "cyan" }
666
668
  }
667
669
  });
668
670
  statusBar = blessed.box({
@@ -673,8 +675,7 @@ async function interactiveCommand() {
673
675
  height: 1,
674
676
  content: "",
675
677
  style: {
676
- fg: "yellow",
677
- bg: "black"
678
+ fg: "green"
678
679
  }
679
680
  });
680
681
  helpBar = blessed.box({
@@ -686,7 +687,7 @@ async function interactiveCommand() {
686
687
  content: " [n]ew [d]elete [c]laude [x]codex [Enter]cd [q]uit",
687
688
  style: {
688
689
  fg: "black",
689
- bg: "white"
690
+ bg: "cyan"
690
691
  }
691
692
  });
692
693
  await refreshWorktrees();
@@ -695,8 +696,7 @@ async function interactiveCommand() {
695
696
  showPath();
696
697
  });
697
698
  screen.key(["q", "C-c"], () => {
698
- screen.destroy();
699
- process.exit(0);
699
+ cleanExit();
700
700
  });
701
701
  screen.key(["n"], () => {
702
702
  startCreationWizard();
@@ -713,11 +713,9 @@ async function interactiveCommand() {
713
713
  screen.key(["enter"], () => {
714
714
  const wt = worktrees[selectedIndex];
715
715
  if (wt) {
716
- screen.destroy();
717
- console.log(`
716
+ cleanExit(`
718
717
  cd "${wt.path}"
719
718
  `);
720
- process.exit(0);
721
719
  }
722
720
  });
723
721
  screen.key(["r"], async () => {
@@ -753,6 +751,17 @@ function setStatus(msg) {
753
751
  statusBar.setContent(` ${msg}`);
754
752
  screen.render();
755
753
  }
754
+ function cleanExit(message) {
755
+ screen.program.clear();
756
+ screen.program.disableMouse();
757
+ screen.program.showCursor();
758
+ screen.program.normalBuffer();
759
+ screen.destroy();
760
+ if (message) {
761
+ console.log(message);
762
+ }
763
+ process.exit(0);
764
+ }
756
765
  function startCreationWizard() {
757
766
  const state = {
758
767
  branchName: "",
@@ -772,9 +781,8 @@ function askBranchName(state) {
772
781
  height: 12,
773
782
  border: { type: "line" },
774
783
  style: {
775
- fg: "white",
776
- bg: "black",
777
- border: { fg: "blue" }
784
+ fg: "default",
785
+ border: { fg: "cyan" }
778
786
  },
779
787
  label: " New Worktree "
780
788
  });
@@ -790,14 +798,14 @@ function askBranchName(state) {
790
798
  top: 2,
791
799
  left: 2,
792
800
  content: `Current branch: ${currentBranch}`,
793
- style: { fg: "grey" }
801
+ style: { fg: "default" }
794
802
  });
795
803
  blessed.text({
796
804
  parent: form,
797
805
  top: 4,
798
806
  left: 2,
799
807
  content: "Branch name:",
800
- style: { fg: "white" }
808
+ style: { fg: "default" }
801
809
  });
802
810
  const input = blessed.textbox({
803
811
  parent: form,
@@ -806,8 +814,8 @@ function askBranchName(state) {
806
814
  width: 54,
807
815
  height: 1,
808
816
  style: {
809
- fg: "white",
810
- bg: "grey"
817
+ fg: "black",
818
+ bg: "white"
811
819
  },
812
820
  inputOnFocus: true
813
821
  });
@@ -816,7 +824,7 @@ function askBranchName(state) {
816
824
  top: 7,
817
825
  left: 2,
818
826
  content: "[Enter] next [Esc] cancel",
819
- style: { fg: "grey" }
827
+ style: { fg: "cyan" }
820
828
  });
821
829
  input.focus();
822
830
  screen.render();
@@ -852,9 +860,8 @@ function askBaseBranch(state) {
852
860
  height: 10,
853
861
  border: { type: "line" },
854
862
  style: {
855
- fg: "white",
856
- bg: "black",
857
- border: { fg: "blue" }
863
+ fg: "default",
864
+ border: { fg: "cyan" }
858
865
  },
859
866
  label: " Base Branch "
860
867
  });
@@ -863,7 +870,7 @@ function askBaseBranch(state) {
863
870
  top: 1,
864
871
  left: 2,
865
872
  content: "Create worktree from:",
866
- style: { fg: "white" }
873
+ style: { fg: "default" }
867
874
  });
868
875
  const list = blessed.list({
869
876
  parent: form,
@@ -874,8 +881,8 @@ function askBaseBranch(state) {
874
881
  keys: true,
875
882
  vi: true,
876
883
  style: {
877
- selected: { bg: "blue", fg: "white" },
878
- item: { fg: "white" }
884
+ selected: { bg: "cyan", fg: "black" },
885
+ item: { fg: "default" }
879
886
  },
880
887
  items: [
881
888
  ` Current branch (${currentBranch})`,
@@ -887,7 +894,7 @@ function askBaseBranch(state) {
887
894
  top: 7,
888
895
  left: 2,
889
896
  content: "[Enter] select [Esc] cancel",
890
- style: { fg: "grey" }
897
+ style: { fg: "cyan" }
891
898
  });
892
899
  list.focus();
893
900
  screen.render();
@@ -910,9 +917,8 @@ function askCopyEnv(state) {
910
917
  height: 8,
911
918
  border: { type: "line" },
912
919
  style: {
913
- fg: "white",
914
- bg: "black",
915
- border: { fg: "blue" }
920
+ fg: "default",
921
+ border: { fg: "cyan" }
916
922
  },
917
923
  label: " Environment Files "
918
924
  });
@@ -921,7 +927,7 @@ function askCopyEnv(state) {
921
927
  top: 1,
922
928
  left: 2,
923
929
  content: "Copy .env files to worktree?",
924
- style: { fg: "white" }
930
+ style: { fg: "default" }
925
931
  });
926
932
  const list = blessed.list({
927
933
  parent: form,
@@ -932,8 +938,8 @@ function askCopyEnv(state) {
932
938
  keys: true,
933
939
  vi: true,
934
940
  style: {
935
- selected: { bg: "blue", fg: "white" },
936
- item: { fg: "white" }
941
+ selected: { bg: "cyan", fg: "black" },
942
+ item: { fg: "default" }
937
943
  },
938
944
  items: [" Yes (recommended)", " No"]
939
945
  });
@@ -958,9 +964,8 @@ function askPushToRemote(state) {
958
964
  height: 8,
959
965
  border: { type: "line" },
960
966
  style: {
961
- fg: "white",
962
- bg: "black",
963
- border: { fg: "blue" }
967
+ fg: "default",
968
+ border: { fg: "cyan" }
964
969
  },
965
970
  label: " Push to Remote "
966
971
  });
@@ -969,7 +974,7 @@ function askPushToRemote(state) {
969
974
  top: 1,
970
975
  left: 2,
971
976
  content: "Push branch to GitHub immediately?",
972
- style: { fg: "white" }
977
+ style: { fg: "default" }
973
978
  });
974
979
  const list = blessed.list({
975
980
  parent: form,
@@ -980,8 +985,8 @@ function askPushToRemote(state) {
980
985
  keys: true,
981
986
  vi: true,
982
987
  style: {
983
- selected: { bg: "blue", fg: "white" },
984
- item: { fg: "white" }
988
+ selected: { bg: "cyan", fg: "black" },
989
+ item: { fg: "default" }
985
990
  },
986
991
  items: [" No (push later)", " Yes (visible on GitHub now)"]
987
992
  });
@@ -1006,9 +1011,8 @@ function askAITool(state) {
1006
1011
  height: 10,
1007
1012
  border: { type: "line" },
1008
1013
  style: {
1009
- fg: "white",
1010
- bg: "black",
1011
- border: { fg: "blue" }
1014
+ fg: "default",
1015
+ border: { fg: "cyan" }
1012
1016
  },
1013
1017
  label: " Launch AI Tool "
1014
1018
  });
@@ -1017,7 +1021,7 @@ function askAITool(state) {
1017
1021
  top: 1,
1018
1022
  left: 2,
1019
1023
  content: "Which AI assistant to launch?",
1020
- style: { fg: "white" }
1024
+ style: { fg: "default" }
1021
1025
  });
1022
1026
  const list = blessed.list({
1023
1027
  parent: form,
@@ -1028,8 +1032,8 @@ function askAITool(state) {
1028
1032
  keys: true,
1029
1033
  vi: true,
1030
1034
  style: {
1031
- selected: { bg: "blue", fg: "white" },
1032
- item: { fg: "white" }
1035
+ selected: { bg: "cyan", fg: "black" },
1036
+ item: { fg: "default" }
1033
1037
  },
1034
1038
  items: [" Claude Code", " Codex", " Skip (just create worktree)"]
1035
1039
  });
@@ -1094,6 +1098,10 @@ async function launchInWorktree(worktreePath, tool) {
1094
1098
  return;
1095
1099
  }
1096
1100
  setStatus(`Launching ${tool}...`);
1101
+ screen.program.clear();
1102
+ screen.program.disableMouse();
1103
+ screen.program.showCursor();
1104
+ screen.program.normalBuffer();
1097
1105
  screen.destroy();
1098
1106
  launchAITool({ cwd: worktreePath, tool });
1099
1107
  console.log(`
@@ -1117,8 +1125,7 @@ async function deleteSelected() {
1117
1125
  height: 5,
1118
1126
  border: { type: "line" },
1119
1127
  style: {
1120
- fg: "white",
1121
- bg: "black",
1128
+ fg: "default",
1122
1129
  border: { fg: "red" }
1123
1130
  }
1124
1131
  });
@@ -1153,6 +1160,10 @@ async function launchAI(tool) {
1153
1160
  return;
1154
1161
  }
1155
1162
  setStatus(`Launching ${tool}...`);
1163
+ screen.program.clear();
1164
+ screen.program.disableMouse();
1165
+ screen.program.showCursor();
1166
+ screen.program.normalBuffer();
1156
1167
  screen.destroy();
1157
1168
  launchAITool({ cwd: wt.path, tool });
1158
1169
  console.log(`
@@ -1163,7 +1174,7 @@ ${tool} launched in: ${path8.basename(wt.path)}
1163
1174
 
1164
1175
  // src/index.ts
1165
1176
  var program = new Command();
1166
- program.name("wt").description("CLI tool to streamline git worktrees with AI coding assistants").version("1.4.0").action(async () => {
1177
+ program.name("wt").description("CLI tool to streamline git worktrees with AI coding assistants").version("1.4.1").action(async () => {
1167
1178
  await interactiveCommand();
1168
1179
  });
1169
1180
  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.4.0",
3
+ "version": "1.4.1",
4
4
  "description": "CLI tool for managing git worktrees with AI coding assistants",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",