dsh-obsidian-skills 0.1.0 → 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/README.md +4 -0
- package/README.zh.md +4 -0
- package/assets/icon-180.png +0 -0
- package/assets/icon-512.png +0 -0
- package/assets/icon-64.png +0 -0
- package/package.json +2 -1
- package/scripts/sync-skills.mjs +22 -4
- package/skills/defuddle/SKILL.md +2 -2
- package/skills/json-canvas/SKILL.md +17 -8
- package/skills/knap/SKILL.md +1 -1
- package/skills/obsidian-bases/SKILL.md +115 -13
- package/skills/obsidian-cli/SKILL.md +44 -9
- package/skills/obsidian-headless/SKILL.md +79 -0
- package/skills/obsidian-markdown/SKILL.md +8 -2
- package/skills/obsidian-markdown/references/PROPERTIES.md +5 -3
- package/skills.manifest.json +6 -2
package/README.md
CHANGED
package/README.zh.md
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-obsidian-skills",
|
|
3
|
-
"version": "0.1
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"description": "Agent skills for Obsidian, packaged as a DeepSeek Harness plugin bundle. Vendored verbatim from the official repository https://github.com/kepano/obsidian-skills (MIT, Steph Ango) — six skills covering Obsidian Flavored Markdown, Bases, JSON Canvas, the Obsidian CLI, Defuddle and Knap. Documentation only: no CLI binaries are bundled, so obsidian/defuddle/knap must be installed separately by the user.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
},
|
|
11
11
|
"files": [
|
|
12
12
|
"lib",
|
|
13
|
+
"assets",
|
|
13
14
|
"skills",
|
|
14
15
|
"scripts",
|
|
15
16
|
"cordis.patch.yml",
|
package/scripts/sync-skills.mjs
CHANGED
|
@@ -14,7 +14,8 @@
|
|
|
14
14
|
* (default main)
|
|
15
15
|
*
|
|
16
16
|
* Upstream: https://github.com/kepano/obsidian-skills (MIT, Steph Ango).
|
|
17
|
-
* This script copies
|
|
17
|
+
* This script copies the upstream skill tree verbatim. It never edits upstream text.
|
|
18
|
+
* The tree is located automatically: skills/, plugins/obsidian/skills/ or plugins/skills/.
|
|
18
19
|
*/
|
|
19
20
|
|
|
20
21
|
import { execFileSync } from 'node:child_process';
|
|
@@ -30,6 +31,19 @@ const UPSTREAM = 'https://github.com/kepano/obsidian-skills';
|
|
|
30
31
|
const SRC = process.env.OBSIDIAN_SKILLS_SRC || '/tmp/obsidian-skills-src';
|
|
31
32
|
const REF = process.env.OBSIDIAN_SKILLS_REF || 'main';
|
|
32
33
|
|
|
34
|
+
/**
|
|
35
|
+
* Upstream moved its skill tree twice: originally <root>/skills, later
|
|
36
|
+
* <root>/plugins/obsidian/skills. Probe both so the script keeps working
|
|
37
|
+
* across upstream reorganisations instead of hard-coding one layout.
|
|
38
|
+
*/
|
|
39
|
+
function upstreamSkillsDir(root) {
|
|
40
|
+
for (const rel of ['skills', 'plugins/obsidian/skills', 'plugins/skills']) {
|
|
41
|
+
const dir = join(root, rel);
|
|
42
|
+
if (existsSync(dir)) return dir;
|
|
43
|
+
}
|
|
44
|
+
return null;
|
|
45
|
+
}
|
|
46
|
+
|
|
33
47
|
const argv = new Set(process.argv.slice(2));
|
|
34
48
|
const DRY_RUN = argv.has('--dry-run');
|
|
35
49
|
const CHECK = argv.has('--check');
|
|
@@ -48,7 +62,7 @@ function walk(dir, base = dir) {
|
|
|
48
62
|
|
|
49
63
|
/** Ensure the upstream clone exists; fetch it when missing. */
|
|
50
64
|
function ensureSource() {
|
|
51
|
-
if (
|
|
65
|
+
if (upstreamSkillsDir(SRC)) return SRC;
|
|
52
66
|
if (DRY_RUN || CHECK) return null;
|
|
53
67
|
console.error(`upstream clone missing at ${SRC}; cloning ${UPSTREAM} (${REF})...`);
|
|
54
68
|
mkdirSync(dirname(SRC), { recursive: true });
|
|
@@ -75,11 +89,15 @@ function manifestFor(names, fileCounts) {
|
|
|
75
89
|
function main() {
|
|
76
90
|
const src = ensureSource();
|
|
77
91
|
if (src === null) {
|
|
78
|
-
console.error(`missing source: ${SRC}/skills`);
|
|
92
|
+
console.error(`missing source: no skill tree under ${SRC} (looked for skills/, plugins/obsidian/skills/, plugins/skills/)`);
|
|
79
93
|
process.exit(1);
|
|
80
94
|
}
|
|
81
95
|
|
|
82
|
-
const srcSkills =
|
|
96
|
+
const srcSkills = upstreamSkillsDir(src);
|
|
97
|
+
if (srcSkills === null) {
|
|
98
|
+
console.error(`missing source: no skill tree under ${src}`);
|
|
99
|
+
process.exit(1);
|
|
100
|
+
}
|
|
83
101
|
const names = readdirSync(srcSkills, { withFileTypes: true })
|
|
84
102
|
.filter((e) => e.isDirectory() && !e.name.startsWith('.'))
|
|
85
103
|
.map((e) => e.name)
|
package/skills/defuddle/SKILL.md
CHANGED
|
@@ -5,9 +5,9 @@ description: Extract clean Markdown from HTML pages with Defuddle CLI.
|
|
|
5
5
|
|
|
6
6
|
# Defuddle
|
|
7
7
|
|
|
8
|
-
Use Defuddle CLI
|
|
8
|
+
Use Defuddle CLI when the user wants clean Markdown extracted from a web page. It removes navigation, ads, and other page clutter.
|
|
9
9
|
|
|
10
|
-
If
|
|
10
|
+
Check availability with `defuddle --help`. If it is missing, explain the dependency and offer installation with `npm install -g defuddle`. Do not claim extraction succeeded if the tool is unavailable or returns an error.
|
|
11
11
|
|
|
12
12
|
## Usage
|
|
13
13
|
|
|
@@ -92,6 +92,10 @@ Nodes are objects placed on the canvas. Array order determines z-index: first no
|
|
|
92
92
|
|
|
93
93
|
**Newline pitfall**: Use `\n` for line breaks in JSON strings. Do **not** use the literal `\\n` -- Obsidian renders that as the characters `\` and `n`.
|
|
94
94
|
|
|
95
|
+
**Quote escaping pitfall**: Double quotes inside `text` content must be escaped as `\"`. For example, the text `公司的"外交官"` must be stored as `"text": "公司的\"外交官\""`. Unescaped quotes break the JSON parse and the canvas will fail to render. When generating canvas JSON programmatically, always use a JSON serializer rather than manual string concatenation.
|
|
96
|
+
|
|
97
|
+
Write `.canvas` files directly. Don't create them with `obsidian create content=`, which turns every `\n` into a raw newline and breaks the JSON.
|
|
98
|
+
|
|
95
99
|
### File Nodes
|
|
96
100
|
|
|
97
101
|
| Attribute | Required | Type | Description |
|
|
@@ -99,6 +103,8 @@ Nodes are objects placed on the canvas. Array order determines z-index: first no
|
|
|
99
103
|
| `file` | Yes | string | Path to file within the system |
|
|
100
104
|
| `subpath` | No | string | Link to heading or block (starts with `#`) |
|
|
101
105
|
|
|
106
|
+
**File path escaping**: If a file name contains double quotes, they must be escaped as `\"` in the JSON string. For example, a file named `My "Notes".md` should be referenced as `"file": "My \"Notes\".md"`.
|
|
107
|
+
|
|
102
108
|
```json
|
|
103
109
|
{
|
|
104
110
|
"id": "a1b2c3d4e5f67890",
|
|
@@ -211,13 +217,15 @@ Generate 16-character lowercase hexadecimal strings (64-bit random value):
|
|
|
211
217
|
- Space nodes 50-100px apart; leave 20-50px padding inside groups
|
|
212
218
|
- Align to grid (multiples of 10 or 20) for cleaner layouts
|
|
213
219
|
|
|
214
|
-
| Node Type | Suggested Width | Suggested Height |
|
|
215
|
-
|
|
216
|
-
| Small text | 200-300 | 80-150 |
|
|
217
|
-
| Medium text | 300-450 | 150-300 |
|
|
218
|
-
| Large text | 400-600 | 300-500 |
|
|
219
|
-
| File preview | 300-500 | 200-400 |
|
|
220
|
-
| Link preview | 250-400 | 100-200 |
|
|
220
|
+
| Node Type | Suggested Width | Suggested Height | CJK Width (1.5x) |
|
|
221
|
+
|-----------|-----------------|------------------|-------------------|
|
|
222
|
+
| Small text | 200-300 | 80-150 | 300-450 |
|
|
223
|
+
| Medium text | 300-450 | 150-300 | 450-675 |
|
|
224
|
+
| Large text | 400-600 | 300-500 | 600-900 |
|
|
225
|
+
| File preview | 300-500 | 200-400 | 450-750 |
|
|
226
|
+
| Link preview | 250-400 | 100-200 | 375-600 |
|
|
227
|
+
|
|
228
|
+
**CJK text sizing**: CJK characters (Chinese, Japanese, Korean) are wider than Latin characters. For content primarily in CJK languages, multiply the suggested width by ~1.5× to avoid cramped layouts and awkward line breaks.
|
|
221
229
|
|
|
222
230
|
## Validation Checklist
|
|
223
231
|
|
|
@@ -230,7 +238,8 @@ After creating or editing a canvas file, verify:
|
|
|
230
238
|
5. `fromSide`/`toSide` values are one of: `top`, `right`, `bottom`, `left`
|
|
231
239
|
6. `fromEnd`/`toEnd` values are one of: `none`, `arrow`
|
|
232
240
|
7. Color presets are `"1"` through `"6"` or valid hex (e.g., `"#FF0000"`)
|
|
233
|
-
8.
|
|
241
|
+
8. Double quotes in `text` and `file` values are properly escaped as `\"`
|
|
242
|
+
9. JSON is valid and parseable
|
|
234
243
|
|
|
235
244
|
If validation fails, check for duplicate IDs, dangling edge references, or malformed JSON strings (especially unescaped newlines in text content).
|
|
236
245
|
|
package/skills/knap/SKILL.md
CHANGED
|
@@ -7,7 +7,7 @@ description: Render Markdown from templates and structured data using Knap CLI.
|
|
|
7
7
|
|
|
8
8
|
Use Knap CLI to render Markdown templates with variables, filters, and logic.
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
Check availability with `knap --help`. If it is missing, explain that Knap requires Node.js 20 or later and offer installation with `npm install -g knap` or execution with `npx knap`. Do not claim a template was rendered if the tool is unavailable or returns an error.
|
|
11
11
|
|
|
12
12
|
Run `knap --help` for available commands and options. Discover the language through the CLI's offline reference:
|
|
13
13
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: obsidian-bases
|
|
3
|
-
description: Create and edit Obsidian Bases (.base files) with views, filters, formulas, and summaries. Use when working with .base files, creating database-like views of notes, or when the user mentions Bases, table views, card views, filters, or formulas in Obsidian.
|
|
3
|
+
description: Create and edit Obsidian Bases (.base files) with views, filters, formulas, and summaries. Use when working with .base files, creating database-like views of notes, or when the user mentions Bases, table views, card views, kanban boards, filters, or formulas in Obsidian.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Obsidian Bases Skill
|
|
@@ -10,9 +10,9 @@ description: Create and edit Obsidian Bases (.base files) with views, filters, f
|
|
|
10
10
|
1. **Create the file**: Create a `.base` file in the vault with valid YAML content
|
|
11
11
|
2. **Define scope**: Add `filters` to select which notes appear (by tag, folder, property, or date)
|
|
12
12
|
3. **Add formulas** (optional): Define computed properties in the `formulas` section
|
|
13
|
-
4. **Configure views**: Add one or more views (`table`, `cards`, `list`, or `
|
|
13
|
+
4. **Configure views**: Add one or more views (`table`, `cards`, `list`, `map`, or `kanban`) with `order` specifying which properties to display
|
|
14
14
|
5. **Validate**: Verify the file is valid YAML with no syntax errors. Check that all referenced properties and formulas exist. Common issues: unquoted strings containing special YAML characters, mismatched quotes in formula expressions, referencing `formula.X` without defining `X` in `formulas`
|
|
15
|
-
6. **Test in Obsidian**: Open the `.base` file in Obsidian to confirm the view renders correctly. If it shows a YAML error, check quoting rules below
|
|
15
|
+
6. **Test in Obsidian**: Open the `.base` file in Obsidian to confirm the view renders correctly. If it shows a YAML error, check quoting rules below. If it doesn't open as a base at all, check that Bases is turned on in Settings → Core plugins
|
|
16
16
|
|
|
17
17
|
## Schema
|
|
18
18
|
|
|
@@ -32,9 +32,10 @@ filters:
|
|
|
32
32
|
formulas:
|
|
33
33
|
formula_name: 'expression'
|
|
34
34
|
|
|
35
|
-
# Configure display names and settings for properties
|
|
35
|
+
# Configure display names and settings for properties.
|
|
36
|
+
# Note properties need the `note.` prefix here, or the setting is ignored.
|
|
36
37
|
properties:
|
|
37
|
-
property_name:
|
|
38
|
+
note.property_name:
|
|
38
39
|
displayName: "Display Name"
|
|
39
40
|
formula.formula_name:
|
|
40
41
|
displayName: "Formula Display Name"
|
|
@@ -47,12 +48,18 @@ summaries:
|
|
|
47
48
|
|
|
48
49
|
# Define one or more views
|
|
49
50
|
views:
|
|
50
|
-
- type: table | cards | list | map
|
|
51
|
+
- type: table | cards | list | map | kanban
|
|
51
52
|
name: "View Name"
|
|
52
53
|
limit: 10 # Optional: limit results
|
|
53
54
|
groupBy: # Optional: group results
|
|
54
55
|
property: property_name
|
|
55
56
|
direction: ASC | DESC
|
|
57
|
+
groupOrder: # Optional: only these groups, in this order
|
|
58
|
+
- value_one
|
|
59
|
+
- null # Files with no value for the groupBy property
|
|
60
|
+
sort: # Optional: sort results (supports multiple properties)
|
|
61
|
+
- property: property_name
|
|
62
|
+
direction: ASC | DESC
|
|
56
63
|
filters: # View-specific filters follow the same rules
|
|
57
64
|
and:
|
|
58
65
|
- 'status == "active"'
|
|
@@ -125,6 +132,8 @@ filters:
|
|
|
125
132
|
2. **File properties** - File metadata: `file.name`, `file.mtime`, etc.
|
|
126
133
|
3. **Formula properties** - Computed values: `formula.my_formula`
|
|
127
134
|
|
|
135
|
+
In `order`, `filters`, `groupBy`, and `sort`, a note property can be written bare (`author`) or prefixed (`note.author`). In the top-level `properties:` section, always write `note.author`, because Obsidian ignores a bare key there and shows the raw name as the column header.
|
|
136
|
+
|
|
128
137
|
### File Properties Reference
|
|
129
138
|
|
|
130
139
|
| Property | Type | Description |
|
|
@@ -139,9 +148,10 @@ filters:
|
|
|
139
148
|
| `file.mtime` | Date | Modified time |
|
|
140
149
|
| `file.tags` | List | All tags in file |
|
|
141
150
|
| `file.links` | List | Internal links in file |
|
|
142
|
-
| `file.backlinks` | List | Files linking to this file |
|
|
151
|
+
| `file.backlinks` | List | Files linking to this file. Slow in large vaults and doesn't refresh when the vault changes; prefer reversing the lookup with `file.links` |
|
|
143
152
|
| `file.embeds` | List | Embeds in the note |
|
|
144
|
-
| `file.properties` | Object | All frontmatter properties |
|
|
153
|
+
| `file.properties` | Object | All frontmatter properties. Doesn't refresh when the vault changes |
|
|
154
|
+
| `file.file` | File | File object, only usable in specific functions |
|
|
145
155
|
|
|
146
156
|
### The `this` Keyword
|
|
147
157
|
|
|
@@ -257,6 +267,26 @@ views:
|
|
|
257
267
|
- status
|
|
258
268
|
```
|
|
259
269
|
|
|
270
|
+
### Kanban View
|
|
271
|
+
|
|
272
|
+
Requires Obsidian 1.14+. Cards are grouped into columns by the `groupBy` property, which a kanban view needs. `groupOrder` sets which columns show and in what order; use `null` to include files with no value. Without `groupOrder`, every value gets a column. Dragging a card to another column updates that property in the note. Only Markdown notes can be moved, except when grouping by `file.folder`, where moving a card moves the file to that folder. When grouping by a formula or by a file property other than `file.folder`, cards and columns can't be moved and notes can't be created from a column.
|
|
273
|
+
|
|
274
|
+
```yaml
|
|
275
|
+
views:
|
|
276
|
+
- type: kanban
|
|
277
|
+
name: "Projects"
|
|
278
|
+
groupBy:
|
|
279
|
+
property: note.status
|
|
280
|
+
direction: ASC
|
|
281
|
+
groupOrder:
|
|
282
|
+
- Planned
|
|
283
|
+
- In progress
|
|
284
|
+
- Done
|
|
285
|
+
order:
|
|
286
|
+
- file.name
|
|
287
|
+
- due_date
|
|
288
|
+
```
|
|
289
|
+
|
|
260
290
|
### Map View
|
|
261
291
|
|
|
262
292
|
Requires latitude/longitude properties and the Maps community plugin.
|
|
@@ -268,6 +298,35 @@ views:
|
|
|
268
298
|
# Map-specific settings for lat/lng properties
|
|
269
299
|
```
|
|
270
300
|
|
|
301
|
+
## Sorting
|
|
302
|
+
|
|
303
|
+
Sort results by one or more properties. Each sort entry specifies a `property` and `direction`, which must be uppercase `ASC` or `DESC`; an entry with any other value, or a sort written as a string, is silently ignored. Multiple sort entries are applied in order — the first entry is the primary sort key, subsequent entries break ties.
|
|
304
|
+
|
|
305
|
+
```yaml
|
|
306
|
+
views:
|
|
307
|
+
- type: table
|
|
308
|
+
name: "Sorted Tasks"
|
|
309
|
+
sort:
|
|
310
|
+
- property: due
|
|
311
|
+
direction: ASC
|
|
312
|
+
- property: file.name
|
|
313
|
+
direction: ASC
|
|
314
|
+
order:
|
|
315
|
+
- file.name
|
|
316
|
+
- due
|
|
317
|
+
- status
|
|
318
|
+
```
|
|
319
|
+
|
|
320
|
+
Sort options depend on the property type:
|
|
321
|
+
|
|
322
|
+
| Property Type | ASC | DESC |
|
|
323
|
+
|---------------|-----|------|
|
|
324
|
+
| Text | A→Z | Z→A |
|
|
325
|
+
| Number | 0→9 | 9→0 |
|
|
326
|
+
| Date | Old→New | New→Old |
|
|
327
|
+
|
|
328
|
+
You can sort by any property including formulas (`formula.my_formula`), file properties (`file.mtime`), and note properties.
|
|
329
|
+
|
|
271
330
|
## Default Summary Formulas
|
|
272
331
|
|
|
273
332
|
| Name | Input Type | Description |
|
|
@@ -304,7 +363,7 @@ formulas:
|
|
|
304
363
|
priority_label: 'if(priority == 1, "🔴 High", if(priority == 2, "🟡 Medium", "🟢 Low"))'
|
|
305
364
|
|
|
306
365
|
properties:
|
|
307
|
-
status:
|
|
366
|
+
note.status:
|
|
308
367
|
displayName: Status
|
|
309
368
|
formula.days_until_due:
|
|
310
369
|
displayName: "Days Until Due"
|
|
@@ -326,6 +385,11 @@ views:
|
|
|
326
385
|
groupBy:
|
|
327
386
|
property: status
|
|
328
387
|
direction: ASC
|
|
388
|
+
sort:
|
|
389
|
+
- property: due
|
|
390
|
+
direction: ASC
|
|
391
|
+
- property: file.name
|
|
392
|
+
direction: ASC
|
|
329
393
|
summaries:
|
|
330
394
|
formula.days_until_due: Average
|
|
331
395
|
|
|
@@ -353,10 +417,10 @@ formulas:
|
|
|
353
417
|
year_read: 'if(finished_date, date(finished_date).year, "")'
|
|
354
418
|
|
|
355
419
|
properties:
|
|
356
|
-
author:
|
|
420
|
+
note.author:
|
|
357
421
|
displayName: Author
|
|
358
422
|
formula.status_icon:
|
|
359
|
-
displayName: ""
|
|
423
|
+
displayName: "Status"
|
|
360
424
|
formula.reading_time:
|
|
361
425
|
displayName: "Est. Time"
|
|
362
426
|
|
|
@@ -415,7 +479,9 @@ views:
|
|
|
415
479
|
|
|
416
480
|
## Embedding Bases
|
|
417
481
|
|
|
418
|
-
Embed
|
|
482
|
+
### Embed a `.base` file
|
|
483
|
+
|
|
484
|
+
Embed an external `.base` file in any Markdown note:
|
|
419
485
|
|
|
420
486
|
```markdown
|
|
421
487
|
![[MyBase.base]]
|
|
@@ -424,6 +490,26 @@ Embed in Markdown files:
|
|
|
424
490
|
![[MyBase.base#View Name]]
|
|
425
491
|
```
|
|
426
492
|
|
|
493
|
+
### Embed inline with a code block
|
|
494
|
+
|
|
495
|
+
Bases can also be embedded **inline** directly inside a note using a `base` fenced code block. This is useful for note-level filters (e.g. using `this.file.links`) and avoids creating a separate `.base` file:
|
|
496
|
+
|
|
497
|
+
````markdown
|
|
498
|
+
```base
|
|
499
|
+
filters:
|
|
500
|
+
and:
|
|
501
|
+
- file.hasTag("example")
|
|
502
|
+
views:
|
|
503
|
+
- type: table
|
|
504
|
+
name: Table
|
|
505
|
+
order:
|
|
506
|
+
- file.name
|
|
507
|
+
- status
|
|
508
|
+
```
|
|
509
|
+
````
|
|
510
|
+
|
|
511
|
+
When embedded inline this way, the `this` keyword refers to the containing note, so you can build per-note views such as showing all notes linked from the current file.
|
|
512
|
+
|
|
427
513
|
## YAML Quoting Rules
|
|
428
514
|
|
|
429
515
|
- Use single quotes for formulas containing double quotes: `'if(done, "Yes", "No")'`
|
|
@@ -434,7 +520,7 @@ Embed in Markdown files:
|
|
|
434
520
|
|
|
435
521
|
### YAML Syntax Errors
|
|
436
522
|
|
|
437
|
-
**Unquoted special characters**: Strings containing `:`, `{`, `}`, `[`, `]`, `,`, `&`, `*`, `#`, `?`, `|`, `-`, `<`, `>`, `=`,
|
|
523
|
+
**Unquoted special characters**: Strings containing `:`, `{`, `}`, `[`, `]`, `,`, `&`, `*`, `#`, `?`, `|`, `-`, `<`, `>`, `=`, `%`, `@`, `` ` ``, `!` must be quoted.
|
|
438
524
|
|
|
439
525
|
```yaml
|
|
440
526
|
# WRONG - colon in unquoted string
|
|
@@ -478,6 +564,22 @@ formulas:
|
|
|
478
564
|
'if(due_date, (date(due_date) - today()).days, "")'
|
|
479
565
|
```
|
|
480
566
|
|
|
567
|
+
**`displayName` ignored, column shows the raw name**: prefix note properties with `note.` in the `properties:` section.
|
|
568
|
+
|
|
569
|
+
```yaml
|
|
570
|
+
# WRONG - displayName ignored, column header shows "status"
|
|
571
|
+
properties:
|
|
572
|
+
status:
|
|
573
|
+
displayName: Status
|
|
574
|
+
|
|
575
|
+
# CORRECT - column header shows "Status"
|
|
576
|
+
properties:
|
|
577
|
+
note.status:
|
|
578
|
+
displayName: Status
|
|
579
|
+
```
|
|
580
|
+
|
|
581
|
+
**Empty `displayName` doesn't hide a header**: `displayName: ""` falls back to the property name, the same as leaving it out, so `formula.status_icon` shows `status_icon`. Use a non-empty name such as `displayName: "Status"`.
|
|
582
|
+
|
|
481
583
|
**Referencing undefined formulas**: Ensure every `formula.X` in `order` or `properties` has a matching entry in `formulas`.
|
|
482
584
|
|
|
483
585
|
```yaml
|
|
@@ -7,6 +7,16 @@ description: Interact with Obsidian vaults using the Obsidian CLI to read, creat
|
|
|
7
7
|
|
|
8
8
|
Use the `obsidian` CLI to interact with a running Obsidian instance. Requires Obsidian to be open.
|
|
9
9
|
|
|
10
|
+
## Before using the CLI
|
|
11
|
+
|
|
12
|
+
Run `obsidian help` to check availability. If the command is missing, explain how to turn on the CLI using https://help.obsidian.md/cli. The `obsidian` command ships with the Obsidian installer; don't install the unrelated npm package `obsidian-cli`. If it can't find Obsidian, ask the user to open the desktop app, then retry. In a sandboxed shell the same message can mean the sandbox blocked the CLI's local socket.
|
|
13
|
+
|
|
14
|
+
On WSL, run `Obsidian.com` from the Windows install folder, not `Obsidian.exe`. `Obsidian.com` is the console wrapper that prints the output; `Obsidian.exe` exits without printing anything.
|
|
15
|
+
|
|
16
|
+
The CLI exits with status 0 even when a command fails, so read its output before reporting that a command succeeded.
|
|
17
|
+
|
|
18
|
+
Quote parameters for the current shell, and pass note text as literal argument data, never as executable shell syntax.
|
|
19
|
+
|
|
10
20
|
## Command reference
|
|
11
21
|
|
|
12
22
|
Run `obsidian help` to see all available commands. This is always up to date. Full docs: https://help.obsidian.md/cli
|
|
@@ -22,32 +32,44 @@ obsidian create name="My Note" content="Hello world"
|
|
|
22
32
|
**Flags** are boolean switches with no value:
|
|
23
33
|
|
|
24
34
|
```bash
|
|
25
|
-
obsidian create name="My Note"
|
|
35
|
+
obsidian create name="My Note" open overwrite
|
|
26
36
|
```
|
|
27
37
|
|
|
28
|
-
|
|
38
|
+
Use `overwrite` only when replacing an existing file is intended.
|
|
39
|
+
|
|
40
|
+
Opening is opt-in: pass `open` to open the file, and add `newtab` to open it in a new tab. There is no `silent` flag.
|
|
41
|
+
|
|
42
|
+
In `content=`, `\n` becomes a newline and `\t` a tab. Every `\n` and `\t` is converted and there's no escape, so text such as the LaTeX `\theta` or the path `C:\notes` is corrupted. Write content that contains backslashes, or is longer than about 4 KB, directly to the note's file instead.
|
|
43
|
+
|
|
44
|
+
A dot in a file name is read as the start of an extension. When a name contains a dot, include the extension: `create name="Meeting 2026.11.06.md"`, `rename name="v1.2 notes.md"`, `move to="Archive 2026.10/Note.md"`.
|
|
29
45
|
|
|
30
46
|
## File targeting
|
|
31
47
|
|
|
32
48
|
Many commands accept `file` or `path` to target a file. Without either, the active file is used.
|
|
33
49
|
|
|
34
|
-
- `file=<name>` — resolves like a wikilink (name only, no path
|
|
50
|
+
- `file=<name>` — resolves like a wikilink (name only, no path needed). `.md` is optional; other file types need their extension, e.g. `file="Projects.base"`. Aliases don't resolve.
|
|
35
51
|
- `path=<path>` — exact path from vault root, e.g. `folder/note.md`
|
|
36
52
|
|
|
37
53
|
## Vault targeting
|
|
38
54
|
|
|
39
|
-
|
|
55
|
+
Without `vault=`, commands target the vault that contains the current directory, then the most recently focused vault. `vault=<name>` only works as the first parameter; anywhere else it's ignored:
|
|
40
56
|
|
|
41
57
|
```bash
|
|
42
58
|
obsidian vault="My Vault" search query="test"
|
|
43
59
|
```
|
|
44
60
|
|
|
61
|
+
Use `vault=` when the user has selected a vault. If the target is unclear and the user has several vaults, ask which one before changing files.
|
|
62
|
+
|
|
45
63
|
## Common patterns
|
|
46
64
|
|
|
47
65
|
```bash
|
|
48
66
|
obsidian read file="My Note"
|
|
49
|
-
obsidian create name="New Note"
|
|
67
|
+
obsidian create name="New Note" template="Template" # a template replaces content=
|
|
68
|
+
obsidian create name="New Note" content="# Hello" open # also open in Obsidian
|
|
50
69
|
obsidian append file="My Note" content="New line"
|
|
70
|
+
obsidian rename path="folder/note.md" name="New name"
|
|
71
|
+
obsidian move path="folder/note.md" to="archive/"
|
|
72
|
+
obsidian delete path="folder/note.md"
|
|
51
73
|
obsidian search query="search term" limit=10
|
|
52
74
|
obsidian daily:read
|
|
53
75
|
obsidian daily:append content="- [ ] New task"
|
|
@@ -57,13 +79,24 @@ obsidian tags sort=count counts
|
|
|
57
79
|
obsidian backlinks file="My Note"
|
|
58
80
|
```
|
|
59
81
|
|
|
60
|
-
Use
|
|
82
|
+
Use `rename` and `move`, not filesystem `mv` or `obsidian eval`, so Obsidian can update links to the file. If other notes link to it and Settings → Files and links → Automatically update internal links is off, Obsidian asks in a dialog and the command waits until someone answers. `delete` moves the file to the trash; don't pass `permanent` unless the user asks for it. Prefer `create` and `append` over `eval` for writing note bodies.
|
|
83
|
+
|
|
84
|
+
Use `total` on list commands to get a count.
|
|
85
|
+
|
|
86
|
+
**Output options placement:** `--copy`, `--json`, `--md`, `--tsv`, and `--csv` only work **after** the command name. Putting them before the command (or before `vault=`) fails — often as `Command "--copy" not found` — because the first token is treated as the command. Prefer `vault=` first when used; put double-dash options last:
|
|
87
|
+
|
|
88
|
+
```bash
|
|
89
|
+
obsidian tasks todo total --copy
|
|
90
|
+
obsidian vault="My Vault" search query="TODO" --copy
|
|
91
|
+
obsidian tasks todo format=json # many list commands also accept format=
|
|
92
|
+
# Wrong: obsidian --copy vault="My Vault" tasks todo
|
|
93
|
+
```
|
|
61
94
|
|
|
62
95
|
## Plugin development
|
|
63
96
|
|
|
64
97
|
### Develop/test cycle
|
|
65
98
|
|
|
66
|
-
After making code changes to a plugin or theme, follow this workflow:
|
|
99
|
+
Turn on console capture once with `obsidian dev:debug on`, so messages from the reload are kept. After making code changes to a plugin or theme, follow this workflow:
|
|
67
100
|
|
|
68
101
|
1. **Reload** the plugin to pick up changes:
|
|
69
102
|
```bash
|
|
@@ -75,7 +108,7 @@ After making code changes to a plugin or theme, follow this workflow:
|
|
|
75
108
|
```
|
|
76
109
|
3. **Verify visually** with a screenshot or DOM inspection:
|
|
77
110
|
```bash
|
|
78
|
-
obsidian dev:screenshot
|
|
111
|
+
obsidian dev:screenshot
|
|
79
112
|
obsidian dev:dom selector=".workspace-leaf" text
|
|
80
113
|
```
|
|
81
114
|
4. **Check console output** for warnings or unexpected logs:
|
|
@@ -83,9 +116,11 @@ After making code changes to a plugin or theme, follow this workflow:
|
|
|
83
116
|
obsidian dev:console level=error
|
|
84
117
|
```
|
|
85
118
|
|
|
119
|
+
`dev:screenshot` saves to a temporary file and prints its path. A relative `path=` saves inside the vault.
|
|
120
|
+
|
|
86
121
|
### Additional developer commands
|
|
87
122
|
|
|
88
|
-
Run JavaScript in the app context:
|
|
123
|
+
Run JavaScript in the app context (prefer dedicated commands like `rename`, `move`, `create`, and `append` for vault mutations):
|
|
89
124
|
|
|
90
125
|
```bash
|
|
91
126
|
obsidian eval code="app.vault.getFiles().length"
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: obsidian-headless
|
|
3
|
+
description: Sync and publish Obsidian vaults from the command line with Obsidian Headless (`ob`), without the desktop app. Use when the user wants to set up or run Obsidian Sync or Obsidian Publish on a server, in CI, or from a terminal, or change a vault's Sync or Publish settings.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Obsidian Headless
|
|
7
|
+
|
|
8
|
+
Use Obsidian Headless (`ob`) to run Obsidian Sync and Obsidian Publish from the command line. It doesn't need the desktop app, so it works on servers, in CI, and in sandboxes. It's in open beta. Docs: https://help.obsidian.md/headless
|
|
9
|
+
|
|
10
|
+
`ob` only syncs and publishes files. To read or change notes without the app, edit the files directly and follow the obsidian-markdown skill. To control a running desktop app, use the obsidian-cli skill.
|
|
11
|
+
|
|
12
|
+
## Before using ob
|
|
13
|
+
|
|
14
|
+
Check availability with `ob --help`. If it is missing, explain that Obsidian Headless requires Node.js 22 or later and offer installation with `npm install -g obsidian-headless`. Run `ob <command> --help` for a command's options.
|
|
15
|
+
|
|
16
|
+
Sync and Publish each need an active subscription on the user's account.
|
|
17
|
+
|
|
18
|
+
Most commands accept `--json` for machine-readable output.
|
|
19
|
+
|
|
20
|
+
## Log in
|
|
21
|
+
|
|
22
|
+
`ob login` prints the account when already logged in. Otherwise it prompts for email, password, and a 2FA code, so ask the user to run it in their own terminal. Don't ask for their password or pass it with `--password`. `ob logout` clears the stored credentials.
|
|
23
|
+
|
|
24
|
+
## Vault paths
|
|
25
|
+
|
|
26
|
+
Commands act on the vault in the current directory, or the one given with `--path`. Pass `--path` so the target is explicit. Before a command that changes remote state, confirm the vault, site, and path from list or status output.
|
|
27
|
+
|
|
28
|
+
## Sync
|
|
29
|
+
|
|
30
|
+
Don't use the desktop app's Sync and Headless Sync for the same vault on the same device, because they cause conflicts. Ask the user to back up the vault folder before the first sync.
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
ob sync-list-remote # remote vaults, including shared ones
|
|
34
|
+
ob sync-list-local # vaults set up on this machine
|
|
35
|
+
ob sync-setup --vault "Research" --path ~/vaults/research
|
|
36
|
+
ob sync --path ~/vaults/research # sync once
|
|
37
|
+
ob sync --path ~/vaults/research --continuous # keep syncing as files change
|
|
38
|
+
ob sync-status --path ~/vaults/research
|
|
39
|
+
ob sync-unlink --path ~/vaults/research # disconnect and remove stored credentials
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
`--vault` takes a remote vault's name or ID. For an end-to-end encrypted vault, `sync-setup` prompts for the encryption password, so let the user enter it. Set `--device-name` to label this machine in version history.
|
|
43
|
+
|
|
44
|
+
`--continuous` runs until stopped, so start it in the background or as a service.
|
|
45
|
+
|
|
46
|
+
`ob sync-create-remote --name "Research"` creates a remote vault. Add `--encryption e2ee` for end-to-end encryption or `--encryption standard` for managed encryption.
|
|
47
|
+
|
|
48
|
+
### Sync settings
|
|
49
|
+
|
|
50
|
+
`ob sync-config --path <vault>` prints the vault's settings. Change them with:
|
|
51
|
+
|
|
52
|
+
- `--mode bidirectional|pull-only|mirror-remote`. `pull-only` ignores local changes and `mirror-remote` reverts them, so confirm before setting either.
|
|
53
|
+
- `--conflict-strategy merge|conflict`
|
|
54
|
+
- `--excluded-folders "Archive,Templates"`
|
|
55
|
+
- `--file-types image,audio,video,pdf,unsupported` for the attachment types to sync.
|
|
56
|
+
- `--configs` for the settings categories to sync, e.g. `app,appearance,core-plugin`.
|
|
57
|
+
- `--config-dir` when the vault's configuration folder isn't `.obsidian`.
|
|
58
|
+
|
|
59
|
+
An empty string clears a list option, e.g. `--excluded-folders ""`.
|
|
60
|
+
|
|
61
|
+
## Publish
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
ob publish-list-sites
|
|
65
|
+
ob publish-setup --site my-notes --path ~/vaults/research
|
|
66
|
+
ob publish --path ~/vaults/research --dry-run
|
|
67
|
+
ob publish --path ~/vaults/research --yes
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
`ob publish` includes only notes with `publish: true` in their properties. `--all` includes every file, so use it only when the user asks. Run `--dry-run` first and show the user the changes. Without `--yes`, `ob publish` waits for confirmation, so pass `--yes` once the user approves or for an unattended job they set up.
|
|
71
|
+
|
|
72
|
+
`ob publish-create-site --slug my-notes` creates a site at `publish.obsidian.md/my-notes`.
|
|
73
|
+
|
|
74
|
+
Run these with no options to print the current settings:
|
|
75
|
+
|
|
76
|
+
- `ob publish-config` sets folders to include or exclude with `--includes` and `--excludes`.
|
|
77
|
+
- `ob publish-site-options` sets the site name, home page, navigation, theme, and other display options. Run `ob publish-site-options --help` for the full list.
|
|
78
|
+
|
|
79
|
+
`ob publish-unlink` disconnects the vault from its site.
|
|
@@ -27,6 +27,9 @@ Create and edit valid Obsidian Flavored Markdown. Obsidian extends CommonMark an
|
|
|
27
27
|
[[Note Name#^block-id]] Link to block
|
|
28
28
|
[[#Heading in same note]] Same-note heading link
|
|
29
29
|
```
|
|
30
|
+
Inside Markdown tables, escape wikilink alias pipes as `[[Note\|Alias]]` so the alias separator is not parsed as a table cell delimiter. When a table follows a paragraph, leave a blank line above it, or it renders as plain text.
|
|
31
|
+
|
|
32
|
+
Links resolve by file name, not by the `aliases` property. A bare `[[Alias]]` stays unresolved; write `[[Note|Alias]]` to show an alias.
|
|
30
33
|
|
|
31
34
|
Define a block ID by appending `^block-id` to any paragraph:
|
|
32
35
|
|
|
@@ -89,7 +92,7 @@ cssclasses:
|
|
|
89
92
|
---
|
|
90
93
|
```
|
|
91
94
|
|
|
92
|
-
Default properties: `tags` (searchable labels), `aliases` (alternative
|
|
95
|
+
Default properties: `tags` (searchable labels), `aliases` (alternative names offered in link suggestions; links still use the file name), `cssclasses` (CSS classes for styling).
|
|
93
96
|
|
|
94
97
|
See [PROPERTIES.md](references/PROPERTIES.md) for all property types, tag syntax rules, and advanced usage.
|
|
95
98
|
|
|
@@ -100,7 +103,7 @@ See [PROPERTIES.md](references/PROPERTIES.md) for all property types, tag syntax
|
|
|
100
103
|
#nested/tag Nested tag with hierarchy
|
|
101
104
|
```
|
|
102
105
|
|
|
103
|
-
Tags can contain letters, numbers
|
|
106
|
+
Tags can contain letters, numbers, underscores, hyphens, and forward slashes, but must include at least one non-numerical character (`#1984` is invalid, `#1984book` is valid). A space ends a tag, so `#my tag` is the tag `#my`. Tags can also be defined in frontmatter under the `tags` property.
|
|
104
107
|
|
|
105
108
|
## Comments
|
|
106
109
|
|
|
@@ -116,8 +119,11 @@ This entire block is hidden in reading view.
|
|
|
116
119
|
|
|
117
120
|
```markdown
|
|
118
121
|
==Highlighted text== Highlight syntax
|
|
122
|
+
==🔴Highlighted text== Colored highlight (Obsidian 1.14.1 and later)
|
|
119
123
|
```
|
|
120
124
|
|
|
125
|
+
A colored highlight starts with 🔴, 🟠, 🟡, 🟢, 🔵 or 🟣 (or the matching square) right after `==`. Other emoji stay as text.
|
|
126
|
+
|
|
121
127
|
## Math (LaTeX)
|
|
122
128
|
|
|
123
129
|
```markdown
|
|
@@ -31,12 +31,14 @@ due: 2024-02-01T14:30:00
|
|
|
31
31
|
| Date | `date: 2024-01-15` |
|
|
32
32
|
| Date & Time | `due: 2024-01-15T14:30:00` |
|
|
33
33
|
| List | `tags: [one, two]` or YAML list |
|
|
34
|
-
|
|
|
34
|
+
| Tags | Only for the `tags` property |
|
|
35
|
+
|
|
36
|
+
Links go in Text or List properties: `related: "[[Other Note]]"`. Always quote wikilinks in YAML, because an unquoted `[[Other Note]]` is read as a nested list, not a link.
|
|
35
37
|
|
|
36
38
|
## Default Properties
|
|
37
39
|
|
|
38
40
|
- `tags` - Note tags (searchable, shown in graph view)
|
|
39
|
-
- `aliases` - Alternative names for the note
|
|
41
|
+
- `aliases` - Alternative names for the note, offered in link suggestions. A bare `[[Alias]]` doesn't resolve; write `[[Note|Alias]]`
|
|
40
42
|
- `cssclasses` - CSS classes applied to the note in reading/editing view
|
|
41
43
|
|
|
42
44
|
## Tags
|
|
@@ -48,7 +50,7 @@ due: 2024-02-01T14:30:00
|
|
|
48
50
|
#tag_with_underscores
|
|
49
51
|
```
|
|
50
52
|
|
|
51
|
-
Tags can contain: letters (any language), numbers
|
|
53
|
+
Tags can contain: letters (any language), numbers, underscores `_`, hyphens `-`, forward slashes `/` (for nesting). A tag needs at least one non-numerical character (`#1984book`, not `#1984`), and a space ends it.
|
|
52
54
|
|
|
53
55
|
In frontmatter:
|
|
54
56
|
|
package/skills.manifest.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"source": "generated by scripts/sync-skills.mjs",
|
|
3
3
|
"upstream": "https://github.com/kepano/obsidian-skills",
|
|
4
|
-
"skillCount":
|
|
5
|
-
"fileCount":
|
|
4
|
+
"skillCount": 7,
|
|
5
|
+
"fileCount": 12,
|
|
6
6
|
"skills": [
|
|
7
7
|
{
|
|
8
8
|
"name": "defuddle",
|
|
@@ -24,6 +24,10 @@
|
|
|
24
24
|
"name": "obsidian-cli",
|
|
25
25
|
"files": 1
|
|
26
26
|
},
|
|
27
|
+
{
|
|
28
|
+
"name": "obsidian-headless",
|
|
29
|
+
"files": 1
|
|
30
|
+
},
|
|
27
31
|
{
|
|
28
32
|
"name": "obsidian-markdown",
|
|
29
33
|
"files": 4
|