careervivid 1.1.2 → 1.1.3

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.
@@ -8,5 +8,7 @@
8
8
  * cv whiteboard list-templates List all available diagram templates
9
9
  */
10
10
  import { Command } from "commander";
11
+ export declare function registerNewCommand(program: Command | any): void;
12
+ export declare function registerListTemplatesCommand(program: Command | any): void;
11
13
  export declare function registerWhiteboardCommand(program: Command): void;
12
14
  //# sourceMappingURL=whiteboard.d.ts.map
@@ -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;AAkNpC,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CA8IhE"}
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;AAkNpC,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,OAAO,GAAG,GAAG,GAAG,IAAI,CA6D/D;AAED,wBAAgB,4BAA4B,CAAC,OAAO,EAAE,OAAO,GAAG,GAAG,GAAG,IAAI,CAMzE;AAED,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAkFhE"}
@@ -198,12 +198,8 @@ async function promptInteractive() {
198
198
  return { name: name.trim() || `my-${template}`, template };
199
199
  }
200
200
  // ── Command Registration ──────────────────────────────────────────────────────
201
- export function registerWhiteboardCommand(program) {
202
- const wb = program
203
- .command("whiteboard")
204
- .description("Create and publish Mermaid diagram whiteboards to CareerVivid");
205
- // ── cv whiteboard new ─────────────────────────────────────────────────────
206
- wb.command("new [filename]")
201
+ export function registerNewCommand(program) {
202
+ program.command("new [filename]")
207
203
  .description("Scaffold a new Mermaid diagram file from a built-in template")
208
204
  .option("--template <name>", `Template to use (${TEMPLATE_NAMES.join(" | ")})`)
209
205
  .option("--print", "Print the template to stdout instead of writing a file")
@@ -211,7 +207,7 @@ export function registerWhiteboardCommand(program) {
211
207
  let templateKey;
212
208
  let filename;
213
209
  if (opts.template && !TEMPLATES[opts.template]) {
214
- printError(`Unknown template "${opts.template}". Run ${chalk.cyan("cv whiteboard list-templates")} to see available options.`);
210
+ printError(`Unknown template "${opts.template}". Run ${chalk.cyan("cv list-templates")} to see available options.`);
215
211
  process.exit(1);
216
212
  }
217
213
  if (opts.template && filenameArg) {
@@ -250,6 +246,22 @@ export function registerWhiteboardCommand(program) {
250
246
  console.log(` 2. Publish it: ${chalk.cyan(`cv publish ${filename} --title "Your Diagram Title"`)}`);
251
247
  console.log();
252
248
  });
249
+ }
250
+ export function registerListTemplatesCommand(program) {
251
+ program.command("list-templates")
252
+ .description("List all available Mermaid diagram templates")
253
+ .action(() => {
254
+ printTemplateList();
255
+ });
256
+ }
257
+ export function registerWhiteboardCommand(program) {
258
+ const wb = program
259
+ .command("whiteboard")
260
+ .description("Create and publish Mermaid diagram whiteboards to CareerVivid");
261
+ // ── cv whiteboard new ─────────────────────────────────────────────────────
262
+ registerNewCommand(wb);
263
+ // ── cv whiteboard publish ─────────────────────────────────────────────────
264
+ wb.command("publish <file>");
253
265
  // ── cv whiteboard publish ─────────────────────────────────────────────────
254
266
  wb.command("publish <file>")
255
267
  .description("Publish a .mmd file to CareerVivid as a whiteboard post")
@@ -306,9 +318,5 @@ export function registerWhiteboardCommand(program) {
306
318
  }, jsonMode);
307
319
  });
308
320
  // ── cv whiteboard list-templates ──────────────────────────────────────────
309
- wb.command("list-templates")
310
- .description("List all available Mermaid diagram templates")
311
- .action(() => {
312
- printTemplateList();
313
- });
321
+ registerListTemplatesCommand(wb);
314
322
  }
package/dist/index.js CHANGED
@@ -19,17 +19,20 @@ import { Command } from "commander";
19
19
  import { registerAuthCommand } from "./commands/auth.js";
20
20
  import { registerPublishCommand } from "./commands/publish.js";
21
21
  import { registerConfigCommand } from "./commands/config.js";
22
- import { registerWhiteboardCommand } from "./commands/whiteboard.js";
22
+ import { registerWhiteboardCommand, registerNewCommand, registerListTemplatesCommand, } from "./commands/whiteboard.js";
23
23
  const program = new Command();
24
24
  program
25
25
  .name("cv")
26
26
  .description("CareerVivid CLI — publish articles, diagrams, and portfolio updates from your terminal or AI agent")
27
- .version("1.1.2", "-v, --version", "Print CLI version")
27
+ .version("1.1.3", "-v, --version", "Print CLI version")
28
28
  .helpOption("-h, --help", "Show help");
29
29
  registerAuthCommand(program);
30
30
  registerPublishCommand(program);
31
31
  registerConfigCommand(program);
32
32
  registerWhiteboardCommand(program);
33
+ // Shortcuts for whiteboard creation
34
+ registerNewCommand(program);
35
+ registerListTemplatesCommand(program);
33
36
  program.parseAsync(process.argv).catch((err) => {
34
37
  console.error(`\nFatal error: ${err.message}`);
35
38
  process.exit(1);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "careervivid",
3
- "version": "1.1.2",
3
+ "version": "1.1.3",
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": {