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/@3/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.20260415T232655+08:00.MEYCIQCwo/fkGCMYLUiPy73p
|
|
// DYoyOJWRvbUc+zjAiRWH6EoNeAIhAO6eh2W6IOaUwlnu/MneVHbvKSHt8u77NoUcmt8HkCd3
|