feat: implement gai CLI for AI-generated Conventional Commits #1
@@ -277,6 +277,7 @@ interface MenuAction {
|
||||
|
||||
const MENU_ACTIONS: MenuAction[] = [
|
||||
{ key: "commit", label: "commit", description: "Generate AI commit message" },
|
||||
{ key: "config", label: "config", description: "Configure API settings" },
|
||||
];
|
||||
|
||||
async function showMenu(): Promise<void> {
|
||||
@@ -304,9 +305,9 @@ async function showMenu(): Promise<void> {
|
||||
}
|
||||
|
||||
function clearMenu() {
|
||||
process.stdout.write(`\x1b[${totalLines}A`);
|
||||
process.stdout.write(`\x1b[${headerLines}A`);
|
||||
for (let i = 0; i < totalLines; i++) {
|
||||
process.stdout.write("\x1b[2K\x1b[1B");
|
||||
process.stdout.write("\r\x1b[2K\n");
|
||||
}
|
||||
process.stdout.write(`\x1b[${totalLines}A`);
|
||||
}
|
||||
@@ -384,6 +385,8 @@ async function showMenu(): Promise<void> {
|
||||
|
||||
if (selected.key === "commit") {
|
||||
handleCommit(false, false).then(resolve);
|
||||
} else if (selected.key === "config") {
|
||||
handleConfig().then(resolve);
|
||||
} else {
|
||||
resolve();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user