33 lines
951 B
TypeScript
Executable File
33 lines
951 B
TypeScript
Executable File
#!/usr/bin/env runts -- --allow-all
|
|
|
|
import {
|
|
log,
|
|
ProcessBar,
|
|
supportColor,
|
|
} from "https://script.hatter.ink/@67/deno-commons-mod.ts";
|
|
import { summarizeGitStatusDiff } from "https://script.hatter.ink/@0/deno-ai-mod.ts";
|
|
|
|
async function main() {
|
|
if (supportColor()) {
|
|
const summary = await new ProcessBar("AI summarizing").call(
|
|
async (): Promise<string> => {
|
|
return await summarizeGitStatusDiff();
|
|
},
|
|
);
|
|
if (summary) {
|
|
log.success(`AI summarized git commit message: ${summary}`);
|
|
}
|
|
} else {
|
|
const summary = await summarizeGitStatusDiff();
|
|
console.log(summary);
|
|
}
|
|
}
|
|
|
|
main().catch((err) => {
|
|
log.error(err);
|
|
process.exit(0);
|
|
}).then(() => process.exit(0));
|
|
|
|
// @SCRIPT-SIGNATURE-V1: yk-r1.ES256.20260411T121140+08:00.MEQCICY10pAbrhm7lwIAF7te
|
|
// apYXE5VLvpg9IZgzWOoh+QWdAiB9+jWbpYK5/RtGPk+CdQCNPYpxGT1xjq8J8145PnMlLA==
|