mirror of
https://github.com/kepano/obsidian-skills.git
synced 2026-12-05 10:05:18 -08:00
Compare commits
19 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 398127736b | |||
| 85add51f43 | |||
| 96cf4d19ff | |||
| 48a7ca3f32 | |||
| 37a56a6a58 | |||
| 15272076ad | |||
| 9cab7195e3 | |||
| 192500ad0d | |||
| 5153119854 | |||
| 04df0be8a2 | |||
| caf8f550f0 | |||
| ec45905ff2 | |||
| b178fdfbb7 | |||
| 3436b16881 | |||
| 086e1e95e9 | |||
| 47e9b1fde7 | |||
| a652d28755 | |||
| 518818deb7 | |||
| 25817fa4c8 |
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "obsidian-skills",
|
"name": "obsidian-skills",
|
||||||
"description": "Agent Skills for Obsidian Markdown, Bases, JSON Canvas, the Obsidian CLI, Defuddle, and Knap.",
|
"description": "Agent Skills for Obsidian Markdown, Bases, JSON Canvas, the Obsidian CLI, Obsidian Headless, Defuddle, and Knap.",
|
||||||
"owner": {
|
"owner": {
|
||||||
"name": "Obsidian",
|
"name": "Obsidian",
|
||||||
"url": "https://obsidian.md/"
|
"url": "https://obsidian.md/"
|
||||||
@@ -9,8 +9,8 @@
|
|||||||
{
|
{
|
||||||
"name": "obsidian",
|
"name": "obsidian",
|
||||||
"source": "./plugins/obsidian",
|
"source": "./plugins/obsidian",
|
||||||
"description": "Work with local Obsidian vaults using the Obsidian CLI and skills for Markdown, Bases, Canvas, web extraction, and templates.",
|
"description": "Work with local Obsidian vaults using the Obsidian CLI and skills for Markdown, Bases, Canvas, Sync and Publish, web extraction, and templates.",
|
||||||
"version": "1.1.0"
|
"version": "1.2.0"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,13 +4,13 @@
|
|||||||
"name": "Obsidian"
|
"name": "Obsidian"
|
||||||
},
|
},
|
||||||
"metadata": {
|
"metadata": {
|
||||||
"description": "Agent Skills for Obsidian Markdown, Bases, JSON Canvas, the Obsidian CLI, Defuddle, and Knap."
|
"description": "Agent Skills for Obsidian Markdown, Bases, JSON Canvas, the Obsidian CLI, Obsidian Headless, Defuddle, and Knap."
|
||||||
},
|
},
|
||||||
"plugins": [
|
"plugins": [
|
||||||
{
|
{
|
||||||
"name": "obsidian",
|
"name": "obsidian",
|
||||||
"source": "./plugins/obsidian",
|
"source": "./plugins/obsidian",
|
||||||
"description": "Work with local Obsidian vaults using the Obsidian CLI and skills for Markdown, Bases, Canvas, web extraction, and templates."
|
"description": "Work with local Obsidian vaults using the Obsidian CLI and skills for Markdown, Bases, Canvas, Sync and Publish, web extraction, and templates."
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -86,5 +86,6 @@ The script also accepts `major`, `minor`, or an explicit version like `1.1.0`.
|
|||||||
| [obsidian-bases](plugins/obsidian/skills/obsidian-bases) | Create and edit [Obsidian Bases](https://help.obsidian.md/bases/syntax) (`.base`) with views, filters, formulas, and summaries |
|
| [obsidian-bases](plugins/obsidian/skills/obsidian-bases) | Create and edit [Obsidian Bases](https://help.obsidian.md/bases/syntax) (`.base`) with views, filters, formulas, and summaries |
|
||||||
| [json-canvas](plugins/obsidian/skills/json-canvas) | Create and edit [JSON Canvas](https://jsoncanvas.org/) files (`.canvas`) with nodes, edges, groups, and connections |
|
| [json-canvas](plugins/obsidian/skills/json-canvas) | Create and edit [JSON Canvas](https://jsoncanvas.org/) files (`.canvas`) with nodes, edges, groups, and connections |
|
||||||
| [obsidian-cli](plugins/obsidian/skills/obsidian-cli) | Interact with Obsidian vaults via the [Obsidian CLI](https://help.obsidian.md/cli) including plugin and theme development |
|
| [obsidian-cli](plugins/obsidian/skills/obsidian-cli) | Interact with Obsidian vaults via the [Obsidian CLI](https://help.obsidian.md/cli) including plugin and theme development |
|
||||||
|
| [obsidian-headless](plugins/obsidian/skills/obsidian-headless) | Sync and publish vaults from the command line with [Obsidian Headless](https://help.obsidian.md/headless), without the desktop app |
|
||||||
| [defuddle](plugins/obsidian/skills/defuddle) | Extract clean markdown from web pages using [Defuddle](https://github.com/kepano/defuddle), removing clutter to save tokens |
|
| [defuddle](plugins/obsidian/skills/defuddle) | Extract clean markdown from web pages using [Defuddle](https://github.com/kepano/defuddle), removing clutter to save tokens |
|
||||||
| [knap](plugins/obsidian/skills/knap) | Render Markdown templates from JSON or CSV data using [Knap](https://github.com/obsidianmd/knap), including batch file generation |
|
| [knap](plugins/obsidian/skills/knap) | Render Markdown templates from JSON or CSV data using [Knap](https://github.com/obsidianmd/knap), including batch file generation |
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "obsidian",
|
"name": "obsidian",
|
||||||
"version": "1.1.0",
|
"version": "1.2.0",
|
||||||
"description": "Work with local Obsidian vaults using the Obsidian CLI and skills for Markdown, Bases, Canvas, web extraction, and templates.",
|
"description": "Work with local Obsidian vaults using the Obsidian CLI and skills for Markdown, Bases, Canvas, Sync and Publish, web extraction, and templates.",
|
||||||
"author": {
|
"author": {
|
||||||
"name": "Obsidian",
|
"name": "Obsidian",
|
||||||
"url": "https://obsidian.md/"
|
"url": "https://obsidian.md/"
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "obsidian",
|
"name": "obsidian",
|
||||||
"version": "1.1.0",
|
"version": "1.2.0",
|
||||||
"description": "Work with local Obsidian vaults using the Obsidian CLI and skills for Markdown, Bases, Canvas, web extraction, and templates.",
|
"description": "Work with local Obsidian vaults using the Obsidian CLI and skills for Markdown, Bases, Canvas, Sync and Publish, web extraction, and templates.",
|
||||||
"author": {
|
"author": {
|
||||||
"name": "Obsidian"
|
"name": "Obsidian"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
# Obsidian
|
# Obsidian
|
||||||
|
|
||||||
Skills for working with Obsidian vaults: Obsidian Markdown, Bases, Canvas, the Obsidian CLI, web pages, and templates.
|
Skills for working with Obsidian vaults: Obsidian Markdown, Bases, Canvas, the Obsidian CLI, Obsidian Headless, web pages, and templates.
|
||||||
|
|
||||||
## Install
|
## Install
|
||||||
|
|
||||||
@@ -20,11 +20,12 @@ The CLI skill runs the `obsidian` command, which needs the Obsidian desktop app
|
|||||||
|
|
||||||
The Markdown, Bases, and Canvas skills only describe file formats, so they also work in chat.
|
The Markdown, Bases, and Canvas skills only describe file formats, so they also work in chat.
|
||||||
|
|
||||||
Web extraction uses [Defuddle](https://github.com/kepano/defuddle), which fetches the page you ask for. Template rendering uses [Knap](https://github.com/obsidianmd/knap), which needs Node.js 20 or later. Neither tool is bundled. When one is missing, the skill asks before installing it from npm.
|
Web extraction uses [Defuddle](https://github.com/kepano/defuddle), which fetches the page you ask for. Template rendering uses [Knap](https://github.com/obsidianmd/knap), which needs Node.js 20 or later. Sync and Publish use [Obsidian Headless](https://help.obsidian.md/headless), which needs Node.js 22 or later and a Sync or Publish subscription, and runs without the desktop app. None of these tools is bundled. When one is missing, the skill asks before installing it from npm.
|
||||||
|
|
||||||
## Included skills
|
## Included skills
|
||||||
|
|
||||||
- obsidian-cli: search, read, create, and manage notes through the running app.
|
- obsidian-cli: search, read, create, and manage notes through the running app.
|
||||||
|
- obsidian-headless: sync and publish vaults from the command line without the app.
|
||||||
- obsidian-markdown: Obsidian links, properties, callouts, and embeds.
|
- obsidian-markdown: Obsidian links, properties, callouts, and embeds.
|
||||||
- obsidian-bases: Bases files, views, filters, formulas, and summaries.
|
- obsidian-bases: Bases files, views, filters, formulas, and summaries.
|
||||||
- json-canvas: Canvas files with nodes, edges, groups, and connections.
|
- json-canvas: Canvas files with nodes, edges, groups, and connections.
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
{
|
{
|
||||||
"$schema": "https://agent-plugins.org/schemas/1.0.0/plugin.schema.json",
|
"$schema": "https://agent-plugins.org/schemas/1.0.0/plugin.schema.json",
|
||||||
"name": "obsidian",
|
"name": "obsidian",
|
||||||
"version": "1.1.0",
|
"version": "1.2.0",
|
||||||
"description": "Work with local Obsidian vaults using the Obsidian CLI and skills for Markdown, Bases, Canvas, web extraction, and templates.",
|
"description": "Work with local Obsidian vaults using the Obsidian CLI and skills for Markdown, Bases, Canvas, Sync and Publish, web extraction, and templates.",
|
||||||
"author": {
|
"author": {
|
||||||
"name": "Obsidian",
|
"name": "Obsidian",
|
||||||
"url": "https://obsidian.md/"
|
"url": "https://obsidian.md/"
|
||||||
@@ -24,7 +24,7 @@
|
|||||||
"interface": {
|
"interface": {
|
||||||
"displayName": "Obsidian",
|
"displayName": "Obsidian",
|
||||||
"shortDescription": "Work with your local vault",
|
"shortDescription": "Work with your local vault",
|
||||||
"longDescription": "Search, read, create, and organize notes in a local Obsidian vault. Create and edit Obsidian Markdown with links, properties, and callouts. This plugin also lets you build Bases views, Canvas diagrams, extract web pages to Markdown, and render templates.\n\nThis plugin is currently desktop-only and requires Obsidian to be open and running with the CLI enabled. In the future we will add MCP so you can interact with your vault remotely and in the ChatGPT mobile app.",
|
"longDescription": "Search, read, create, and organize notes in a local Obsidian vault. Create and edit Obsidian Markdown with links, properties, and callouts. This plugin also lets you build Bases views, Canvas diagrams, extract web pages to Markdown, render templates, and sync and publish vaults with Obsidian Headless.\n\nThis plugin is currently desktop-only and requires Obsidian to be open and running with the CLI enabled. In the future we will add MCP so you can interact with your vault remotely and in the ChatGPT mobile app.",
|
||||||
"category": "Productivity",
|
"category": "Productivity",
|
||||||
"developerName": "Obsidian",
|
"developerName": "Obsidian",
|
||||||
"defaultPrompt": [
|
"defaultPrompt": [
|
||||||
@@ -57,7 +57,7 @@
|
|||||||
},
|
},
|
||||||
"publication": {
|
"publication": {
|
||||||
"countries": [],
|
"countries": [],
|
||||||
"release_notes": "Six Obsidian skills for Markdown, Bases, Canvas, the Obsidian CLI, Defuddle, and Knap, with desktop execution metadata and setup guidance for the CLI and helper tools."
|
"release_notes": "Adds an Obsidian Headless skill to sync and publish vaults without the desktop app, kanban views in Bases, and fixes for Bases display names and the CLI on WSL."
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
name: obsidian-bases
|
name: obsidian-bases
|
||||||
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.
|
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.
|
||||||
---
|
---
|
||||||
|
|
||||||
# Obsidian Bases Skill
|
# Obsidian Bases Skill
|
||||||
@@ -10,9 +10,9 @@ description: Create and edit Obsidian Bases (.base files) with views, filters, f
|
|||||||
1. **Create the file**: Create a `.base` file in the vault with valid YAML content
|
1. **Create the file**: Create a `.base` file in the vault with valid YAML content
|
||||||
2. **Define scope**: Add `filters` to select which notes appear (by tag, folder, property, or date)
|
2. **Define scope**: Add `filters` to select which notes appear (by tag, folder, property, or date)
|
||||||
3. **Add formulas** (optional): Define computed properties in the `formulas` section
|
3. **Add formulas** (optional): Define computed properties in the `formulas` section
|
||||||
4. **Configure views**: Add one or more views (`table`, `cards`, `list`, or `map`) with `order` specifying which properties to display
|
4. **Configure views**: Add one or more views (`table`, `cards`, `list`, `map`, or `kanban`) with `order` specifying which properties to display
|
||||||
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`
|
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`
|
||||||
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
|
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
|
||||||
|
|
||||||
## Schema
|
## Schema
|
||||||
|
|
||||||
@@ -32,9 +32,10 @@ filters:
|
|||||||
formulas:
|
formulas:
|
||||||
formula_name: 'expression'
|
formula_name: 'expression'
|
||||||
|
|
||||||
# Configure display names and settings for properties
|
# Configure display names and settings for properties.
|
||||||
|
# Note properties need the `note.` prefix here, or the setting is ignored.
|
||||||
properties:
|
properties:
|
||||||
property_name:
|
note.property_name:
|
||||||
displayName: "Display Name"
|
displayName: "Display Name"
|
||||||
formula.formula_name:
|
formula.formula_name:
|
||||||
displayName: "Formula Display Name"
|
displayName: "Formula Display Name"
|
||||||
@@ -47,12 +48,15 @@ summaries:
|
|||||||
|
|
||||||
# Define one or more views
|
# Define one or more views
|
||||||
views:
|
views:
|
||||||
- type: table | cards | list | map
|
- type: table | cards | list | map | kanban
|
||||||
name: "View Name"
|
name: "View Name"
|
||||||
limit: 10 # Optional: limit results
|
limit: 10 # Optional: limit results
|
||||||
groupBy: # Optional: group results
|
groupBy: # Optional: group results
|
||||||
property: property_name
|
property: property_name
|
||||||
direction: ASC | DESC
|
direction: ASC | DESC
|
||||||
|
groupOrder: # Optional: only these groups, in this order
|
||||||
|
- value_one
|
||||||
|
- null # Files with no value for the groupBy property
|
||||||
sort: # Optional: sort results (supports multiple properties)
|
sort: # Optional: sort results (supports multiple properties)
|
||||||
- property: property_name
|
- property: property_name
|
||||||
direction: ASC | DESC
|
direction: ASC | DESC
|
||||||
@@ -128,6 +132,8 @@ filters:
|
|||||||
2. **File properties** - File metadata: `file.name`, `file.mtime`, etc.
|
2. **File properties** - File metadata: `file.name`, `file.mtime`, etc.
|
||||||
3. **Formula properties** - Computed values: `formula.my_formula`
|
3. **Formula properties** - Computed values: `formula.my_formula`
|
||||||
|
|
||||||
|
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.
|
||||||
|
|
||||||
### File Properties Reference
|
### File Properties Reference
|
||||||
|
|
||||||
| Property | Type | Description |
|
| Property | Type | Description |
|
||||||
@@ -142,9 +148,10 @@ filters:
|
|||||||
| `file.mtime` | Date | Modified time |
|
| `file.mtime` | Date | Modified time |
|
||||||
| `file.tags` | List | All tags in file |
|
| `file.tags` | List | All tags in file |
|
||||||
| `file.links` | List | Internal links in file |
|
| `file.links` | List | Internal links in file |
|
||||||
| `file.backlinks` | List | Files linking to this file |
|
| `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` |
|
||||||
| `file.embeds` | List | Embeds in the note |
|
| `file.embeds` | List | Embeds in the note |
|
||||||
| `file.properties` | Object | All frontmatter properties |
|
| `file.properties` | Object | All frontmatter properties. Doesn't refresh when the vault changes |
|
||||||
|
| `file.file` | File | File object, only usable in specific functions |
|
||||||
|
|
||||||
### The `this` Keyword
|
### The `this` Keyword
|
||||||
|
|
||||||
@@ -260,6 +267,26 @@ views:
|
|||||||
- status
|
- status
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Kanban View
|
||||||
|
|
||||||
|
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.
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
views:
|
||||||
|
- type: kanban
|
||||||
|
name: "Projects"
|
||||||
|
groupBy:
|
||||||
|
property: note.status
|
||||||
|
direction: ASC
|
||||||
|
groupOrder:
|
||||||
|
- Planned
|
||||||
|
- In progress
|
||||||
|
- Done
|
||||||
|
order:
|
||||||
|
- file.name
|
||||||
|
- due_date
|
||||||
|
```
|
||||||
|
|
||||||
### Map View
|
### Map View
|
||||||
|
|
||||||
Requires latitude/longitude properties and the Maps community plugin.
|
Requires latitude/longitude properties and the Maps community plugin.
|
||||||
@@ -336,7 +363,7 @@ formulas:
|
|||||||
priority_label: 'if(priority == 1, "🔴 High", if(priority == 2, "🟡 Medium", "🟢 Low"))'
|
priority_label: 'if(priority == 1, "🔴 High", if(priority == 2, "🟡 Medium", "🟢 Low"))'
|
||||||
|
|
||||||
properties:
|
properties:
|
||||||
status:
|
note.status:
|
||||||
displayName: Status
|
displayName: Status
|
||||||
formula.days_until_due:
|
formula.days_until_due:
|
||||||
displayName: "Days Until Due"
|
displayName: "Days Until Due"
|
||||||
@@ -390,10 +417,10 @@ formulas:
|
|||||||
year_read: 'if(finished_date, date(finished_date).year, "")'
|
year_read: 'if(finished_date, date(finished_date).year, "")'
|
||||||
|
|
||||||
properties:
|
properties:
|
||||||
author:
|
note.author:
|
||||||
displayName: Author
|
displayName: Author
|
||||||
formula.status_icon:
|
formula.status_icon:
|
||||||
displayName: ""
|
displayName: "Status"
|
||||||
formula.reading_time:
|
formula.reading_time:
|
||||||
displayName: "Est. Time"
|
displayName: "Est. Time"
|
||||||
|
|
||||||
@@ -537,6 +564,22 @@ formulas:
|
|||||||
'if(due_date, (date(due_date) - today()).days, "")'
|
'if(due_date, (date(due_date) - today()).days, "")'
|
||||||
```
|
```
|
||||||
|
|
||||||
|
**`displayName` ignored, column shows the raw name**: prefix note properties with `note.` in the `properties:` section.
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
# WRONG - displayName ignored, column header shows "status"
|
||||||
|
properties:
|
||||||
|
status:
|
||||||
|
displayName: Status
|
||||||
|
|
||||||
|
# CORRECT - column header shows "Status"
|
||||||
|
properties:
|
||||||
|
note.status:
|
||||||
|
displayName: Status
|
||||||
|
```
|
||||||
|
|
||||||
|
**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"`.
|
||||||
|
|
||||||
**Referencing undefined formulas**: Ensure every `formula.X` in `order` or `properties` has a matching entry in `formulas`.
|
**Referencing undefined formulas**: Ensure every `formula.X` in `order` or `properties` has a matching entry in `formulas`.
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
|
|||||||
@@ -11,6 +11,8 @@ Use the `obsidian` CLI to interact with a running Obsidian instance. Requires Ob
|
|||||||
|
|
||||||
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.
|
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.
|
||||||
|
|
||||||
|
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.
|
||||||
|
|
||||||
The CLI exits with status 0 even when a command fails, so read its output before reporting that a command succeeded.
|
The CLI exits with status 0 even when a command fails, so read its output before reporting that a command succeeded.
|
||||||
|
|
||||||
Quote parameters for the current shell, and pass note text as literal argument data, never as executable shell syntax.
|
Quote parameters for the current shell, and pass note text as literal argument data, never as executable shell syntax.
|
||||||
|
|||||||
@@ -0,0 +1,79 @@
|
|||||||
|
---
|
||||||
|
name: obsidian-headless
|
||||||
|
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.
|
||||||
|
---
|
||||||
|
|
||||||
|
# Obsidian Headless
|
||||||
|
|
||||||
|
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
|
||||||
|
|
||||||
|
`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.
|
||||||
|
|
||||||
|
## Before using ob
|
||||||
|
|
||||||
|
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.
|
||||||
|
|
||||||
|
Sync and Publish each need an active subscription on the user's account.
|
||||||
|
|
||||||
|
Most commands accept `--json` for machine-readable output.
|
||||||
|
|
||||||
|
## Log in
|
||||||
|
|
||||||
|
`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.
|
||||||
|
|
||||||
|
## Vault paths
|
||||||
|
|
||||||
|
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.
|
||||||
|
|
||||||
|
## Sync
|
||||||
|
|
||||||
|
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.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
ob sync-list-remote # remote vaults, including shared ones
|
||||||
|
ob sync-list-local # vaults set up on this machine
|
||||||
|
ob sync-setup --vault "Research" --path ~/vaults/research
|
||||||
|
ob sync --path ~/vaults/research # sync once
|
||||||
|
ob sync --path ~/vaults/research --continuous # keep syncing as files change
|
||||||
|
ob sync-status --path ~/vaults/research
|
||||||
|
ob sync-unlink --path ~/vaults/research # disconnect and remove stored credentials
|
||||||
|
```
|
||||||
|
|
||||||
|
`--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.
|
||||||
|
|
||||||
|
`--continuous` runs until stopped, so start it in the background or as a service.
|
||||||
|
|
||||||
|
`ob sync-create-remote --name "Research"` creates a remote vault. Add `--encryption e2ee` for end-to-end encryption or `--encryption standard` for managed encryption.
|
||||||
|
|
||||||
|
### Sync settings
|
||||||
|
|
||||||
|
`ob sync-config --path <vault>` prints the vault's settings. Change them with:
|
||||||
|
|
||||||
|
- `--mode bidirectional|pull-only|mirror-remote`. `pull-only` ignores local changes and `mirror-remote` reverts them, so confirm before setting either.
|
||||||
|
- `--conflict-strategy merge|conflict`
|
||||||
|
- `--excluded-folders "Archive,Templates"`
|
||||||
|
- `--file-types image,audio,video,pdf,unsupported` for the attachment types to sync.
|
||||||
|
- `--configs` for the settings categories to sync, e.g. `app,appearance,core-plugin`.
|
||||||
|
- `--config-dir` when the vault's configuration folder isn't `.obsidian`.
|
||||||
|
|
||||||
|
An empty string clears a list option, e.g. `--excluded-folders ""`.
|
||||||
|
|
||||||
|
## Publish
|
||||||
|
|
||||||
|
```bash
|
||||||
|
ob publish-list-sites
|
||||||
|
ob publish-setup --site my-notes --path ~/vaults/research
|
||||||
|
ob publish --path ~/vaults/research --dry-run
|
||||||
|
ob publish --path ~/vaults/research --yes
|
||||||
|
```
|
||||||
|
|
||||||
|
`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.
|
||||||
|
|
||||||
|
`ob publish-create-site --slug my-notes` creates a site at `publish.obsidian.md/my-notes`.
|
||||||
|
|
||||||
|
Run these with no options to print the current settings:
|
||||||
|
|
||||||
|
- `ob publish-config` sets folders to include or exclude with `--includes` and `--excludes`.
|
||||||
|
- `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.
|
||||||
|
|
||||||
|
`ob publish-unlink` disconnects the vault from its site.
|
||||||
Reference in New Issue
Block a user