|
1 | 1 | # /note Command |
2 | 2 |
|
3 | | -Transform raw thoughts into structured, Obsidian-compatible notes. |
| 3 | +Create structured notes from raw thoughts. |
4 | 4 |
|
5 | 5 | ## Usage |
6 | 6 |
|
7 | 7 | ``` |
8 | 8 | /note <your raw thoughts> |
9 | 9 | ``` |
10 | 10 |
|
11 | | -## Flow |
| 11 | +## How It Works |
12 | 12 |
|
13 | | -1. **Create** - User provides raw content |
14 | | -2. **Structure** - Tool structures into YAML + Markdown with tags and [[links]] |
15 | | -3. **Review** - Model presents formatted note |
16 | | -4. **Iterate** - User can request modifications (re-runs tool) |
17 | | -5. **Save** - User says "save" → Tool writes to file |
| 13 | +The model runs the `note` CLI tool: |
18 | 14 |
|
19 | | -## Tool Actions |
| 15 | +1. **Create**: `uv run note create --content "..."` |
| 16 | +2. **Review**: Model presents structured note |
| 17 | +3. **Iterate**: Re-run with modifications if needed |
| 18 | +4. **Save**: `uv run note save --content "..." --filename "name"` |
20 | 19 |
|
21 | | -### `create` - Structure content |
| 20 | +## CLI Tool |
22 | 21 |
|
23 | | -```typescript |
24 | | -note_tool( |
25 | | - action: "create", |
26 | | - content: "your raw thoughts...", |
27 | | - mode: "draft", // Returns formatted note for review |
28 | | - title?: string, // Optional title override |
29 | | - tags?: string, // Comma-separated tags |
30 | | - modifications?: string // Instructions for changes |
31 | | -) |
32 | | -``` |
| 22 | +**Location**: `.opencode/bin/note` |
33 | 23 |
|
34 | | -Returns: |
35 | | -- `frontmatter` - YAML metadata (id, title, created, type, tags) |
36 | | -- `body` - Structured markdown body |
37 | | -- `suggested_tags` - Auto-detected tags |
38 | | -- `suggested_links` - Detected [[WikiLinks]] |
39 | | -- `filename_suggestion` - Auto-generated filename |
40 | | - |
41 | | -### `create` with `mode: "finalize"` - Save directly |
42 | | - |
43 | | -```typescript |
44 | | -note_tool( |
45 | | - action: "create", |
46 | | - content: "...", |
47 | | - mode: "finalize", |
48 | | - filename?: string // Optional, auto-generated if not provided |
49 | | -) |
50 | | -``` |
| 24 | +**Commands**: |
51 | 25 |
|
52 | | -### Other actions |
| 26 | +```bash |
| 27 | +# Structure content into note |
| 28 | +uv run note create --content "Your thoughts..." |
53 | 29 |
|
54 | | -- `save` - Write pre-formatted content directly |
55 | | -- `list` - Show existing notes |
56 | | -- `search` - Search note contents |
| 30 | +# Save to file |
| 31 | +uv run note save --content "..." --filename "name" |
57 | 32 |
|
58 | | -## Example Session |
| 33 | +# List existing notes |
| 34 | +uv run note list |
59 | 35 |
|
| 36 | +# Search notes |
| 37 | +uv run note search --query "auth" |
60 | 38 | ``` |
61 | | -User: /note "I was thinking about the auth flow. We need to handle OAuth2 |
62 | | - and API keys. Error handling is important but I'm not sure |
63 | | - where it fits." |
64 | | -
|
65 | | -Model: [Calls note_tool(action="create", content="...", mode="draft")] |
66 | | -
|
67 | | ---- |
68 | | -id: 2026-03-27-a1b2c3 |
69 | | -title: Auth Flow Design Thoughts |
70 | | -created: 2026-03-27 |
71 | | -type: note |
72 | | -tags: |
73 | | - - auth |
74 | | - - oauth |
75 | | - - api |
76 | | ---- |
77 | | -
|
78 | | -## Auth Flow Design Thoughts |
79 | | -
|
80 | | -## Authentication Methods |
81 | | -We need to handle OAuth2 and API keys for the new feature. |
82 | | -
|
83 | | -## Error Handling Questions |
84 | | -Error handling is important but I'm not sure where it fits. |
85 | | -
|
86 | | -**Suggested Tags:** auth, oauth, api |
87 | | -**Suggested Links:** [[OAuth2]], [[API Keys]], [[Error Handling]] |
88 | | -**Suggested Filename:** auth-flow-design-thoughts |
89 | 39 |
|
90 | | -Want me to save this, or would you like modifications? |
| 40 | +## Example |
91 | 41 |
|
92 | | -User: Add a section about OAuth2 implementation details |
93 | | -
|
94 | | -Model: [Calls note_tool(action="create", content="...", mode="draft", |
95 | | - modifications="Add section about OAuth2 implementation")] |
96 | | -
|
97 | | -[Returns updated note with new section] |
98 | | -
|
99 | | -User: Save as auth-design |
100 | | -
|
101 | | -Model: [Calls note_tool(action="create", content="...", mode="finalize", |
102 | | - filename="auth-design")] |
103 | | -
|
104 | | -✅ Saved to .knowledge/notes/auth-design.md |
105 | 42 | ``` |
| 43 | +User: /note "I was thinking about auth flow. We need OAuth2." |
106 | 44 |
|
107 | | -## How It Works |
108 | | - |
109 | | -The **tool** does all the work: |
110 | | -- Parses raw content |
111 | | -- Extracts/generates title |
112 | | -- Structures into sections (## headings) |
113 | | -- Generates YAML frontmatter |
114 | | -- Suggests tags based on keywords |
115 | | -- Identifies [[WikiLinks]] |
116 | | -- Formats Obsidian-compatible output |
| 45 | +Model: uv run note create --content "I was thinking about auth flow..." |
117 | 46 |
|
118 | | -The **model** just: |
119 | | -- Calls the tool |
120 | | -- Presents the result |
121 | | -- Handles user feedback |
122 | | -- Re-calls tool for modifications |
| 47 | +Output: |
| 48 | +{ |
| 49 | + "id": "2026-03-27-abc123", |
| 50 | + "title": "Auth Flow Thoughts", |
| 51 | + "created": "2026-03-27", |
| 52 | + "type": "note", |
| 53 | + "tags": ["auth"], |
| 54 | + "filename": "auth-flow-thoughts" |
| 55 | +} |
123 | 56 |
|
124 | | -## Output Location |
| 57 | +Model: Here's your note with tags: auth. Save as "auth-flow-thoughts"? |
125 | 58 |
|
126 | | -All notes saved to: `.knowledge/notes/<filename>.md` |
| 59 | +User: Yes |
127 | 60 |
|
128 | | -## Related |
| 61 | +Model: uv run note save --content "..." --filename "auth-flow-thoughts" |
| 62 | +``` |
129 | 63 |
|
130 | | -- [[.knowledge]] - Knowledge directory |
131 | | -- [[/research]] - Deep research (requires workflow state) |
132 | | -- [[/plan]] - Structured planning (requires workflow state) |
| 64 | +Notes saved to: `.knowledge/notes/<filename>.md` |
0 commit comments