vertex-notes 0.1.4 → 0.2.1
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/{chunk-4QLCD6TZ.js → chunk-EEEL6ZKK.js} +378 -43
- package/dist/chunk-EEEL6ZKK.js.map +1 -0
- package/dist/{chunk-DDFOKGIX.js → chunk-URRSVCB7.js} +2 -2
- package/dist/commands/capture.js +2 -2
- package/dist/commands/daily.js +2 -2
- package/dist/commands/delete.js +2 -2
- package/dist/commands/edit.js +3 -5
- package/dist/commands/edit.js.map +1 -1
- package/dist/commands/export.js +2 -2
- package/dist/commands/hello.js +1 -1
- package/dist/commands/help.js +23 -14
- package/dist/commands/help.js.map +1 -1
- package/dist/commands/howto.js +379 -0
- package/dist/commands/howto.js.map +1 -0
- package/dist/commands/import.js +39 -0
- package/dist/commands/import.js.map +1 -0
- package/dist/commands/interactive.js +187 -74
- package/dist/commands/interactive.js.map +1 -1
- package/dist/commands/login.js +1 -1
- package/dist/commands/new.js +2 -2
- package/dist/commands/notes.js +2 -2
- package/dist/commands/restore.js +2 -2
- package/dist/commands/search.js +2 -2
- package/dist/commands/status.js +2 -2
- package/dist/commands/syntax.js +276 -0
- package/dist/commands/syntax.js.map +1 -0
- package/dist/commands/tags.js +2 -2
- package/dist/commands/today.js +2 -2
- package/dist/commands/trash/empty.js +2 -2
- package/dist/commands/trash/index.js +2 -2
- package/dist/commands/view.js +2 -2
- package/dist/lib/client.js +2 -2
- package/dist/lib/md-to-tiptap.js +245 -3
- package/dist/lib/md-to-tiptap.js.map +1 -1
- package/package.json +2 -1
- package/dist/chunk-4QLCD6TZ.js.map +0 -1
- package/dist/chunk-FWK2J3FR.js +0 -163
- package/dist/chunk-FWK2J3FR.js.map +0 -1
- /package/dist/{chunk-DDFOKGIX.js.map → chunk-URRSVCB7.js.map} +0 -0
|
@@ -0,0 +1,379 @@
|
|
|
1
|
+
// src/commands/howto.ts
|
|
2
|
+
import { Command } from "@oclif/core";
|
|
3
|
+
var D = "\x1B[90m";
|
|
4
|
+
var B = "\x1B[1m";
|
|
5
|
+
var C = "\x1B[36m";
|
|
6
|
+
var Y = "\x1B[33m";
|
|
7
|
+
var G = "\x1B[32m";
|
|
8
|
+
var P = "\x1B[35m";
|
|
9
|
+
var R = "\x1B[0m";
|
|
10
|
+
var Howto = class extends Command {
|
|
11
|
+
static description = "Complete guide for AI agents to create and manage Vertex notes";
|
|
12
|
+
async run() {
|
|
13
|
+
this.log(`
|
|
14
|
+
${B}${P} Vertex \u2014 Complete AI Guide${R}
|
|
15
|
+
${D} Everything an AI agent needs to create, edit, and manage notes.${R}
|
|
16
|
+
${D} Read this once, then you can do anything in Vertex.${R}
|
|
17
|
+
${D} \u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550${R}
|
|
18
|
+
|
|
19
|
+
${C}${B} 1. WHAT IS VERTEX?${R}
|
|
20
|
+
${D} A knowledge workspace. Notes are stored in the cloud (Supabase).${R}
|
|
21
|
+
${D} You write markdown in the terminal \u2192 it renders as rich content${R}
|
|
22
|
+
${D} (diagrams, math, code, callouts) in the web app.${R}
|
|
23
|
+
${D} Notes can link to each other via [[wiki links]] and #tags.${R}
|
|
24
|
+
|
|
25
|
+
${C}${B} 2. HOW TO CREATE A NOTE${R}
|
|
26
|
+
|
|
27
|
+
${D} Option A: Create and edit in one step${R}
|
|
28
|
+
${G}vertex new "My Note Title"${R}
|
|
29
|
+
${G}vertex edit "My Note"${R} ${D}\u2190 opens in $EDITOR (vim/nano/code)${R}
|
|
30
|
+
|
|
31
|
+
${D} Option B: Write a .md file, then import${R}
|
|
32
|
+
${G}cat > note.md << 'EOF'${R}
|
|
33
|
+
${Y}# My Note Title${R}
|
|
34
|
+
${Y}Content here...${R}
|
|
35
|
+
${G}EOF${R}
|
|
36
|
+
${G}vertex import note.md -t "My Note Title"${R}
|
|
37
|
+
|
|
38
|
+
${D} Option C: Quick one-liner to inbox${R}
|
|
39
|
+
${G}vertex capture "Remember to review PR #42"${R}
|
|
40
|
+
|
|
41
|
+
${C}${B} 3. HOW TO EDIT AN EXISTING NOTE${R}
|
|
42
|
+
|
|
43
|
+
${G}vertex edit "Note Title"${R} ${D}\u2190 partial match works: "Note" matches "Note Title"${R}
|
|
44
|
+
${D} This exports the note as markdown, opens your $EDITOR,${R}
|
|
45
|
+
${D} and when you save & quit, it parses the markdown back${R}
|
|
46
|
+
${D} and updates the note in the database.${R}
|
|
47
|
+
|
|
48
|
+
${D} To use a specific editor:${R}
|
|
49
|
+
${G}EDITOR=nano vertex edit "My Note"${R}
|
|
50
|
+
${G}EDITOR="code --wait" vertex edit "My Note"${R}
|
|
51
|
+
${G}EDITOR=vim vertex edit "My Note"${R}
|
|
52
|
+
|
|
53
|
+
${C}${B} 4. HOW TO VIEW A NOTE (read-only)${R}
|
|
54
|
+
|
|
55
|
+
${G}vertex view "Note Title"${R} ${D}\u2190 prints markdown to stdout${R}
|
|
56
|
+
${G}vertex view "Note" | less${R} ${D}\u2190 paginated view${R}
|
|
57
|
+
${G}vertex export "Note" -o note.md${R} ${D}\u2190 save to file${R}
|
|
58
|
+
|
|
59
|
+
${C}${B} 5. HOW TO LIST AND FIND NOTES${R}
|
|
60
|
+
|
|
61
|
+
${G}vertex notes${R} ${D}\u2190 list all notes${R}
|
|
62
|
+
${G}vertex search "keyword"${R} ${D}\u2190 full-text search${R}
|
|
63
|
+
${G}vertex search "#tagname"${R} ${D}\u2190 search by tag${R}
|
|
64
|
+
${G}vertex search "type:todo status:open"${R} ${D}\u2190 find open todos${R}
|
|
65
|
+
${G}vertex tags${R} ${D}\u2190 list all tags${R}
|
|
66
|
+
${G}vertex daily --last${R} ${D}\u2190 view latest daily note${R}
|
|
67
|
+
|
|
68
|
+
${D} \u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550${R}
|
|
69
|
+
|
|
70
|
+
${C}${B} 6. MARKDOWN SYNTAX \u2014 ALL BLOCK TYPES${R}
|
|
71
|
+
|
|
72
|
+
${D} \u250C\u2500 IMPORTANT \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500${R}
|
|
73
|
+
${D} \u2502 Every block must be separated by a BLANK LINE.${R}
|
|
74
|
+
${D} \u2502 The first # H1 heading becomes the note title.${R}
|
|
75
|
+
${D} \u2502 Tags must start with a letter (a-z): #valid not #123${R}
|
|
76
|
+
${D} \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500${R}
|
|
77
|
+
|
|
78
|
+
${C} HEADINGS${R}
|
|
79
|
+
${Y} # Heading 1${R}
|
|
80
|
+
${Y} ## Heading 2${R}
|
|
81
|
+
${Y} ### Heading 3${R}
|
|
82
|
+
|
|
83
|
+
${C} TEXT FORMATTING${R}
|
|
84
|
+
${Y} **bold text**${R}
|
|
85
|
+
${Y} *italic text*${R}
|
|
86
|
+
${Y} \`inline code\`${R}
|
|
87
|
+
${Y} ~~strikethrough~~${R}
|
|
88
|
+
|
|
89
|
+
${C} BULLET LIST${R}
|
|
90
|
+
${Y} - Item one${R}
|
|
91
|
+
${Y} - Item two${R}
|
|
92
|
+
${Y} - Item three${R}
|
|
93
|
+
|
|
94
|
+
${C} NUMBERED LIST${R}
|
|
95
|
+
${Y} 1. First${R}
|
|
96
|
+
${Y} 2. Second${R}
|
|
97
|
+
${Y} 3. Third${R}
|
|
98
|
+
|
|
99
|
+
${C} TODO TASKS${R}
|
|
100
|
+
${Y} - [ ] Open task${R}
|
|
101
|
+
${Y} - [x] Completed task${R}
|
|
102
|
+
|
|
103
|
+
${C} BLOCKQUOTE${R}
|
|
104
|
+
${Y} > Quoted text here${R}
|
|
105
|
+
|
|
106
|
+
${C} DIVIDER${R}
|
|
107
|
+
${Y} ---${R}
|
|
108
|
+
|
|
109
|
+
${C} CODE BLOCK${R}
|
|
110
|
+
${Y} \`\`\`python${R}
|
|
111
|
+
${Y} def hello():${R}
|
|
112
|
+
${Y} print("Hello!")${R}
|
|
113
|
+
${Y} \`\`\`${R}
|
|
114
|
+
${D} Languages: python, javascript, typescript, rust, go, java,${R}
|
|
115
|
+
${D} c, cpp, sql, html, css, json, yaml, bash, ruby, swift, etc.${R}
|
|
116
|
+
|
|
117
|
+
${C} MERMAID DIAGRAM${R}
|
|
118
|
+
${Y} \`\`\`mermaid${R}
|
|
119
|
+
${Y} graph TD;${R}
|
|
120
|
+
${Y} A --> B --> C;${R}
|
|
121
|
+
${Y} \`\`\`${R}
|
|
122
|
+
${D} Types: graph/flowchart, sequenceDiagram, classDiagram,${R}
|
|
123
|
+
${D} erDiagram, stateDiagram, gantt, pie, gitGraph, mindmap${R}
|
|
124
|
+
|
|
125
|
+
${C} INLINE MATH${R}
|
|
126
|
+
${Y} The value $E = mc^2$ is inline.${R}
|
|
127
|
+
${Y} Solve $\\frac{-b \\pm \\sqrt{b^2-4ac}}{2a}$ for $x$.${R}
|
|
128
|
+
${D} Use single $ for inline math within text.${R}
|
|
129
|
+
|
|
130
|
+
${C} BLOCK MATH (LaTeX via KaTeX)${R}
|
|
131
|
+
${Y} $$${R}
|
|
132
|
+
${Y} E = mc^2${R}
|
|
133
|
+
${Y} $$${R}
|
|
134
|
+
${D} Use $$ on separate lines for standalone equations.${R}
|
|
135
|
+
${D} LaTeX: \\frac{a}{b} \\sqrt{x} \\sum_{i=1}^{n} \\int_0^1${R}
|
|
136
|
+
${D} \\alpha \\beta \\pi \\infty \\text{label} x^{2} x_{i}${R}
|
|
137
|
+
|
|
138
|
+
${C} CALLOUT${R}
|
|
139
|
+
${Y} > [!info]${R}
|
|
140
|
+
${Y} > Informational note${R}
|
|
141
|
+
${D} Variants: info, warning, error, tip${R}
|
|
142
|
+
${D} Multi-line: each line starts with > ${R}
|
|
143
|
+
|
|
144
|
+
${C} QUERY BLOCK${R}
|
|
145
|
+
${Y} > [!query]${R}
|
|
146
|
+
${Y} > type:todo status:open #work${R}
|
|
147
|
+
|
|
148
|
+
${C} INLINE LINK${R}
|
|
149
|
+
${Y} [Link Text](https://example.com)${R}
|
|
150
|
+
${D} Opens in new tab. Standard markdown link syntax.${R}
|
|
151
|
+
|
|
152
|
+
${C} EMBED (link preview)${R}
|
|
153
|
+
${Y} > [!embed]${R}
|
|
154
|
+
${Y} > https://youtube.com/watch?v=ID${R}
|
|
155
|
+
${D} YouTube \u2192 video player. Other URLs \u2192 preview card.${R}
|
|
156
|
+
|
|
157
|
+
${C} IMAGE${R}
|
|
158
|
+
${Y} ${R}
|
|
159
|
+
|
|
160
|
+
${C} FILE ATTACHMENT${R}
|
|
161
|
+
${Y} > [!file]${R}
|
|
162
|
+
${Y} > [filename.pdf](https://url.com/file.pdf)${R}
|
|
163
|
+
${Y} > application/pdf 149780${R}
|
|
164
|
+
|
|
165
|
+
${D} \u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550${R}
|
|
166
|
+
|
|
167
|
+
${C}${B} 7. WIKI LINKS \u2014 HOW TO CONNECT NOTES${R}
|
|
168
|
+
|
|
169
|
+
${D} Wiki links create connections between notes.${R}
|
|
170
|
+
${D} They render as clickable purple links in the web app.${R}
|
|
171
|
+
${D} The linked note shows a "backlink" at the bottom.${R}
|
|
172
|
+
|
|
173
|
+
${Y} Check out [[Project Roadmap]] for details.${R}
|
|
174
|
+
${Y} This connects to [[AI Research Notes]] and [[Meeting Notes]].${R}
|
|
175
|
+
|
|
176
|
+
${D} Rules:${R}
|
|
177
|
+
${D} \u2022 Use the exact note title inside [[ ]]${R}
|
|
178
|
+
${D} \u2022 Case-insensitive: [[my note]] matches "My Note"${R}
|
|
179
|
+
${D} \u2022 If the note doesn't exist yet, the link is still created${R}
|
|
180
|
+
${D} \u2022 Multiple links in one paragraph is fine${R}
|
|
181
|
+
${D} \u2022 Wiki links work in any text: paragraphs, todos, callouts${R}
|
|
182
|
+
|
|
183
|
+
${D} Example: Create a network of linked notes${R}
|
|
184
|
+
${G}vertex new "Hub Note"${R}
|
|
185
|
+
${G}vertex edit "Hub Note"${R}
|
|
186
|
+
${D} Then write:${R}
|
|
187
|
+
${Y} # Hub Note${R}
|
|
188
|
+
${Y} ${R}
|
|
189
|
+
${Y} This connects to:${R}
|
|
190
|
+
${Y} - [[Topic A]] \u2014 first topic${R}
|
|
191
|
+
${Y} - [[Topic B]] \u2014 second topic${R}
|
|
192
|
+
${Y} - [[Topic C]] \u2014 third topic${R}
|
|
193
|
+
|
|
194
|
+
${C}${B} 8. TAGS \u2014 HOW THEY WORK${R}
|
|
195
|
+
|
|
196
|
+
${D} Tags categorize content. They appear as purple pills in the web app.${R}
|
|
197
|
+
${D} Tags are auto-created when you use them \u2014 no need to create first.${R}
|
|
198
|
+
|
|
199
|
+
${C} Basic tags:${R}
|
|
200
|
+
${Y} This paragraph has #work and #important tags.${R}
|
|
201
|
+
${Y} - [x] Finish report #work #deadline${R}
|
|
202
|
+
|
|
203
|
+
${C} Rules:${R}
|
|
204
|
+
${D} \u2022 Must start with a letter: #valid, #tag123${R}
|
|
205
|
+
${D} \u2022 Can contain letters, numbers, hyphens, underscores: #my-tag, #my_tag${R}
|
|
206
|
+
${D} \u2022 NO spaces: #my tag is wrong \u2192 use #my-tag${R}
|
|
207
|
+
${D} \u2022 Tags are case-insensitive: #Work = #work${R}
|
|
208
|
+
${D} \u2022 Tags work everywhere: paragraphs, todos, headings, callouts${R}
|
|
209
|
+
|
|
210
|
+
${C}${B} 9. TAG HIERARCHY \u2014 PARENT/CHILD RELATIONSHIPS${R}
|
|
211
|
+
|
|
212
|
+
${D} Tags can have parent-child relationships using / separator.${R}
|
|
213
|
+
${D} This creates a DAG (directed acyclic graph) of tags.${R}
|
|
214
|
+
|
|
215
|
+
${Y} This is about #work/frontend${R} ${D}\u2190 creates: work \u2192 frontend${R}
|
|
216
|
+
${Y} Also covers #work/backend${R} ${D}\u2190 creates: work \u2192 backend${R}
|
|
217
|
+
${Y} Deep nesting: #cs/algo/sorting${R} ${D}\u2190 creates: cs \u2192 algo \u2192 sorting${R}
|
|
218
|
+
|
|
219
|
+
${D} What happens:${R}
|
|
220
|
+
${D} \u2022 Only the LEAF tag is applied to the block: "frontend" not "work"${R}
|
|
221
|
+
${D} \u2022 Parent tags are auto-created if they don't exist${R}
|
|
222
|
+
${D} \u2022 Parent\u2192child edges are created in the tag hierarchy${R}
|
|
223
|
+
${D} \u2022 Searching #work finds blocks tagged with #work AND all children${R}
|
|
224
|
+
${D} (frontend, backend, etc.)${R}
|
|
225
|
+
|
|
226
|
+
${D} You can also set relationships via command palette (Cmd+K in web):${R}
|
|
227
|
+
${D} "Tag Extend" \u2192 pick parent and child tags${R}
|
|
228
|
+
|
|
229
|
+
${C}${B} 10. SEARCH QUERY SYNTAX${R}
|
|
230
|
+
|
|
231
|
+
${G}vertex search "keyword"${R} ${D}\u2190 full-text search${R}
|
|
232
|
+
${G}vertex search "#work"${R} ${D}\u2190 all blocks tagged #work (+ children)${R}
|
|
233
|
+
${G}vertex search "#work/frontend"${R} ${D}\u2190 searches the leaf tag "frontend"${R}
|
|
234
|
+
${G}vertex search "type:todo"${R} ${D}\u2190 all todo blocks${R}
|
|
235
|
+
${G}vertex search "type:code"${R} ${D}\u2190 all code blocks${R}
|
|
236
|
+
${G}vertex search "type:heading"${R} ${D}\u2190 all headings${R}
|
|
237
|
+
${G}vertex search "status:open"${R} ${D}\u2190 unchecked todos${R}
|
|
238
|
+
${G}vertex search "status:done"${R} ${D}\u2190 checked todos${R}
|
|
239
|
+
${G}vertex search "type:todo status:open #work"${R} ${D}\u2190 combine filters${R}
|
|
240
|
+
${G}vertex search "type:todo #work keyword"${R} ${D}\u2190 all three${R}
|
|
241
|
+
|
|
242
|
+
${C}${B} 11. DAILY NOTES${R}
|
|
243
|
+
|
|
244
|
+
${G}vertex daily${R} ${D}\u2190 view/create today's daily note${R}
|
|
245
|
+
${G}vertex daily --last${R} ${D}\u2190 view most recent daily (no create)${R}
|
|
246
|
+
${G}vertex today${R} ${D}\u2190 open latest daily in interactive TUI${R}
|
|
247
|
+
|
|
248
|
+
${D} Daily notes are auto-titled with the date: "April 14, 2026"${R}
|
|
249
|
+
${D} One daily note per day \u2014 calling vertex daily twice won't duplicate.${R}
|
|
250
|
+
|
|
251
|
+
${C}${B} 12. INTERACTIVE MODE${R}
|
|
252
|
+
|
|
253
|
+
${G}vertex interactive "Note Title"${R} ${D}\u2190 open any note${R}
|
|
254
|
+
${G}vertex today${R} ${D}\u2190 shortcut for latest daily${R}
|
|
255
|
+
|
|
256
|
+
${D} Controls:${R}
|
|
257
|
+
${D} \u2191 \u2193 Move cursor between items${R}
|
|
258
|
+
${D} Enter Toggle todo done/undone${R}
|
|
259
|
+
${D} t Add new todo${R}
|
|
260
|
+
${D} n Add new text line${R}
|
|
261
|
+
${D} d Delete item at cursor${R}
|
|
262
|
+
${D} e Open in $EDITOR for full editing${R}
|
|
263
|
+
${D} s Save changes${R}
|
|
264
|
+
${D} q Save and quit${R}
|
|
265
|
+
|
|
266
|
+
${C}${B} 13. TRASH & DELETE${R}
|
|
267
|
+
|
|
268
|
+
${G}vertex delete "Note"${R} ${D}\u2190 soft delete (recoverable)${R}
|
|
269
|
+
${G}vertex trash${R} ${D}\u2190 list trashed notes${R}
|
|
270
|
+
${G}vertex restore "Note"${R} ${D}\u2190 restore from trash${R}
|
|
271
|
+
${G}vertex trash:empty${R} ${D}\u2190 permanent delete all (irreversible)${R}
|
|
272
|
+
|
|
273
|
+
${D} Soft delete: note goes to trash, can be restored${R}
|
|
274
|
+
${D} Hard delete (trash:empty): note + files + tags permanently removed${R}
|
|
275
|
+
|
|
276
|
+
${C}${B} 14. ALL COMMANDS REFERENCE${R}
|
|
277
|
+
|
|
278
|
+
${G}vertex login${R} ${D}\u2190 authenticate (GitHub/Google/Email)${R}
|
|
279
|
+
${G}vertex logout${R} ${D}\u2190 clear session${R}
|
|
280
|
+
${G}vertex whoami${R} ${D}\u2190 show logged-in user${R}
|
|
281
|
+
${G}vertex notes${R} ${D}\u2190 list all notes${R}
|
|
282
|
+
${G}vertex new [title]${R} ${D}\u2190 create note${R}
|
|
283
|
+
${G}vertex view <title>${R} ${D}\u2190 view as markdown${R}
|
|
284
|
+
${G}vertex edit <title>${R} ${D}\u2190 edit in $EDITOR${R}
|
|
285
|
+
${G}vertex daily${R} ${D}\u2190 today's daily note${R}
|
|
286
|
+
${G}vertex daily --last${R} ${D}\u2190 latest daily note${R}
|
|
287
|
+
${G}vertex today${R} ${D}\u2190 latest daily \u2192 interactive${R}
|
|
288
|
+
${G}vertex interactive <title>${R} ${D}\u2190 interactive TUI mode${R}
|
|
289
|
+
${G}vertex capture "text"${R} ${D}\u2190 quick capture to inbox${R}
|
|
290
|
+
${G}vertex search <query>${R} ${D}\u2190 search notes${R}
|
|
291
|
+
${G}vertex tags${R} ${D}\u2190 list tags${R}
|
|
292
|
+
${G}vertex import <file.md>${R} ${D}\u2190 import markdown as note${R}
|
|
293
|
+
${G}vertex import <file> -t "T"${R} ${D}\u2190 import with title${R}
|
|
294
|
+
${G}vertex export <title>${R} ${D}\u2190 export as markdown${R}
|
|
295
|
+
${G}vertex export <title> -o file${R} ${D}\u2190 export to file${R}
|
|
296
|
+
${G}vertex export <title> --json${R} ${D}\u2190 export as JSON${R}
|
|
297
|
+
${G}vertex delete <title>${R} ${D}\u2190 soft delete${R}
|
|
298
|
+
${G}vertex restore <title>${R} ${D}\u2190 restore from trash${R}
|
|
299
|
+
${G}vertex trash${R} ${D}\u2190 list trash${R}
|
|
300
|
+
${G}vertex trash:empty${R} ${D}\u2190 empty trash permanently${R}
|
|
301
|
+
${G}vertex status${R} ${D}\u2190 storage, note count, version${R}
|
|
302
|
+
${G}vertex syntax${R} ${D}\u2190 markdown syntax reference${R}
|
|
303
|
+
${G}vertex howto${R} ${D}\u2190 this guide${R}
|
|
304
|
+
${G}vertex help${R} ${D}\u2190 command overview${R}
|
|
305
|
+
|
|
306
|
+
${C}${B} 15. FULL EXAMPLE \u2014 AI CREATING A COMPLETE NOTE${R}
|
|
307
|
+
${D} \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500${R}
|
|
308
|
+
|
|
309
|
+
${G}cat > /tmp/my-note.md << 'VERTEX'${R}
|
|
310
|
+
${Y}# Distributed Systems Study Guide${R}
|
|
311
|
+
${Y}${R}
|
|
312
|
+
${Y}Notes from studying distributed systems. #learning #cs${R}
|
|
313
|
+
${Y}${R}
|
|
314
|
+
${Y}## CAP Theorem${R}
|
|
315
|
+
${Y}${R}
|
|
316
|
+
${Y}A distributed system can only guarantee 2 of 3:${R}
|
|
317
|
+
${Y}${R}
|
|
318
|
+
${Y}- **Consistency** \u2014 every read gets the latest write${R}
|
|
319
|
+
${Y}- **Availability** \u2014 every request gets a response${R}
|
|
320
|
+
${Y}- **Partition tolerance** \u2014 system works despite network failures${R}
|
|
321
|
+
${Y}${R}
|
|
322
|
+
${Y}> [!warning]${R}
|
|
323
|
+
${Y}> In practice, P is non-negotiable. You choose between CP and AP.${R}
|
|
324
|
+
${Y}${R}
|
|
325
|
+
${Y}## Consensus Algorithm${R}
|
|
326
|
+
${Y}${R}
|
|
327
|
+
${Y}\`\`\`mermaid${R}
|
|
328
|
+
${Y}sequenceDiagram${R}
|
|
329
|
+
${Y} Leader->>Follower1: AppendEntries${R}
|
|
330
|
+
${Y} Leader->>Follower2: AppendEntries${R}
|
|
331
|
+
${Y} Follower1-->>Leader: ACK${R}
|
|
332
|
+
${Y} Follower2-->>Leader: ACK${R}
|
|
333
|
+
${Y} Leader->>Leader: Commit (majority ACK)${R}
|
|
334
|
+
${Y}\`\`\`${R}
|
|
335
|
+
${Y}${R}
|
|
336
|
+
${Y}## Consistency Models${R}
|
|
337
|
+
${Y}${R}
|
|
338
|
+
${Y}$$${R}
|
|
339
|
+
${Y}\\text{Linearizability} \\subset \\text{Sequential} \\subset \\text{Causal} \\subset \\text{Eventual}${R}
|
|
340
|
+
${Y}$$${R}
|
|
341
|
+
${Y}${R}
|
|
342
|
+
${Y}## Implementation${R}
|
|
343
|
+
${Y}${R}
|
|
344
|
+
${Y}\`\`\`go${R}
|
|
345
|
+
${Y}type RaftNode struct {${R}
|
|
346
|
+
${Y} state State${R}
|
|
347
|
+
${Y} term int${R}
|
|
348
|
+
${Y} votedFor string${R}
|
|
349
|
+
${Y} log []Entry${R}
|
|
350
|
+
${Y}}${R}
|
|
351
|
+
${Y}\`\`\`${R}
|
|
352
|
+
${Y}${R}
|
|
353
|
+
${Y}## Reading List${R}
|
|
354
|
+
${Y}${R}
|
|
355
|
+
${Y}- [x] Designing Data-Intensive Applications #learning/books${R}
|
|
356
|
+
${Y}- [ ] Raft paper #learning/papers${R}
|
|
357
|
+
${Y}- [ ] Paxos Made Simple #learning/papers${R}
|
|
358
|
+
${Y}${R}
|
|
359
|
+
${Y}> [!tip]${R}
|
|
360
|
+
${Y}> Start with Raft \u2014 it's simpler than Paxos and used in etcd.${R}
|
|
361
|
+
${Y}${R}
|
|
362
|
+
${Y}---${R}
|
|
363
|
+
${Y}${R}
|
|
364
|
+
${Y}Related: [[Project Roadmap]] \xB7 [[AI Research Notes]]${R}
|
|
365
|
+
${G}VERTEX${R}
|
|
366
|
+
|
|
367
|
+
${G}vertex import /tmp/my-note.md -t "Distributed Systems Study Guide"${R}
|
|
368
|
+
|
|
369
|
+
${D} \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500${R}
|
|
370
|
+
${D} This creates a note with: heading, bullets, callouts, mermaid,${R}
|
|
371
|
+
${D} math, code, todos with scoped tags, wiki links, and a divider.${R}
|
|
372
|
+
${D} Open the web app to see it rendered with rich blocks.${R}
|
|
373
|
+
`);
|
|
374
|
+
}
|
|
375
|
+
};
|
|
376
|
+
export {
|
|
377
|
+
Howto as default
|
|
378
|
+
};
|
|
379
|
+
//# sourceMappingURL=howto.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/commands/howto.ts"],"sourcesContent":["import { Command } from \"@oclif/core\";\n\nconst D = \"\\x1b[90m\";\nconst B = \"\\x1b[1m\";\nconst C = \"\\x1b[36m\";\nconst Y = \"\\x1b[33m\";\nconst G = \"\\x1b[32m\";\nconst P = \"\\x1b[35m\";\nconst R = \"\\x1b[0m\";\n\nexport default class Howto extends Command {\n static override description = \"Complete guide for AI agents to create and manage Vertex notes\";\n\n async run(): Promise<void> {\n this.log(`\n${B}${P} Vertex — Complete AI Guide${R}\n${D} Everything an AI agent needs to create, edit, and manage notes.${R}\n${D} Read this once, then you can do anything in Vertex.${R}\n${D} ══════════════════════════════════════════════════════════════${R}\n\n${C}${B} 1. WHAT IS VERTEX?${R}\n${D} A knowledge workspace. Notes are stored in the cloud (Supabase).${R}\n${D} You write markdown in the terminal → it renders as rich content${R}\n${D} (diagrams, math, code, callouts) in the web app.${R}\n${D} Notes can link to each other via [[wiki links]] and #tags.${R}\n\n${C}${B} 2. HOW TO CREATE A NOTE${R}\n\n${D} Option A: Create and edit in one step${R}\n ${G}vertex new \"My Note Title\"${R}\n ${G}vertex edit \"My Note\"${R} ${D}← opens in $EDITOR (vim/nano/code)${R}\n\n${D} Option B: Write a .md file, then import${R}\n ${G}cat > note.md << 'EOF'${R}\n ${Y}# My Note Title${R}\n ${Y}Content here...${R}\n ${G}EOF${R}\n ${G}vertex import note.md -t \"My Note Title\"${R}\n\n${D} Option C: Quick one-liner to inbox${R}\n ${G}vertex capture \"Remember to review PR #42\"${R}\n\n${C}${B} 3. HOW TO EDIT AN EXISTING NOTE${R}\n\n ${G}vertex edit \"Note Title\"${R} ${D}← partial match works: \"Note\" matches \"Note Title\"${R}\n${D} This exports the note as markdown, opens your $EDITOR,${R}\n${D} and when you save & quit, it parses the markdown back${R}\n${D} and updates the note in the database.${R}\n\n${D} To use a specific editor:${R}\n ${G}EDITOR=nano vertex edit \"My Note\"${R}\n ${G}EDITOR=\"code --wait\" vertex edit \"My Note\"${R}\n ${G}EDITOR=vim vertex edit \"My Note\"${R}\n\n${C}${B} 4. HOW TO VIEW A NOTE (read-only)${R}\n\n ${G}vertex view \"Note Title\"${R} ${D}← prints markdown to stdout${R}\n ${G}vertex view \"Note\" | less${R} ${D}← paginated view${R}\n ${G}vertex export \"Note\" -o note.md${R} ${D}← save to file${R}\n\n${C}${B} 5. HOW TO LIST AND FIND NOTES${R}\n\n ${G}vertex notes${R} ${D}← list all notes${R}\n ${G}vertex search \"keyword\"${R} ${D}← full-text search${R}\n ${G}vertex search \"#tagname\"${R} ${D}← search by tag${R}\n ${G}vertex search \"type:todo status:open\"${R} ${D}← find open todos${R}\n ${G}vertex tags${R} ${D}← list all tags${R}\n ${G}vertex daily --last${R} ${D}← view latest daily note${R}\n\n${D} ══════════════════════════════════════════════════════════════${R}\n\n${C}${B} 6. MARKDOWN SYNTAX — ALL BLOCK TYPES${R}\n\n${D} ┌─ IMPORTANT ────────────────────────────────────────────────${R}\n${D} │ Every block must be separated by a BLANK LINE.${R}\n${D} │ The first # H1 heading becomes the note title.${R}\n${D} │ Tags must start with a letter (a-z): #valid not #123${R}\n${D} └──────────────────────────────────────────────────────────${R}\n\n${C} HEADINGS${R}\n${Y} # Heading 1${R}\n${Y} ## Heading 2${R}\n${Y} ### Heading 3${R}\n\n${C} TEXT FORMATTING${R}\n${Y} **bold text**${R}\n${Y} *italic text*${R}\n${Y} \\`inline code\\`${R}\n${Y} ~~strikethrough~~${R}\n\n${C} BULLET LIST${R}\n${Y} - Item one${R}\n${Y} - Item two${R}\n${Y} - Item three${R}\n\n${C} NUMBERED LIST${R}\n${Y} 1. First${R}\n${Y} 2. Second${R}\n${Y} 3. Third${R}\n\n${C} TODO TASKS${R}\n${Y} - [ ] Open task${R}\n${Y} - [x] Completed task${R}\n\n${C} BLOCKQUOTE${R}\n${Y} > Quoted text here${R}\n\n${C} DIVIDER${R}\n${Y} ---${R}\n\n${C} CODE BLOCK${R}\n${Y} \\`\\`\\`python${R}\n${Y} def hello():${R}\n${Y} print(\"Hello!\")${R}\n${Y} \\`\\`\\`${R}\n${D} Languages: python, javascript, typescript, rust, go, java,${R}\n${D} c, cpp, sql, html, css, json, yaml, bash, ruby, swift, etc.${R}\n\n${C} MERMAID DIAGRAM${R}\n${Y} \\`\\`\\`mermaid${R}\n${Y} graph TD;${R}\n${Y} A --> B --> C;${R}\n${Y} \\`\\`\\`${R}\n${D} Types: graph/flowchart, sequenceDiagram, classDiagram,${R}\n${D} erDiagram, stateDiagram, gantt, pie, gitGraph, mindmap${R}\n\n${C} INLINE MATH${R}\n${Y} The value $E = mc^2$ is inline.${R}\n${Y} Solve $\\\\frac{-b \\\\pm \\\\sqrt{b^2-4ac}}{2a}$ for $x$.${R}\n${D} Use single $ for inline math within text.${R}\n\n${C} BLOCK MATH (LaTeX via KaTeX)${R}\n${Y} $$${R}\n${Y} E = mc^2${R}\n${Y} $$${R}\n${D} Use $$ on separate lines for standalone equations.${R}\n${D} LaTeX: \\\\frac{a}{b} \\\\sqrt{x} \\\\sum_{i=1}^{n} \\\\int_0^1${R}\n${D} \\\\alpha \\\\beta \\\\pi \\\\infty \\\\text{label} x^{2} x_{i}${R}\n\n${C} CALLOUT${R}\n${Y} > [!info]${R}\n${Y} > Informational note${R}\n${D} Variants: info, warning, error, tip${R}\n${D} Multi-line: each line starts with > ${R}\n\n${C} QUERY BLOCK${R}\n${Y} > [!query]${R}\n${Y} > type:todo status:open #work${R}\n\n${C} INLINE LINK${R}\n${Y} [Link Text](https://example.com)${R}\n${D} Opens in new tab. Standard markdown link syntax.${R}\n\n${C} EMBED (link preview)${R}\n${Y} > [!embed]${R}\n${Y} > https://youtube.com/watch?v=ID${R}\n${D} YouTube → video player. Other URLs → preview card.${R}\n\n${C} IMAGE${R}\n${Y} ${R}\n\n${C} FILE ATTACHMENT${R}\n${Y} > [!file]${R}\n${Y} > [filename.pdf](https://url.com/file.pdf)${R}\n${Y} > application/pdf 149780${R}\n\n${D} ══════════════════════════════════════════════════════════════${R}\n\n${C}${B} 7. WIKI LINKS — HOW TO CONNECT NOTES${R}\n\n${D} Wiki links create connections between notes.${R}\n${D} They render as clickable purple links in the web app.${R}\n${D} The linked note shows a \"backlink\" at the bottom.${R}\n\n${Y} Check out [[Project Roadmap]] for details.${R}\n${Y} This connects to [[AI Research Notes]] and [[Meeting Notes]].${R}\n\n${D} Rules:${R}\n${D} • Use the exact note title inside [[ ]]${R}\n${D} • Case-insensitive: [[my note]] matches \"My Note\"${R}\n${D} • If the note doesn't exist yet, the link is still created${R}\n${D} • Multiple links in one paragraph is fine${R}\n${D} • Wiki links work in any text: paragraphs, todos, callouts${R}\n\n${D} Example: Create a network of linked notes${R}\n ${G}vertex new \"Hub Note\"${R}\n ${G}vertex edit \"Hub Note\"${R}\n${D} Then write:${R}\n${Y} # Hub Note${R}\n${Y} ${R}\n${Y} This connects to:${R}\n${Y} - [[Topic A]] — first topic${R}\n${Y} - [[Topic B]] — second topic${R}\n${Y} - [[Topic C]] — third topic${R}\n\n${C}${B} 8. TAGS — HOW THEY WORK${R}\n\n${D} Tags categorize content. They appear as purple pills in the web app.${R}\n${D} Tags are auto-created when you use them — no need to create first.${R}\n\n${C} Basic tags:${R}\n${Y} This paragraph has #work and #important tags.${R}\n${Y} - [x] Finish report #work #deadline${R}\n\n${C} Rules:${R}\n${D} • Must start with a letter: #valid, #tag123${R}\n${D} • Can contain letters, numbers, hyphens, underscores: #my-tag, #my_tag${R}\n${D} • NO spaces: #my tag is wrong → use #my-tag${R}\n${D} • Tags are case-insensitive: #Work = #work${R}\n${D} • Tags work everywhere: paragraphs, todos, headings, callouts${R}\n\n${C}${B} 9. TAG HIERARCHY — PARENT/CHILD RELATIONSHIPS${R}\n\n${D} Tags can have parent-child relationships using / separator.${R}\n${D} This creates a DAG (directed acyclic graph) of tags.${R}\n\n${Y} This is about #work/frontend${R} ${D}← creates: work → frontend${R}\n${Y} Also covers #work/backend${R} ${D}← creates: work → backend${R}\n${Y} Deep nesting: #cs/algo/sorting${R} ${D}← creates: cs → algo → sorting${R}\n\n${D} What happens:${R}\n${D} • Only the LEAF tag is applied to the block: \"frontend\" not \"work\"${R}\n${D} • Parent tags are auto-created if they don't exist${R}\n${D} • Parent→child edges are created in the tag hierarchy${R}\n${D} • Searching #work finds blocks tagged with #work AND all children${R}\n${D} (frontend, backend, etc.)${R}\n\n${D} You can also set relationships via command palette (Cmd+K in web):${R}\n${D} \"Tag Extend\" → pick parent and child tags${R}\n\n${C}${B} 10. SEARCH QUERY SYNTAX${R}\n\n ${G}vertex search \"keyword\"${R} ${D}← full-text search${R}\n ${G}vertex search \"#work\"${R} ${D}← all blocks tagged #work (+ children)${R}\n ${G}vertex search \"#work/frontend\"${R} ${D}← searches the leaf tag \"frontend\"${R}\n ${G}vertex search \"type:todo\"${R} ${D}← all todo blocks${R}\n ${G}vertex search \"type:code\"${R} ${D}← all code blocks${R}\n ${G}vertex search \"type:heading\"${R} ${D}← all headings${R}\n ${G}vertex search \"status:open\"${R} ${D}← unchecked todos${R}\n ${G}vertex search \"status:done\"${R} ${D}← checked todos${R}\n ${G}vertex search \"type:todo status:open #work\"${R} ${D}← combine filters${R}\n ${G}vertex search \"type:todo #work keyword\"${R} ${D}← all three${R}\n\n${C}${B} 11. DAILY NOTES${R}\n\n ${G}vertex daily${R} ${D}← view/create today's daily note${R}\n ${G}vertex daily --last${R} ${D}← view most recent daily (no create)${R}\n ${G}vertex today${R} ${D}← open latest daily in interactive TUI${R}\n\n${D} Daily notes are auto-titled with the date: \"April 14, 2026\"${R}\n${D} One daily note per day — calling vertex daily twice won't duplicate.${R}\n\n${C}${B} 12. INTERACTIVE MODE${R}\n\n ${G}vertex interactive \"Note Title\"${R} ${D}← open any note${R}\n ${G}vertex today${R} ${D}← shortcut for latest daily${R}\n\n${D} Controls:${R}\n${D} ↑ ↓ Move cursor between items${R}\n${D} Enter Toggle todo done/undone${R}\n${D} t Add new todo${R}\n${D} n Add new text line${R}\n${D} d Delete item at cursor${R}\n${D} e Open in $EDITOR for full editing${R}\n${D} s Save changes${R}\n${D} q Save and quit${R}\n\n${C}${B} 13. TRASH & DELETE${R}\n\n ${G}vertex delete \"Note\"${R} ${D}← soft delete (recoverable)${R}\n ${G}vertex trash${R} ${D}← list trashed notes${R}\n ${G}vertex restore \"Note\"${R} ${D}← restore from trash${R}\n ${G}vertex trash:empty${R} ${D}← permanent delete all (irreversible)${R}\n\n${D} Soft delete: note goes to trash, can be restored${R}\n${D} Hard delete (trash:empty): note + files + tags permanently removed${R}\n\n${C}${B} 14. ALL COMMANDS REFERENCE${R}\n\n ${G}vertex login${R} ${D}← authenticate (GitHub/Google/Email)${R}\n ${G}vertex logout${R} ${D}← clear session${R}\n ${G}vertex whoami${R} ${D}← show logged-in user${R}\n ${G}vertex notes${R} ${D}← list all notes${R}\n ${G}vertex new [title]${R} ${D}← create note${R}\n ${G}vertex view <title>${R} ${D}← view as markdown${R}\n ${G}vertex edit <title>${R} ${D}← edit in $EDITOR${R}\n ${G}vertex daily${R} ${D}← today's daily note${R}\n ${G}vertex daily --last${R} ${D}← latest daily note${R}\n ${G}vertex today${R} ${D}← latest daily → interactive${R}\n ${G}vertex interactive <title>${R} ${D}← interactive TUI mode${R}\n ${G}vertex capture \"text\"${R} ${D}← quick capture to inbox${R}\n ${G}vertex search <query>${R} ${D}← search notes${R}\n ${G}vertex tags${R} ${D}← list tags${R}\n ${G}vertex import <file.md>${R} ${D}← import markdown as note${R}\n ${G}vertex import <file> -t \"T\"${R} ${D}← import with title${R}\n ${G}vertex export <title>${R} ${D}← export as markdown${R}\n ${G}vertex export <title> -o file${R} ${D}← export to file${R}\n ${G}vertex export <title> --json${R} ${D}← export as JSON${R}\n ${G}vertex delete <title>${R} ${D}← soft delete${R}\n ${G}vertex restore <title>${R} ${D}← restore from trash${R}\n ${G}vertex trash${R} ${D}← list trash${R}\n ${G}vertex trash:empty${R} ${D}← empty trash permanently${R}\n ${G}vertex status${R} ${D}← storage, note count, version${R}\n ${G}vertex syntax${R} ${D}← markdown syntax reference${R}\n ${G}vertex howto${R} ${D}← this guide${R}\n ${G}vertex help${R} ${D}← command overview${R}\n\n${C}${B} 15. FULL EXAMPLE — AI CREATING A COMPLETE NOTE${R}\n${D} ──────────────────────────────────────────────────────────────${R}\n\n ${G}cat > /tmp/my-note.md << 'VERTEX'${R}\n ${Y}# Distributed Systems Study Guide${R}\n ${Y}${R}\n ${Y}Notes from studying distributed systems. #learning #cs${R}\n ${Y}${R}\n ${Y}## CAP Theorem${R}\n ${Y}${R}\n ${Y}A distributed system can only guarantee 2 of 3:${R}\n ${Y}${R}\n ${Y}- **Consistency** — every read gets the latest write${R}\n ${Y}- **Availability** — every request gets a response${R}\n ${Y}- **Partition tolerance** — system works despite network failures${R}\n ${Y}${R}\n ${Y}> [!warning]${R}\n ${Y}> In practice, P is non-negotiable. You choose between CP and AP.${R}\n ${Y}${R}\n ${Y}## Consensus Algorithm${R}\n ${Y}${R}\n ${Y}\\`\\`\\`mermaid${R}\n ${Y}sequenceDiagram${R}\n ${Y} Leader->>Follower1: AppendEntries${R}\n ${Y} Leader->>Follower2: AppendEntries${R}\n ${Y} Follower1-->>Leader: ACK${R}\n ${Y} Follower2-->>Leader: ACK${R}\n ${Y} Leader->>Leader: Commit (majority ACK)${R}\n ${Y}\\`\\`\\`${R}\n ${Y}${R}\n ${Y}## Consistency Models${R}\n ${Y}${R}\n ${Y}$$${R}\n ${Y}\\\\text{Linearizability} \\\\subset \\\\text{Sequential} \\\\subset \\\\text{Causal} \\\\subset \\\\text{Eventual}${R}\n ${Y}$$${R}\n ${Y}${R}\n ${Y}## Implementation${R}\n ${Y}${R}\n ${Y}\\`\\`\\`go${R}\n ${Y}type RaftNode struct {${R}\n ${Y} state State${R}\n ${Y} term int${R}\n ${Y} votedFor string${R}\n ${Y} log []Entry${R}\n ${Y}}${R}\n ${Y}\\`\\`\\`${R}\n ${Y}${R}\n ${Y}## Reading List${R}\n ${Y}${R}\n ${Y}- [x] Designing Data-Intensive Applications #learning/books${R}\n ${Y}- [ ] Raft paper #learning/papers${R}\n ${Y}- [ ] Paxos Made Simple #learning/papers${R}\n ${Y}${R}\n ${Y}> [!tip]${R}\n ${Y}> Start with Raft — it's simpler than Paxos and used in etcd.${R}\n ${Y}${R}\n ${Y}---${R}\n ${Y}${R}\n ${Y}Related: [[Project Roadmap]] · [[AI Research Notes]]${R}\n ${G}VERTEX${R}\n\n ${G}vertex import /tmp/my-note.md -t \"Distributed Systems Study Guide\"${R}\n\n${D} ──────────────────────────────────────────────────────────────${R}\n${D} This creates a note with: heading, bullets, callouts, mermaid,${R}\n${D} math, code, todos with scoped tags, wiki links, and a divider.${R}\n${D} Open the web app to see it rendered with rich blocks.${R}\n`);\n }\n}\n"],"mappings":";AAAA,SAAS,eAAe;AAExB,IAAM,IAAI;AACV,IAAM,IAAI;AACV,IAAM,IAAI;AACV,IAAM,IAAI;AACV,IAAM,IAAI;AACV,IAAM,IAAI;AACV,IAAM,IAAI;AAEV,IAAqB,QAArB,cAAmC,QAAQ;AAAA,EACzC,OAAgB,cAAc;AAAA,EAE9B,MAAM,MAAqB;AACzB,SAAK,IAAI;AAAA,EACX,CAAC,GAAG,CAAC,oCAA+B,CAAC;AAAA,EACrC,CAAC,oEAAoE,CAAC;AAAA,EACtE,CAAC,wDAAwD,CAAC;AAAA,EAC1D,CAAC,yXAAmE,CAAC;AAAA;AAAA,EAErE,CAAC,GAAG,CAAC,uBAAuB,CAAC;AAAA,EAC7B,CAAC,qEAAqE,CAAC;AAAA,EACvE,CAAC,yEAAoE,CAAC;AAAA,EACt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AAC;AAAA,IACL,CAAC,WAAW,CAAC;AAAA,IACb,CAAC,qEAAgE,CAAC;AAAA,IAClE,CAAC,GAAG,CAAC;AAAA,IACL,CAAC,MAAM,CAAC;AAAA,IACR,CAAC,GAAG,CAAC;AAAA,IACL,CAAC,0DAAuD,CAAC;AAAA,IACzD,CAAC,SAAS,CAAC;AAAA;AAAA,IAEX,CAAC,qEAAqE,CAAC;AAAA;AAAA,EAEzE,CAAC,yXAAmE,CAAC;AAAA,EACrE,CAAC,mEAAmE,CAAC;AAAA,EACrE,CAAC,mEAAmE,CAAC;AAAA,EACrE,CAAC,0DAA0D,CAAC;AAAA,CAC7D;AAAA,EACC;AACF;","names":[]}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import {
|
|
2
|
+
getClient,
|
|
3
|
+
getUserId
|
|
4
|
+
} from "../chunk-URRSVCB7.js";
|
|
5
|
+
import "../chunk-PBF5EE4Y.js";
|
|
6
|
+
import {
|
|
7
|
+
createNote,
|
|
8
|
+
markdownToTiptap,
|
|
9
|
+
saveNoteContent
|
|
10
|
+
} from "../chunk-EEEL6ZKK.js";
|
|
11
|
+
|
|
12
|
+
// src/commands/import.ts
|
|
13
|
+
import { Command, Args, Flags } from "@oclif/core";
|
|
14
|
+
import { readFileSync } from "fs";
|
|
15
|
+
import { basename } from "path";
|
|
16
|
+
var Import = class _Import extends Command {
|
|
17
|
+
static description = "Import a markdown file as a note";
|
|
18
|
+
static args = {
|
|
19
|
+
file: Args.string({ description: "Path to .md file", required: true })
|
|
20
|
+
};
|
|
21
|
+
static flags = {
|
|
22
|
+
title: Flags.string({ char: "t", description: "Note title (default: filename)" })
|
|
23
|
+
};
|
|
24
|
+
async run() {
|
|
25
|
+
const { args, flags } = await this.parse(_Import);
|
|
26
|
+
const client = await getClient();
|
|
27
|
+
const userId = await getUserId();
|
|
28
|
+
const md = readFileSync(args.file, "utf-8");
|
|
29
|
+
const title = flags.title ?? basename(args.file, ".md");
|
|
30
|
+
const tiptapJson = markdownToTiptap(md);
|
|
31
|
+
const note = await createNote(client, { user_id: userId, title });
|
|
32
|
+
await saveNoteContent(client, note.id, userId, tiptapJson);
|
|
33
|
+
this.log(`Imported: ${title} (${note.id})`);
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
export {
|
|
37
|
+
Import as default
|
|
38
|
+
};
|
|
39
|
+
//# sourceMappingURL=import.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/commands/import.ts"],"sourcesContent":["import { Command, Args, Flags } from \"@oclif/core\";\nimport { readFileSync } from \"node:fs\";\nimport { basename } from \"node:path\";\nimport { createNote, saveNoteContent } from \"@vertex/core\";\nimport { getClient, getUserId } from \"../lib/client.js\";\nimport { markdownToTiptap } from \"@vertex/core\";\n\nexport default class Import extends Command {\n static override description = \"Import a markdown file as a note\";\n\n static override args = {\n file: Args.string({ description: \"Path to .md file\", required: true }),\n };\n\n static override flags = {\n title: Flags.string({ char: \"t\", description: \"Note title (default: filename)\" }),\n };\n\n async run(): Promise<void> {\n const { args, flags } = await this.parse(Import);\n const client = await getClient();\n const userId = await getUserId();\n\n const md = readFileSync(args.file, \"utf-8\");\n const title = flags.title ?? basename(args.file, \".md\");\n const tiptapJson = markdownToTiptap(md);\n\n const note = await createNote(client, { user_id: userId, title });\n await saveNoteContent(client, note.id, userId, tiptapJson);\n\n this.log(`Imported: ${title} (${note.id})`);\n }\n}\n"],"mappings":";;;;;;;;;;;;AAAA,SAAS,SAAS,MAAM,aAAa;AACrC,SAAS,oBAAoB;AAC7B,SAAS,gBAAgB;AAKzB,IAAqB,SAArB,MAAqB,gBAAe,QAAQ;AAAA,EAC1C,OAAgB,cAAc;AAAA,EAE9B,OAAgB,OAAO;AAAA,IACrB,MAAM,KAAK,OAAO,EAAE,aAAa,oBAAoB,UAAU,KAAK,CAAC;AAAA,EACvE;AAAA,EAEA,OAAgB,QAAQ;AAAA,IACtB,OAAO,MAAM,OAAO,EAAE,MAAM,KAAK,aAAa,iCAAiC,CAAC;AAAA,EAClF;AAAA,EAEA,MAAM,MAAqB;AACzB,UAAM,EAAE,MAAM,MAAM,IAAI,MAAM,KAAK,MAAM,OAAM;AAC/C,UAAM,SAAS,MAAM,UAAU;AAC/B,UAAM,SAAS,MAAM,UAAU;AAE/B,UAAM,KAAK,aAAa,KAAK,MAAM,OAAO;AAC1C,UAAM,QAAQ,MAAM,SAAS,SAAS,KAAK,MAAM,KAAK;AACtD,UAAM,aAAa,iBAAiB,EAAE;AAEtC,UAAM,OAAO,MAAM,WAAW,QAAQ,EAAE,SAAS,QAAQ,MAAM,CAAC;AAChE,UAAM,gBAAgB,QAAQ,KAAK,IAAI,QAAQ,UAAU;AAEzD,SAAK,IAAI,aAAa,KAAK,KAAK,KAAK,EAAE,GAAG;AAAA,EAC5C;AACF;","names":[]}
|