careervivid 1.1.0 → 1.1.2

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.
Files changed (3) hide show
  1. package/README.md +240 -102
  2. package/dist/index.js +1 -1
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -1,189 +1,327 @@
1
- # CareerVivid CLI
1
+ # careervivid · CLI
2
2
 
3
- Official command-line interface for [CareerVivid](https://careervivid.app) — publish articles, architecture diagrams, and portfolio updates directly from your terminal or an AI coding agent.
3
+ > **Publish technical articles, architecture diagrams, and portfolio updates to [CareerVivid](https://careervivid.app) — directly from your terminal or AI agent.**
4
+
5
+ [![npm version](https://img.shields.io/npm/v/careervivid?color=0ea5e9&label=careervivid)](https://www.npmjs.com/package/careervivid)
6
+ [![License: MIT](https://img.shields.io/badge/license-MIT-brightgreen)](LICENSE)
7
+ [![Node ≥18](https://img.shields.io/badge/node-%3E%3D18-blue)](https://nodejs.org)
4
8
 
5
9
  ---
6
10
 
7
- ## Quick Start
11
+ ## Table of Contents
8
12
 
9
- ```bash
10
- npm install -g careervivid
11
- cv auth set-key
12
- cv publish article.md
13
- ```
13
+ - [Quick Start](#quick-start)
14
+ - [Commands](#commands)
15
+ - [cv publish](#cv-publish)
16
+ - [cv whiteboard](#cv-whiteboard)
17
+ - [cv auth](#cv-auth)
18
+ - [cv config](#cv-config)
19
+ - [Whiteboard Templates](#whiteboard-templates)
20
+ - [AI Agent Integration](#ai-agent-integration)
21
+ - [Updating](#updating)
22
+ - [Troubleshooting](#troubleshooting)
14
23
 
15
24
  ---
16
25
 
17
- ## Installation
26
+ ## Quick Start
18
27
 
19
28
  ```bash
20
- # Global install (recommended)
29
+ # 1. Install globally
21
30
  npm install -g careervivid
22
31
 
23
- # Project-local (for CI/CD and AI agents)
24
- npm install --save-dev careervivid
25
- npx cv publish article.md
26
- ```
32
+ # 2. Save your API key (get it at careervivid.app/developer)
33
+ cv auth set-key cv_live_YOUR_KEY_HERE
27
34
 
28
- ---
35
+ # 3. Publish an article
36
+ cv publish my-article.md --tags "typescript,react"
29
37
 
30
- ## Authentication
38
+ # 4. Create & publish an architecture diagram
39
+ cv whiteboard new my-arch --template system-arch
40
+ cv whiteboard publish my-arch.mmd --title "System Architecture"
41
+ ```
31
42
 
32
- Get your API key at [careervivid.app/#/developer](https://careervivid.app/#/developer).
43
+ ---
33
44
 
34
- ```bash
35
- # Interactive setup
36
- cv auth set-key
45
+ ## Commands
37
46
 
38
- # Or pass directly (no prompts)
39
- cv auth set-key cv_live_your_key_here
47
+ ### `cv publish`
40
48
 
41
- # Verify it works
42
- cv auth check
49
+ Publish a Markdown article or Mermaid diagram file to your CareerVivid portfolio.
43
50
 
44
- # See current config
45
- cv auth whoami
46
51
  ```
52
+ cv publish <file> [options]
53
+ cv publish - (read from stdin)
54
+ ```
55
+
56
+ | Option | Description |
57
+ |---|---|
58
+ | `-t, --title <title>` | Post title (auto-inferred from first `#` heading if omitted) |
59
+ | `--type <type>` | `article` \| `whiteboard` (auto-inferred from file extension) |
60
+ | `--format <format>` | `markdown` \| `mermaid` (auto-inferred from file extension) |
61
+ | `--tags <tags>` | Comma-separated tags, e.g. `typescript,firebase,react` |
62
+ | `--cover <url>` | URL to a cover image |
63
+ | `--dry-run` | Validate payload without publishing |
64
+ | `--json` | Machine-readable JSON output (ideal for AI agents) |
47
65
 
48
- Your key is stored in `~/.careervividrc.json` with `chmod 600` permissions. It is never printed to stdout.
66
+ **Examples:**
49
67
 
50
- **Alternatively**, set the `CV_API_KEY` environment variable (takes priority over the config file):
51
68
  ```bash
52
- export CV_API_KEY=cv_live_...
69
+ # Publish a Markdown article (title auto-detected from # heading)
70
+ cv publish article.md
71
+
72
+ # Publish with tags and a custom title
73
+ cv publish article.md --title "How I Built a CLI in TypeScript" --tags "node,typescript,cli"
74
+
75
+ # Publish a Mermaid diagram as a whiteboard
76
+ cv publish architecture.mmd --title "System Architecture"
77
+
78
+ # Pipe from stdin — perfect for AI agents
79
+ cat writeup.md | cv publish - --title "Architecture Breakdown" --json
80
+
81
+ # Dry-run to validate before publishing
82
+ cv publish article.md --dry-run
53
83
  ```
54
84
 
55
85
  ---
56
86
 
57
- ## Publishing Content
87
+ ### `cv whiteboard`
58
88
 
59
- ### Publish a Markdown article
89
+ Create and publish **Mermaid architecture diagrams** without any extra packages. All templates are built into the `careervivid` CLI.
60
90
 
61
- ```bash
62
- cv publish article.md
63
- cv publish article.md --title "My Custom Title" --tags "typescript,firebase,saas"
64
- ```
91
+ #### `cv whiteboard new`
65
92
 
66
- The title is automatically inferred from the first `# Heading` in your file.
93
+ Scaffold a new `.mmd` diagram file from a built-in template.
67
94
 
68
- ### Publish a Mermaid diagram
95
+ ```
96
+ cv whiteboard new [filename] [options]
97
+ ```
98
+
99
+ | Option | Description |
100
+ |---|---|
101
+ | `--template <name>` | Template to use (see [Whiteboard Templates](#whiteboard-templates)) |
102
+ | `--print` | Print the template to stdout instead of writing a file |
69
103
 
70
104
  ```bash
71
- cv publish diagram.mmd --type whiteboard
105
+ # Interactive wizard picks template and filename for you
106
+ cv whiteboard new
107
+
108
+ # Non-interactive — specify template and filename directly
109
+ cv whiteboard new my-diagram --template system-arch
110
+
111
+ # Preview a template without creating any file
112
+ cv whiteboard new --template ci-cd --print
72
113
  ```
73
114
 
74
- Files with `.mmd` or `.mermaid` extensions are automatically detected as Mermaid diagrams.
115
+ #### `cv whiteboard publish`
116
+
117
+ Publish an existing `.mmd` file as a whiteboard post.
118
+
119
+ ```
120
+ cv whiteboard publish <file> [options]
121
+ ```
75
122
 
76
- ### Publish from stdin (pipe-friendly for AI agents)
123
+ | Option | Description |
124
+ |---|---|
125
+ | `-t, --title <title>` | Diagram title (required) |
126
+ | `--tags <tags>` | Comma-separated tags |
127
+ | `--dry-run` | Validate without publishing |
128
+ | `--json` | Machine-readable JSON output |
77
129
 
78
130
  ```bash
79
- cat article.md | cv publish - --title "Architecture Deep Dive"
80
- echo "# My Post\n\nHello world!" | cv publish - --tags "ai,demo"
131
+ cv whiteboard publish my-diagram.mmd --title "CI/CD Pipeline" --tags "devops,cicd"
81
132
  ```
82
133
 
83
- ### Dry run (validate without publishing)
134
+ #### `cv whiteboard list-templates`
135
+
136
+ Print all available built-in Mermaid templates.
84
137
 
85
138
  ```bash
86
- cv publish article.md --dry-run
139
+ cv whiteboard list-templates
87
140
  ```
88
141
 
89
- ### Machine-readable JSON output (for AI agents and scripts)
142
+ ---
143
+
144
+ ### `cv auth`
90
145
 
91
- Every command supports `--json`:
146
+ Manage your CareerVivid API key. Get your key at [careervivid.app/developer](https://careervivid.app/developer).
147
+
148
+ | Subcommand | Description |
149
+ |---|---|
150
+ | `cv auth set-key <key>` | Save your API key to `~/.careervividrc.json` |
151
+ | `cv auth check` | Verify that your saved key is valid |
152
+ | `cv auth remove` | Remove the saved key |
153
+ | `cv auth whoami` | Show the currently authenticated user |
154
+
155
+ The key is stored at `~/.careervividrc.json` with `chmod 600` permissions. You can also pass the key via the `CV_API_KEY` environment variable instead of saving it locally.
92
156
 
93
157
  ```bash
94
- cv publish article.md --json
95
- # {"success":true,"postId":"abc123","url":"https://careervivid.app/community/post/abc123"}
158
+ # Save key
159
+ cv auth set-key cv_live_YOUR_KEY_HERE
96
160
 
97
- cat article.md | cv publish - --title "Post" --json
98
- # {"success":true,"postId":"abc123","url":"..."}
161
+ # Verify
162
+ cv auth check
163
+ # ✔ Authenticated as Jiawen Zhu (jiawen@careervivid.app)
164
+
165
+ # Use env var instead of a saved key
166
+ CV_API_KEY=cv_live_YOUR_KEY_HERE cv publish article.md
99
167
  ```
100
168
 
101
169
  ---
102
170
 
103
- ## Command Reference
171
+ ### `cv config`
104
172
 
105
- ```
106
- cv publish [file]
107
- [file] Path to a .md / .mmd file, or "-" to read stdin
108
- --title <title> Post title (required for stdin / if no # heading)
109
- --type article | whiteboard (default: inferred)
110
- --format markdown | mermaid (default: inferred from extension)
111
- --tags <tags> Comma-separated tags, max 5
112
- --cover <url> URL to a cover image
113
- --dry-run Validate without publishing
114
- --json Machine-readable output
173
+ View and modify CLI configuration stored at `~/.careervividrc.json`.
115
174
 
116
- cv auth set-key [apiKey]
117
- cv auth check
118
- cv auth whoami
119
- cv auth revoke
175
+ | Subcommand | Description |
176
+ |---|---|
177
+ | `cv config show` | Print the full config |
178
+ | `cv config get <key>` | Print a single config value |
179
+ | `cv config set <key> <value>` | Update a config value |
120
180
 
181
+ ```bash
121
182
  cv config show
122
- cv config get <key> (keys: apiKey, apiUrl)
123
- cv config set <key> <val>
183
+ cv config get apiKey
184
+ cv config set apiUrl https://careervivid.app/api/publish
124
185
  ```
125
186
 
126
187
  ---
127
188
 
128
- ## AI Agent & MCP Integration
189
+ ## Whiteboard Templates
129
190
 
130
- ### With Cursor / Claude Desktop (MCP)
191
+ Run `cv whiteboard list-templates` to see all templates. Available out of the box:
131
192
 
132
- The [MCP server](../mcp-server/) is the recommended way to integrate with AI coding agents. See `mcp-server/README.md`.
193
+ | Template | Description |
194
+ |---|---|
195
+ | `flowchart` | Generic flowchart / process diagram |
196
+ | `system-arch` | System architecture (client → API → DB) |
197
+ | `tech-stack` | Full technology stack diagram |
198
+ | `user-journey` | Sequence diagram (user ↔ API ↔ DB) |
199
+ | `er-diagram` | Entity-relationship / database schema |
200
+ | `git-flow` | Git branching and release flow |
201
+ | `ci-cd` | CI/CD pipeline (lint → test → build → deploy) |
202
+ | `mindmap` | Mind map / concept breakdown |
133
203
 
134
- ### Direct CLI from an AI agent
204
+ **Workflow:**
135
205
 
136
206
  ```bash
137
- # Agent publishes an article it just wrote:
138
- echo "${ARTICLE_CONTENT}" | cv publish - \
139
- --title "${TITLE}" \
140
- --tags "${TAGS}" \
141
- --json
207
+ # 1. Pick a template and scaffold the file
208
+ cv whiteboard new my-pipeline --template ci-cd
142
209
 
143
- # Agent parses the JSON response:
144
- # {"success":true,"postId":"abc123","url":"https://careervivid.app/community/post/abc123"}
145
- ```
210
+ # 2. Edit it in your editor (or let your AI agent edit it)
211
+ code my-pipeline.mmd
146
212
 
147
- For full agentic pipelines, prefer the MCP server — it integrates natively with AI tool calling.
213
+ # 3. Publish to CareerVivid
214
+ cv whiteboard publish my-pipeline.mmd --title "Our CI/CD Pipeline"
215
+ # ✔ Whiteboard published!
216
+ # URL: https://careervivid.app/community/post/abc123
217
+ ```
148
218
 
149
219
  ---
150
220
 
151
- ## Environment Variables
221
+ ## AI Agent Integration
222
+
223
+ The CLI is designed to be **AI-agent-friendly**. Use `--json` for structured output and pipe from stdin for fully automated publishing flows.
152
224
 
153
- | Variable | Description |
154
- |----------|-------------|
155
- | `CV_API_KEY` | API key (overrides config file) |
156
- | `CV_API_URL` | Override the publish endpoint (for self-hosting or staging) |
225
+ ### Copy this into your AI agent's system prompt:
226
+
227
+ ```
228
+ # CareerVivid AI Publishing Rules
229
+
230
+ You are an expert technical writer and senior software architect.
231
+ Your secondary directive — after writing and fixing code — is to
232
+ proactively help the user document their work and build their
233
+ CareerVivid portfolio using the local `cv` CLI.
234
+
235
+ ## 1. Triggers (When to Propose a Post)
236
+ Do not wait for the user to ask. Propose a CareerVivid post when:
237
+ - You complete a significant feature, module, or architecture.
238
+ - You perform a complex refactor or solve a difficult bug.
239
+ - The user says "document this" or "publish to CareerVivid".
240
+
241
+ ## 2. Security (CRITICAL)
242
+ - NEVER include actual API keys, secrets, or internal IPs.
243
+ - Replace sensitive values with placeholder variables.
244
+
245
+ ## 3. Content Format
246
+ - Architecture / data flows → Mermaid diagram (.mmd)
247
+ - Tutorials / devlogs → Markdown article (.md)
248
+
249
+ ## 4. Consent Gate (DO NOT SKIP)
250
+ 1. Generate and save the file locally.
251
+ 2. Tell the user: "I drafted a CareerVivid post. Review and confirm."
252
+ 3. Wait for explicit confirmation before running cv publish.
253
+
254
+ ## 5. CLI Commands
255
+ cv publish ./article.md --title "Title" --json
256
+ cv whiteboard publish ./diagram.mmd --title "Diagram" --json
257
+ ```
258
+
259
+ ### Cursor / Claude Desktop (MCP)
260
+
261
+ For deeper integration using the Model Context Protocol, see the [Integration Guide](https://careervivid.app/developer) on your Developer Settings page.
262
+
263
+ ### Automated Pipeline Example
264
+
265
+ ```bash
266
+ # Generate markdown from your AI agent and publish directly
267
+ echo "# My Architecture\n\nExplains the new service..." \
268
+ | cv publish - --title "New Service Explained" --tags "architecture" --json
269
+
270
+ # Output:
271
+ # { "postId": "abc123", "url": "https://careervivid.app/community/post/abc123" }
272
+ ```
157
273
 
158
274
  ---
159
275
 
160
- ## Configuration File
276
+ ## Updating
277
+
278
+ ```bash
279
+ npm install -g careervivid
280
+ ```
161
281
 
162
- Location: `~/.careervividrc.json` (mode 600 — readable only by your user)
282
+ Check your current version:
163
283
 
164
- ```json
165
- {
166
- "apiKey": "cv_live_...",
167
- "apiUrl": "https://careervivid.app/api/publish"
168
- }
284
+ ```bash
285
+ cv -v
169
286
  ```
170
287
 
171
288
  ---
172
289
 
173
- ## Building from Source
290
+ ## Troubleshooting
291
+
292
+ **`cv: command not found`**
293
+ ```bash
294
+ # Check npm global bin is in your PATH
295
+ npm config get prefix
296
+ # Add <prefix>/bin to your PATH in ~/.zshrc or ~/.bashrc
297
+ ```
298
+
299
+ **`Unauthorized` error**
300
+ ```bash
301
+ # Re-check your key is saved correctly
302
+ cv auth check
303
+
304
+ # Or set it directly via env var
305
+ CV_API_KEY=cv_live_YOUR_KEY cv publish article.md
306
+ ```
174
307
 
308
+ **Permission denied on `~/.careervividrc.json`**
175
309
  ```bash
176
- git clone https://github.com/Jastalk/CareerVivid
177
- cd CareerVivid/cli
178
- npm install && npm run build
179
- npm install -g .
310
+ chmod 600 ~/.careervividrc.json
180
311
  ```
181
312
 
313
+ **Mermaid diagram not rendering**
314
+ Run `cv whiteboard new --template flowchart --print` to validate your Mermaid syntax against a known-good example. The CareerVivid web app renders Mermaid live in the post detail view.
315
+
182
316
  ---
183
317
 
184
- ## Security
318
+ ## Resources
319
+
320
+ - 🌐 [careervivid.app](https://careervivid.app)
321
+ - 🔑 [Developer Settings & API Key](https://careervivid.app/developer)
322
+ - 🐛 [Report an Issue](https://github.com/Jastalk/CareerVivid/issues)
323
+ - 📦 [npm Package](https://www.npmjs.com/package/careervivid)
324
+
325
+ ---
185
326
 
186
- - API keys are **never** written to `stdout` — only `stderr` diagnostics and masked previews
187
- - The config file is created with `chmod 600`
188
- - Never commit `~/.careervividrc.json` or `CV_API_KEY` to version control
189
- - Revoke a compromised key immediately at [careervivid.app/#/developer](https://careervivid.app/#/developer)
327
+ MIT License © CareerVivid
package/dist/index.js CHANGED
@@ -24,7 +24,7 @@ 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.0", "-v, --version", "Print CLI version")
27
+ .version("1.1.2", "-v, --version", "Print CLI version")
28
28
  .helpOption("-h, --help", "Show help");
29
29
  registerAuthCommand(program);
30
30
  registerPublishCommand(program);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "careervivid",
3
- "version": "1.1.0",
3
+ "version": "1.1.2",
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": {