Skip to content

Commit ae89345

Browse files
feat: add lingo.dev art to the cli output (#427)
1 parent eaf0be9 commit ae89345

3 files changed

Lines changed: 107 additions & 7 deletions

File tree

packages/cli/package.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,12 @@
5252
"dotenv": "^16.4.7",
5353
"express": "^4.21.2",
5454
"external-editor": "^3.1.0",
55+
"figlet": "^1.8.0",
56+
"figlet-cli": "^0.2.0",
5557
"flat": "^6.0.1",
5658
"gettext-parser": "^8.0.0",
5759
"glob": "<11.0.0",
60+
"gradient-string": "^3.0.0",
5861
"gray-matter": "^4.0.3",
5962
"ini": "^5.0.0",
6063
"inquirer": "^12.3.0",
@@ -92,6 +95,7 @@
9295
"@types/cors": "^2.8.17",
9396
"@types/diff": "^6.0.0",
9497
"@types/express": "^5.0.0",
98+
"@types/figlet": "^1.7.0",
9599
"@types/gettext-parser": "^4.0.4",
96100
"@types/glob": "^8.1.0",
97101
"@types/ini": "^4.1.1",

packages/cli/src/cli/index.ts

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ import dotenv from "dotenv";
22
dotenv.config();
33

44
import { InteractiveCommand } from "interactive-commander";
5+
import figlet from "figlet";
6+
import { vice } from "gradient-string";
57

68
import authCmd from "./cli/auth";
79
import initCmd from "./cli/init";
@@ -19,7 +21,14 @@ export default new InteractiveCommand()
1921
.addHelpText(
2022
"beforeAll",
2123
`
22-
Lingo.dev CLI
24+
${vice(
25+
figlet.textSync("LINGO.DEV", {
26+
font: "ANSI Shadow",
27+
horizontalLayout: "default",
28+
verticalLayout: "default",
29+
}),
30+
)}
31+
2332
Website: https://lingo.dev
2433
`,
2534
)
@@ -30,4 +39,11 @@ Website: https://lingo.dev
3039
.addCommand(authCmd)
3140
.addCommand(configCmd)
3241
.addCommand(lockfileCmd)
33-
.addCommand(cleanupCmd);
42+
.addCommand(cleanupCmd)
43+
.exitOverride((err) => {
44+
// Exit with code 0 when help or version is displayed
45+
if (err.code === "commander.helpDisplayed" || err.code === "commander.version" || err.code === "commander.help") {
46+
process.exit(0);
47+
}
48+
throw err;
49+
});

pnpm-lock.yaml

Lines changed: 85 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)