Skip to content
Merged
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
8 changes: 6 additions & 2 deletions .github/workflows/package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ on:

jobs:
build:
strategy:
matrix:
node-version: ['22', '24']
runs-on: ubuntu-latest
permissions:
contents: read
Expand All @@ -19,8 +22,9 @@ jobs:
- uses: oven-sh/setup-bun@v2
- uses: actions/setup-node@v4
with:
node-version: '25'
- uses: wgtechlabs/package-build-flow-action@v2.0.1
node-version: ${{ matrix.node-version }}
- if: ${{ matrix.node-version == '22' }}
uses: wgtechlabs/package-build-flow-action@v2.0.1
with:
npm-token: ${{ secrets.NPM_TOKEN }}
github-token: ${{ secrets.GITHUB_TOKEN }}
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Thanks for your interest in contributing to **GitHub Labels Template**! Here's h

## Prerequisites

- [Node.js](https://nodejs.org) (v25+)
- [Node.js](https://nodejs.org) (v22+; LTS recommended: v22 or v24)
- [Bun](https://bun.sh) (v1.0+)
- [GitHub CLI](https://cli.github.com) (`gh`) installed and authenticated

Expand Down
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ A CLI tool to apply a curated set of GitHub labels to any repository using `gh`
- 🚫 **Apply with Exclusions**: Skip specific labels or entire categories with `--exclude` / `--exclude-category`
- ✅ **Pre-Flight Checks**: Validates `gh` CLI is installed and authenticated before doing anything
- 📊 **Clear Output**: Structured logging powered by [@wgtechlabs/log-engine](https://github.com/wgtechlabs/log-engine) with color-coded levels and emoji
- 🎨 **ASCII Banner**: Beautiful ANSI Shadow figlet banner with version and author info
- 🎨 **ASCII Banner**: Styled Slant text logo with version and author info
- 🤖 **AI Label Generator**: Generate custom labels using GitHub Copilot — interactive pick, refine, and apply
- 🌐 **Node Runtime + Bun Toolchain**: Runs on Node.js, built and tested with Bun

Expand Down Expand Up @@ -50,6 +50,8 @@ ghlt apply

## Prerequisites

- [Node.js](https://nodejs.org) (v22+; LTS recommended: v22 or v24)
- [Bun](https://bun.sh) (v1.0+)
- [GitHub CLI](https://cli.github.com) (`gh`) installed and authenticated
- [GitHub Copilot](https://github.com/features/copilot) subscription (required for `generate` command only)

Expand Down Expand Up @@ -326,7 +328,7 @@ OPTIONS (preview)

This project uses the [Bun test framework](https://bun.sh/docs/cli/test) for testing.

Runtime execution uses Node.js (latest recommended).
Runtime execution uses Node.js v22+ (LTS recommended: v22 or v24).

```bash
# Run all tests
Expand Down
8 changes: 0 additions & 8 deletions bun.lock

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

11 changes: 5 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,15 @@
"dist"
],
"scripts": {
"build": "bun build src/index.ts --outfile dist/index.js --target node --packages external",
"build": "bun build src/index.ts --outfile dist/index.js --target node",
"dev": "bun run build && node dist/index.js",
"preview": "bun run build && node dist/index.js preview",
"start": "bun run build && node dist/index.js",
"test": "bun test"
"test": "bun test",
"prepack": "bun run build"
},
"engines": {
"node": ">=25",
"node": ">=22",
"bun": ">=1.0"
},
"keywords": [
Expand All @@ -38,12 +39,10 @@
"@inquirer/prompts": "^8.2.1",
"@wgtechlabs/log-engine": "^2.3.1",
"citty": "^0.1.6",
"figlet": "^1.10.0",
"picocolors": "^1.1.1"
},
"devDependencies": {
"@types/node": "^25.7.0",
"@types/bun": "latest",
"@types/figlet": "^1.7.0"
"@types/bun": "latest"
}
}
21 changes: 15 additions & 6 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,22 @@ import { showBanner, showUpdateBanner, getVersion } from "./ui/banner";
import { checkForUpdate } from "./utils/updater";

const isHelp = process.argv.includes("--help") || process.argv.includes("-h");
const isVersion = process.argv.includes("--version") || process.argv.includes("-v");
const isUpdateCommand = process.argv.includes("update");
showBanner(isHelp);

if (!isUpdateCommand) {
const availableUpdate = checkForUpdate();
if (availableUpdate) {
showUpdateBanner(availableUpdate);
if (isVersion) {
console.log(`ghlt version v${getVersion()}`);
process.exit(0);
}

if (!isVersion) {
showBanner(isHelp);

if (!isUpdateCommand) {
const availableUpdate = checkForUpdate();
if (availableUpdate) {
showUpdateBanner(availableUpdate);
}
}
}

Expand Down Expand Up @@ -45,7 +54,7 @@ const main = defineCommand({
},
run({ args }) {
if (args.version) {
console.log(`ghlt v${getVersion()}`);
console.log(`v${getVersion()}`);
}
},
});
Expand Down
39 changes: 14 additions & 25 deletions src/ui/banner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,18 @@
* CLI Banner
*
* ASCII art logo and version display for GHLT CLI.
* Uses figlet with ANSI Shadow font for a modern look.
* Uses a pre-rendered Slant logo for stable output across environments.
* Displayed at the top of CLI output.
*/

import figlet from "figlet";
import pc from "picocolors";
import pkg from "../../package.json";

// Generate the logo at module load time (synchronous, fast)
let LOGO: string;
try {
LOGO = figlet.textSync("GHLT", { font: "ANSI Shadow" });
} catch {
// Fallback if figlet font not available
LOGO =
` ██████╗ ██╗ ██╗██╗ ████████╗\n` +
`██╔════╝ ██║ ██║██║ ╚══██╔══╝\n` +
`██║ ███╗███████║██║ ██║ \n` +
`██║ ██║██╔══██║██║ ██║ \n` +
`╚██████╔╝██║ ██║███████╗ ██║ \n` +
` ╚═════╝ ╚═╝ ╚═╝╚══════╝ ╚═╝ `;
}
const LOGO = String.raw` ________ ____ ______
/ ____/ / / / / /_ __/
/ / __/ /_/ / / / /
/ /_/ / __ / /___/ /
\____/_/ /_/_____/_/`;

/**
* Get the version string from package.json
Expand Down Expand Up @@ -66,25 +56,24 @@ export function showUpdateBanner(latestVersion: string): void {
*/
export function showBanner(minimal = false): void {
console.log(pc.cyan("\n" + LOGO));
console.log();
console.log(
` ${pc.dim("v" + getVersion())} ${pc.dim("—")} ${pc.dim("Built by " + getAuthor())}`
` ${pc.white(`v${getVersion()}`)} ${pc.white("—")} ${pc.white(`Built by ${getAuthor()}`)} ${pc.white("(")}${pc.white(linkify("with Him", "https://youtu.be/VOZbswniA-g?si=pdVHNSAfZW0vQLJ7"))}${pc.white(")")}`
);

if (!minimal) {
console.log(
` ${pc.dim(pkg.description)}`
);
console.log();
console.log(
` ${pc.yellow("Star")} ${pc.cyan("https://gh.waren.build/github-labels-template")}`
` 🤝 ${pc.white("Contribute:")} ${pc.dim(linkify("gh.waren.build/github-labels-template", "https://gh.waren.build/github-labels-template"))}`
);
console.log(
` ${pc.green("Contribute")} ${pc.cyan("https://gh.waren.build/github-labels-template/blob/main/CONTRIBUTING.md")}`
);
console.log(
` ${pc.magenta("Sponsor")} ${pc.cyan("https://warengonzaga.com/sponsor")}`
` 🙏 ${pc.white("Sponsor:")} ${pc.dim(linkify("warengonzaga.com/sponsor", "https://warengonzaga.com/sponsor"))}`
);
}

console.log();
}

function linkify(label: string, url: string): string {
return `\u001B]8;;${url}\u0007${label}\u001B]8;;\u0007`;
}
Loading