Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
"cleye": "^1.3.4",
"execa": "^9.6.0",
"fs-fixture": "^2.8.1",
"gradient-string": "^3.0.0",
"groq-sdk": "^0.32.0",
"https-proxy-agent": "^7.0.6",
"ini": "^5.0.0",
Expand Down
36 changes: 36 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 2 additions & 14 deletions src/commands/lazycommit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import { getConfig } from '../utils/config.js';
import { generateCommitMessageFromSummary } from '../utils/groq.js';
import { generatePrompt } from '../utils/prompt.js';
import { KnownError, handleCliError } from '../utils/error.js';
import { renderTitle } from '../utils/render-title.js';


// Build lightweight per-file diff snippets to give semantic context without huge payloads
Expand Down Expand Up @@ -112,19 +113,6 @@ WRONG FORMAT (do not use):
Return only the commit message line, no explanations.`;
};



const ASCII_LOGO = `╔──────────────────────────────────────────────────────────────────────────────────────╗
│ │
│ ██╗ █████╗ ███████╗██╗ ██╗ ██████╗ ██████╗ ███╗ ███╗███╗ ███╗██╗████████╗ │
│ ██║ ██╔══██╗╚══███╔╝╚██╗ ██╔╝██╔════╝██╔═══██╗████╗ ████║████╗ ████║██║╚══██╔══╝ │
│ ██║ ███████║ ███╔╝ ╚████╔╝ ██║ ██║ ██║██╔████╔██║██╔████╔██║██║ ██║ │
│ ██║ ██╔══██║ ███╔╝ ╚██╔╝ ██║ ██║ ██║██║╚██╔╝██║██║╚██╔╝██║██║ ██║ │
│ ███████╗██║ ██║███████╗ ██║ ╚██████╗╚██████╔╝██║ ╚═╝ ██║██║ ╚═╝ ██║██║ ██║ │
│ ╚══════╝╚═╝ ╚═╝╚══════╝ ╚═╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚═╝ │
│ │
╚──────────────────────────────────────────────────────────────────────────────────────╝`;

export default async (
generate: number | undefined,
excludeFiles: string[],
Expand All @@ -134,7 +122,7 @@ export default async (
rawArgv: string[]
) =>
(async () => {
console.log(ASCII_LOGO);
renderTitle();
console.log();
intro(bgCyan(black(' lazycommit ')));
await assertGitRepo();
Expand Down
60 changes: 60 additions & 0 deletions src/utils/render-title.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
import gradient from "gradient-string";

const ASCII_LOGO = `╔──────────────────────────────────────────────────────────────────────────────────────╗
│ │
│ ██╗ █████╗ ███████╗██╗ ██╗ ██████╗ ██████╗ ███╗ ███╗███╗ ███╗██╗████████╗ │
│ ██║ ██╔══██╗╚══███╔╝╚██╗ ██╔╝██╔════╝██╔═══██╗████╗ ████║████╗ ████║██║╚══██╔══╝ │
│ ██║ ███████║ ███╔╝ ╚████╔╝ ██║ ██║ ██║██╔████╔██║██╔████╔██║██║ ██║ │
│ ██║ ██╔══██║ ███╔╝ ╚██╔╝ ██║ ██║ ██║██║╚██╔╝██║██║╚██╔╝██║██║ ██║ │
│ ███████╗██║ ██║███████╗ ██║ ╚██████╗╚██████╔╝██║ ╚═╝ ██║██║ ╚═╝ ██║██║ ██║ │
│ ╚══════╝╚═╝ ╚═╝╚══════╝ ╚═╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚═╝ │
│ │
╚──────────────────────────────────────────────────────────────────────────────────────╝`;

const ASCII_LOGO_MULTI_LINE = `╔─────────────────────────────────────────────────────╗
│ │
│ ██╗ █████╗ ███████╗██╗ ██╗ │
│ ██║ ██╔══██╗╚══███╔╝╚██╗ ██╔╝ │
│ ██║ ███████║ ███╔╝ ╚████╔╝ │
│ ██║ ██╔══██║ ███╔╝ ╚██╔╝ │
│ ███████╗██║ ██║███████╗ ██║ │
│ ╚══════╝╚═╝ ╚═╝╚══════╝ ╚═╝ │
│ │
│ ██████╗ ██████╗ ███╗ ███╗███╗ ███╗██╗████████╗ │
│ ██╔════╝██╔═══██╗████╗ ████║████╗ ████║██║╚══██╔══╝ │
│ ██║ ██║ ██║██╔████╔██║██╔████╔██║██║ ██║ │
│ ██║ ██║ ██║██║╚██╔╝██║██║╚██╔╝██║██║ ██║ │
│ ╚██████╗╚██████╔╝██║ ╚═╝ ██║██║ ╚═╝ ██║██║ ██║ │
│ ╚═════╝ ╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚═╝ │
│ │
╚─────────────────────────────────────────────────────╝`;

const ASCII_LOGO_MINI = `╔══════════════╗
║ LAZYCOMMIT ║
╚══════════════╝`;

const gradientColors = [
"#F5C2E7",
"#CBA6F7",
"#F38BA8",
"#E78284",
"#FAB387",
"#F9E2AF",
"#A6E3A1",
"#94E2D5",
"#89DCEB",
"#74C7EC",
"#B4BEFE",
];

function getTitle(width: number): string {
if (width > 100) return ASCII_LOGO;
if (width > 55) return ASCII_LOGO_MULTI_LINE;
return ASCII_LOGO_MINI;
}
Comment on lines +50 to +54
Copy link

Copilot AI Sep 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The breakpoint values 100 and 55 are magic numbers that should be extracted as named constants to improve maintainability and make the layout logic more explicit.

Copilot uses AI. Check for mistakes.


export const renderTitle = () => {
const terminalWidth = process.stdout.columns || 55;
Copy link

Copilot AI Sep 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The fallback value 55 is a magic number that should be extracted as a named constant. This value appears to correspond to one of the breakpoints and should be clearly documented.

Copilot uses AI. Check for mistakes.

const title: string = getTitle(terminalWidth);
console.log(gradient(gradientColors).multiline(title));
};