careervivid 1.1.4 → 1.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/branding.d.ts +12 -0
- package/dist/branding.d.ts.map +1 -0
- package/dist/branding.js +56 -0
- package/dist/commands/whiteboard.d.ts.map +1 -1
- package/dist/commands/whiteboard.js +19 -10
- package/dist/index.js +23 -5
- package/dist/output.d.ts +0 -6
- package/dist/output.d.ts.map +1 -1
- package/dist/output.js +19 -15
- package/package.json +3 -1
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare const COLORS: {
|
|
2
|
+
primary: string;
|
|
3
|
+
secondary: string;
|
|
4
|
+
success: string;
|
|
5
|
+
error: string;
|
|
6
|
+
dim: string;
|
|
7
|
+
};
|
|
8
|
+
export declare const LOGO_ASCII = "\n ______ _ ___ _ _ \n / ____/____ _ _____ ___ ___ ____| | / (_) _ __ (_) _ | | | |\n / / / __ `/ ___/ _ \\/ _ \\/ ___/ | / / /| | | | / / | | | | | | |\n/ /___ / /_/ / / / __/ __/ / | |/ / / | | | |/ / | | | | |___| |\n\\____/ \\__,_/_/ \\___/\\___/_/ |___/ / |_| |___/ |_| |_|\\___/|_|\n";
|
|
9
|
+
export declare function getBrandedLogo(): string;
|
|
10
|
+
export declare function printWelcome(): void;
|
|
11
|
+
export declare function getHelpHeader(): string;
|
|
12
|
+
//# sourceMappingURL=branding.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"branding.d.ts","sourceRoot":"","sources":["../src/branding.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,MAAM;;;;;;CAMlB,CAAC;AAMF,eAAO,MAAM,UAAU,sXAMtB,CAAC;AAEF,wBAAgB,cAAc,IAAI,MAAM,CAEvC;AAID,wBAAgB,YAAY,IAAI,IAAI,CA0BnC;AAID,wBAAgB,aAAa,IAAI,MAAM,CAOtC"}
|
package/dist/branding.js
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import chalk from "chalk";
|
|
2
|
+
import boxen from "boxen";
|
|
3
|
+
import gradient from "gradient-string";
|
|
4
|
+
// ── Colors ───────────────────────────────────────────────────────────────────
|
|
5
|
+
export const COLORS = {
|
|
6
|
+
primary: "#3b82f6", // Blue-500
|
|
7
|
+
secondary: "#f59e0b", // Amber-500
|
|
8
|
+
success: "#10b981", // Emerald-500
|
|
9
|
+
error: "#ef4444", // Red-500
|
|
10
|
+
dim: "#6b7280", // Gray-500
|
|
11
|
+
};
|
|
12
|
+
const brandGradient = gradient([COLORS.primary, COLORS.secondary]);
|
|
13
|
+
// ── Logo ─────────────────────────────────────────────────────────────────────
|
|
14
|
+
export const LOGO_ASCII = `
|
|
15
|
+
______ _ ___ _ _
|
|
16
|
+
/ ____/____ _ _____ ___ ___ ____| | / (_) _ __ (_) _ | | | |
|
|
17
|
+
/ / / __ \`/ ___/ _ \\/ _ \\/ ___/ | / / /| | | | / / | | | | | | |
|
|
18
|
+
/ /___ / /_/ / / / __/ __/ / | |/ / / | | | |/ / | | | | |___| |
|
|
19
|
+
\\____/ \\__,_/_/ \\___/\\___/_/ |___/ / |_| |___/ |_| |_|\\___/|_|
|
|
20
|
+
`;
|
|
21
|
+
export function getBrandedLogo() {
|
|
22
|
+
return brandGradient.multiline(LOGO_ASCII);
|
|
23
|
+
}
|
|
24
|
+
// ── Welcome Screen ───────────────────────────────────────────────────────────
|
|
25
|
+
export function printWelcome() {
|
|
26
|
+
const logo = getBrandedLogo();
|
|
27
|
+
const content = `
|
|
28
|
+
${chalk.bold("Welcome to the CareerVivid CLI!")}
|
|
29
|
+
${chalk.dim("Your command-center for personal brand building.")}
|
|
30
|
+
|
|
31
|
+
${chalk.white("To get started, run:")}
|
|
32
|
+
${chalk.cyan(" cv auth login")}
|
|
33
|
+
|
|
34
|
+
${chalk.dim("Quick Commands:")}
|
|
35
|
+
${chalk.white("• cv new")} Scaffold a new diagram
|
|
36
|
+
${chalk.white("• cv publish <file>")} Publish to your portfolio
|
|
37
|
+
${chalk.white("• cv help")} Show all commands
|
|
38
|
+
`;
|
|
39
|
+
console.log(boxen(logo + "\n" + content, {
|
|
40
|
+
padding: 1,
|
|
41
|
+
margin: 1,
|
|
42
|
+
borderStyle: "round",
|
|
43
|
+
borderColor: COLORS.primary,
|
|
44
|
+
title: chalk.bold.blue(" v1.1.4 "),
|
|
45
|
+
titleAlignment: "right",
|
|
46
|
+
}));
|
|
47
|
+
}
|
|
48
|
+
// ── Help Header ─────────────────────────────────────────────────────────────
|
|
49
|
+
export function getHelpHeader() {
|
|
50
|
+
return boxen(brandGradient(" CAREERVIVID CLI "), {
|
|
51
|
+
padding: 0,
|
|
52
|
+
margin: { top: 1, bottom: 1 },
|
|
53
|
+
borderStyle: "bold",
|
|
54
|
+
borderColor: COLORS.secondary,
|
|
55
|
+
});
|
|
56
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"whiteboard.d.ts","sourceRoot":"","sources":["../../src/commands/whiteboard.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"whiteboard.d.ts","sourceRoot":"","sources":["../../src/commands/whiteboard.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAsNpC,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,OAAO,GAAG,GAAG,GAAG,IAAI,CAqE/D;AAED,wBAAgB,4BAA4B,CAAC,OAAO,EAAE,OAAO,GAAG,GAAG,GAAG,IAAI,CAMzE;AAED,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CA+EhE"}
|
|
@@ -7,12 +7,14 @@
|
|
|
7
7
|
* cv whiteboard publish diagram.mmd Publish an existing .mmd file
|
|
8
8
|
* cv whiteboard list-templates List all available diagram templates
|
|
9
9
|
*/
|
|
10
|
-
import {
|
|
10
|
+
import { existsSync, writeFileSync } from "fs";
|
|
11
11
|
import { resolve } from "path";
|
|
12
12
|
import chalk from "chalk";
|
|
13
|
+
import boxen from "boxen";
|
|
13
14
|
import ora from "ora";
|
|
14
15
|
import { publishPost, isApiError } from "../api.js";
|
|
15
16
|
import { printError, printSuccess, handleApiError } from "../output.js";
|
|
17
|
+
import { COLORS } from "../branding.js";
|
|
16
18
|
// ── Built-in Mermaid templates ────────────────────────────────────────────────
|
|
17
19
|
const TEMPLATES = {
|
|
18
20
|
flowchart: {
|
|
@@ -236,15 +238,22 @@ export function registerNewCommand(program) {
|
|
|
236
238
|
process.exit(1);
|
|
237
239
|
}
|
|
238
240
|
writeFileSync(outPath, content + "\n", "utf-8");
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
241
|
+
const successBox = `
|
|
242
|
+
${chalk.bold("✔ Diagram scaffolded!")}
|
|
243
|
+
|
|
244
|
+
${chalk.dim("File: ")} ${chalk.cyan(filename)}
|
|
245
|
+
${chalk.dim("Template:")} ${chalk.white(templateKey)}
|
|
246
|
+
|
|
247
|
+
${chalk.bold("Next steps:")}
|
|
248
|
+
1. Edit ${chalk.cyan(filename)} in your editor
|
|
249
|
+
2. Publish: ${chalk.green(`cv publish ${filename} --title "..."`)}
|
|
250
|
+
`;
|
|
251
|
+
console.log(boxen(successBox.trim(), {
|
|
252
|
+
padding: 1,
|
|
253
|
+
margin: { top: 1, bottom: 1 },
|
|
254
|
+
borderStyle: "round",
|
|
255
|
+
borderColor: COLORS.success,
|
|
256
|
+
}));
|
|
248
257
|
});
|
|
249
258
|
}
|
|
250
259
|
export function registerListTemplatesCommand(program) {
|
package/dist/index.js
CHANGED
|
@@ -16,6 +16,9 @@
|
|
|
16
16
|
* cv --help / cv --version
|
|
17
17
|
*/
|
|
18
18
|
import { Command } from "commander";
|
|
19
|
+
import { existsSync } from "fs";
|
|
20
|
+
import { CONFIG_FILE } from "./config.js";
|
|
21
|
+
import { getHelpHeader, printWelcome } from "./branding.js";
|
|
19
22
|
import { registerAuthCommand } from "./commands/auth.js";
|
|
20
23
|
import { registerPublishCommand } from "./commands/publish.js";
|
|
21
24
|
import { registerConfigCommand } from "./commands/config.js";
|
|
@@ -24,7 +27,8 @@ const program = new Command();
|
|
|
24
27
|
program
|
|
25
28
|
.name("cv")
|
|
26
29
|
.description("CareerVivid CLI — publish articles, diagrams, and portfolio updates from your terminal or AI agent")
|
|
27
|
-
.version("1.1.
|
|
30
|
+
.version("1.1.5", "-v, --version", "Print CLI version")
|
|
31
|
+
.addHelpText("before", getHelpHeader())
|
|
28
32
|
.helpOption("-h, --help", "Show help");
|
|
29
33
|
registerAuthCommand(program);
|
|
30
34
|
registerPublishCommand(program);
|
|
@@ -33,7 +37,21 @@ registerWhiteboardCommand(program);
|
|
|
33
37
|
// Shortcuts for whiteboard creation
|
|
34
38
|
registerNewCommand(program);
|
|
35
39
|
registerListTemplatesCommand(program);
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
+
// ── Execution ──────────────────────────────────────────────────────────────
|
|
41
|
+
async function main() {
|
|
42
|
+
// Show welcome screen if no config exists and no env var set
|
|
43
|
+
const isFirstRun = !existsSync(CONFIG_FILE) && !process.env.CV_API_KEY;
|
|
44
|
+
// Only show if running without arguments or just 'cv'
|
|
45
|
+
if (isFirstRun && process.argv.length <= 2) {
|
|
46
|
+
printWelcome();
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
try {
|
|
50
|
+
await program.parseAsync(process.argv);
|
|
51
|
+
}
|
|
52
|
+
catch (err) {
|
|
53
|
+
console.error(`\nFatal error: ${err.message}`);
|
|
54
|
+
process.exit(1);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
main();
|
package/dist/output.d.ts
CHANGED
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Output helpers — pretty-print (human) vs --json (machine) modes.
|
|
3
|
-
*
|
|
4
|
-
* Every command receives an `opts.json` flag. Pass it through to these helpers
|
|
5
|
-
* to ensure consistent behaviour across human and agent callers.
|
|
6
|
-
*/
|
|
7
1
|
import type { ApiError } from "./api.js";
|
|
8
2
|
export declare function printSuccess(fields: Record<string, string>, jsonMode: boolean): void;
|
|
9
3
|
export declare function printError(message: string, fields?: {
|
package/dist/output.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"output.d.ts","sourceRoot":"","sources":["../src/output.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"output.d.ts","sourceRoot":"","sources":["../src/output.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAKzC,wBAAgB,YAAY,CACxB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAC9B,QAAQ,EAAE,OAAO,GAClB,IAAI,CAqBN;AAED,wBAAgB,UAAU,CACtB,OAAO,EAAE,MAAM,EACf,MAAM,CAAC,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,EAAE,EAC7C,QAAQ,UAAQ,GACjB,IAAI,CAeN;AAED,wBAAgB,SAAS,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,GAAG,IAAI,CAIlE;AAED,wBAAgB,UAAU,CACtB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,EAC9B,QAAQ,EAAE,OAAO,GAClB,IAAI,CAcN;AAED,wBAAgB,cAAc,CAAC,GAAG,EAAE,QAAQ,EAAE,QAAQ,EAAE,OAAO,GAAG,KAAK,CAGtE"}
|
package/dist/output.js
CHANGED
|
@@ -1,23 +1,24 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Output helpers — pretty-print (human) vs --json (machine) modes.
|
|
3
|
-
*
|
|
4
|
-
* Every command receives an `opts.json` flag. Pass it through to these helpers
|
|
5
|
-
* to ensure consistent behaviour across human and agent callers.
|
|
6
|
-
*/
|
|
7
1
|
import chalk from "chalk";
|
|
2
|
+
import boxen from "boxen";
|
|
3
|
+
import { COLORS } from "./branding.js";
|
|
8
4
|
// ── Output helpers ─────────────────────────────────────────────────────────────
|
|
9
5
|
export function printSuccess(fields, jsonMode) {
|
|
10
6
|
if (jsonMode) {
|
|
11
7
|
console.log(JSON.stringify({ success: true, ...fields }));
|
|
12
8
|
return;
|
|
13
9
|
}
|
|
14
|
-
|
|
15
|
-
console.log(` ${chalk.green("✔")} ${chalk.bold("Success!")}`);
|
|
16
|
-
console.log();
|
|
10
|
+
let content = "";
|
|
17
11
|
for (const [label, value] of Object.entries(fields)) {
|
|
18
|
-
|
|
12
|
+
content += `${chalk.dim(label.padEnd(12))} ${chalk.cyan(value)}\n`;
|
|
19
13
|
}
|
|
20
|
-
console.log()
|
|
14
|
+
console.log(boxen(content.trim(), {
|
|
15
|
+
padding: 1,
|
|
16
|
+
margin: { top: 1, bottom: 1 },
|
|
17
|
+
borderStyle: "round",
|
|
18
|
+
borderColor: COLORS.success,
|
|
19
|
+
title: chalk.bold.green(" ✔ Success "),
|
|
20
|
+
titleAlignment: "left",
|
|
21
|
+
}));
|
|
21
22
|
}
|
|
22
23
|
export function printError(message, fields, jsonMode = false) {
|
|
23
24
|
if (jsonMode) {
|
|
@@ -25,7 +26,7 @@ export function printError(message, fields, jsonMode = false) {
|
|
|
25
26
|
return;
|
|
26
27
|
}
|
|
27
28
|
console.error();
|
|
28
|
-
console.error(` ${chalk.red("✖")} ${chalk.bold("Error:")} ${message}`);
|
|
29
|
+
console.error(` ${chalk.red("✖")} ${chalk.bold.red("Error:")} ${message}`);
|
|
29
30
|
if (fields && fields.length > 0) {
|
|
30
31
|
console.error();
|
|
31
32
|
for (const f of fields) {
|
|
@@ -36,7 +37,7 @@ export function printError(message, fields, jsonMode = false) {
|
|
|
36
37
|
}
|
|
37
38
|
export function printInfo(message, jsonMode) {
|
|
38
39
|
if (!jsonMode) {
|
|
39
|
-
console.log(` ${chalk.blue("ℹ")} ${message}`);
|
|
40
|
+
console.log(` ${chalk.blue("ℹ")} ${chalk.dim(message)}`);
|
|
40
41
|
}
|
|
41
42
|
}
|
|
42
43
|
export function printTable(rows, jsonMode) {
|
|
@@ -44,12 +45,15 @@ export function printTable(rows, jsonMode) {
|
|
|
44
45
|
console.log(JSON.stringify(rows));
|
|
45
46
|
return;
|
|
46
47
|
}
|
|
48
|
+
console.log();
|
|
47
49
|
for (const row of rows) {
|
|
50
|
+
let line = " ";
|
|
48
51
|
for (const [k, v] of Object.entries(row)) {
|
|
49
|
-
|
|
52
|
+
line += `${chalk.dim(k + ":")} ${chalk.white(v)} `;
|
|
50
53
|
}
|
|
51
|
-
console.log();
|
|
54
|
+
console.log(line);
|
|
52
55
|
}
|
|
56
|
+
console.log();
|
|
53
57
|
}
|
|
54
58
|
export function handleApiError(err, jsonMode) {
|
|
55
59
|
printError(err.message, err.fields, jsonMode);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "careervivid",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.5",
|
|
4
4
|
"description": "Official CLI for CareerVivid — publish articles, diagrams, and portfolio updates from your terminal or AI agent",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -20,9 +20,11 @@
|
|
|
20
20
|
"prepublishOnly": "npm run build"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
+
"boxen": "^8.0.1",
|
|
23
24
|
"chalk": "^5.3.0",
|
|
24
25
|
"commander": "^12.1.0",
|
|
25
26
|
"enquirer": "^2.4.1",
|
|
27
|
+
"gradient-string": "^3.0.0",
|
|
26
28
|
"ora": "^8.1.0"
|
|
27
29
|
},
|
|
28
30
|
"devDependencies": {
|