worktree-launcher 1.5.3 → 1.5.4
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 +4 -89
- 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", () => {
|
|
773
|
+
input.on("submit", async () => {
|
|
774
774
|
const value = input.getValue()?.trim();
|
|
775
775
|
if (!value) {
|
|
776
776
|
form.destroy();
|
|
@@ -782,11 +782,10 @@ function showNewWorktreeForm() {
|
|
|
782
782
|
validateBranchName(value);
|
|
783
783
|
form.destroy();
|
|
784
784
|
screen.render();
|
|
785
|
-
|
|
785
|
+
await createNewWorktree(value, null);
|
|
786
786
|
} catch (e) {
|
|
787
787
|
setStatus(`Error: ${e.message}`);
|
|
788
|
-
|
|
789
|
-
input.focus();
|
|
788
|
+
worktreeList.focus();
|
|
790
789
|
screen.render();
|
|
791
790
|
}
|
|
792
791
|
});
|
|
@@ -797,90 +796,6 @@ function showNewWorktreeForm() {
|
|
|
797
796
|
});
|
|
798
797
|
input.readInput();
|
|
799
798
|
}
|
|
800
|
-
function showAIToolSelector(branchName) {
|
|
801
|
-
const options = ["Claude Code", "Codex", "Skip"];
|
|
802
|
-
let selectedIdx = 0;
|
|
803
|
-
const form = blessed.box({
|
|
804
|
-
parent: screen,
|
|
805
|
-
top: "center",
|
|
806
|
-
left: "center",
|
|
807
|
-
width: 40,
|
|
808
|
-
height: 10,
|
|
809
|
-
border: { type: "line" },
|
|
810
|
-
style: { fg: "default", border: { fg: "cyan" } },
|
|
811
|
-
label: " Launch AI Tool "
|
|
812
|
-
});
|
|
813
|
-
blessed.text({
|
|
814
|
-
parent: form,
|
|
815
|
-
top: 1,
|
|
816
|
-
left: 2,
|
|
817
|
-
content: "Which AI assistant to launch?",
|
|
818
|
-
style: { fg: "default" }
|
|
819
|
-
});
|
|
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);
|
|
832
|
-
});
|
|
833
|
-
blessed.text({
|
|
834
|
-
parent: form,
|
|
835
|
-
top: 7,
|
|
836
|
-
left: 2,
|
|
837
|
-
content: "[\u2191/\u2193] select [Enter] confirm [Esc] cancel",
|
|
838
|
-
style: { fg: "cyan" }
|
|
839
|
-
});
|
|
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
|
-
form.focus();
|
|
854
|
-
const confirmSelection = async () => {
|
|
855
|
-
const tool = selectedIdx === 0 ? "claude" : selectedIdx === 1 ? "codex" : null;
|
|
856
|
-
form.destroy();
|
|
857
|
-
setStatus(`Creating worktree...`);
|
|
858
|
-
screen.render();
|
|
859
|
-
try {
|
|
860
|
-
await createNewWorktree(branchName, tool);
|
|
861
|
-
} catch (e) {
|
|
862
|
-
setStatus(`Error: ${e.message}`);
|
|
863
|
-
worktreeList.focus();
|
|
864
|
-
screen.render();
|
|
865
|
-
}
|
|
866
|
-
};
|
|
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"], () => {
|
|
879
|
-
form.destroy();
|
|
880
|
-
screen.render();
|
|
881
|
-
worktreeList.focus();
|
|
882
|
-
});
|
|
883
|
-
}
|
|
884
799
|
async function createNewWorktree(branchName, tool) {
|
|
885
800
|
setStatus(`Creating ${branchName}...`);
|
|
886
801
|
screen.render();
|
|
@@ -992,7 +907,7 @@ async function deleteSelected() {
|
|
|
992
907
|
|
|
993
908
|
// src/index.ts
|
|
994
909
|
var program = new Command();
|
|
995
|
-
program.name("wt").description("CLI tool to streamline git worktrees with AI coding assistants").version("1.5.
|
|
910
|
+
program.name("wt").description("CLI tool to streamline git worktrees with AI coding assistants").version("1.5.4").action(async () => {
|
|
996
911
|
await interactiveCommand();
|
|
997
912
|
});
|
|
998
913
|
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) => {
|