worktree-launcher 1.5.3 → 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 +36 -46
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -798,14 +798,13 @@ function showNewWorktreeForm() {
798
798
  input.readInput();
799
799
  }
800
800
  function showAIToolSelector(branchName) {
801
- const options = ["Claude Code", "Codex", "Skip"];
802
- let selectedIdx = 0;
801
+ let handled = false;
803
802
  const form = blessed.box({
804
803
  parent: screen,
805
804
  top: "center",
806
805
  left: "center",
807
806
  width: 40,
808
- height: 10,
807
+ height: 9,
809
808
  border: { type: "line" },
810
809
  style: { fg: "default", border: { fg: "cyan" } },
811
810
  label: " Launch AI Tool "
@@ -817,44 +816,40 @@ function showAIToolSelector(branchName) {
817
816
  content: "Which AI assistant to launch?",
818
817
  style: { fg: "default" }
819
818
  });
820
- const optionBoxes = [];
821
- options.forEach((opt, i) => {
822
- const box = blessed.box({
823
- parent: form,
824
- top: 3 + i,
825
- left: 2,
826
- width: 34,
827
- height: 1,
828
- content: ` ${opt}`,
829
- style: { fg: "default" }
830
- });
831
- optionBoxes.push(box);
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" }
832
839
  });
833
840
  blessed.text({
834
841
  parent: form,
835
842
  top: 7,
836
843
  left: 2,
837
- content: "[\u2191/\u2193] select [Enter] confirm [Esc] cancel",
844
+ content: "[Esc] cancel",
838
845
  style: { fg: "cyan" }
839
846
  });
840
- function updateSelection() {
841
- optionBoxes.forEach((box, i) => {
842
- if (i === selectedIdx) {
843
- box.style.bg = "cyan";
844
- box.style.fg = "black";
845
- } else {
846
- box.style.bg = "default";
847
- box.style.fg = "default";
848
- }
849
- });
850
- screen.render();
851
- }
852
- updateSelection();
853
847
  form.focus();
854
- const confirmSelection = async () => {
855
- const tool = selectedIdx === 0 ? "claude" : selectedIdx === 1 ? "codex" : null;
848
+ screen.render();
849
+ const selectTool = async (tool) => {
850
+ if (handled) return;
851
+ handled = true;
856
852
  form.destroy();
857
- setStatus(`Creating worktree...`);
858
853
  screen.render();
859
854
  try {
860
855
  await createNewWorktree(branchName, tool);
@@ -864,22 +859,17 @@ function showAIToolSelector(branchName) {
864
859
  screen.render();
865
860
  }
866
861
  };
867
- form.key(["up", "k"], () => {
868
- selectedIdx = (selectedIdx - 1 + options.length) % options.length;
869
- updateSelection();
870
- });
871
- form.key(["down", "j"], () => {
872
- selectedIdx = (selectedIdx + 1) % options.length;
873
- updateSelection();
874
- });
875
- form.key(["enter"], () => {
876
- confirmSelection();
877
- });
878
- form.key(["escape"], () => {
862
+ const cancel = () => {
863
+ if (handled) return;
864
+ handled = true;
879
865
  form.destroy();
880
866
  screen.render();
881
867
  worktreeList.focus();
882
- });
868
+ };
869
+ form.key(["1"], () => selectTool("claude"));
870
+ form.key(["2"], () => selectTool("codex"));
871
+ form.key(["3"], () => selectTool(null));
872
+ form.key(["escape"], cancel);
883
873
  }
884
874
  async function createNewWorktree(branchName, tool) {
885
875
  setStatus(`Creating ${branchName}...`);
@@ -992,7 +982,7 @@ async function deleteSelected() {
992
982
 
993
983
  // src/index.ts
994
984
  var program = new Command();
995
- program.name("wt").description("CLI tool to streamline git worktrees with AI coding assistants").version("1.5.3").action(async () => {
985
+ program.name("wt").description("CLI tool to streamline git worktrees with AI coding assistants").version("1.5.5").action(async () => {
996
986
  await interactiveCommand();
997
987
  });
998
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.3",
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",