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.
- package/dist/index.js +36 -46
- 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
|
-
|
|
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:
|
|
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
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
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: "[
|
|
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
|
-
|
|
855
|
-
|
|
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
|
-
|
|
868
|
-
|
|
869
|
-
|
|
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.
|
|
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) => {
|