mirror of
https://github.com/kepano/obsidian-skills.git
synced 2026-12-05 10:05:18 -08:00
Skills: Rename ob-cli to obsidian-headless and match the Headless docs
Move the skill to plugins/obsidian/skills/ and check it against the Headless, Headless Sync and Headless Publish help pages and ob 0.0.14: - Add the Node.js 22 requirement, logout, sync-create-remote, sync-unlink, publish-create-site, publish-unlink and --json. - Warn against running the desktop app's Sync and Headless Sync on the same device, and ask for a backup before the first sync. - Have the user enter their password and E2E encryption password instead of passing them on the command line. - Run publish with --dry-run first and pass --yes only after the user approves. List the skill in both READMEs and the plugin and marketplace descriptions.
This commit is contained in:
@@ -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/"
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
"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": [
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -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.1.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.1.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.
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
"$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.1.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/"
|
||||||
|
|||||||
@@ -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.
|
||||||
@@ -1,230 +0,0 @@
|
|||||||
---
|
|
||||||
name: ob-cli
|
|
||||||
description: Use the `ob` command line tool to work with Obsidian services for local vaults, especially Obsidian Sync and Obsidian Publish. Use when the user wants to log into Obsidian from the terminal, inspect or configure remote sync/publish targets, sync a vault headlessly, publish vault changes, or automate these service workflows without opening the Obsidian app UI.
|
|
||||||
---
|
|
||||||
|
|
||||||
# Obsidian `ob` CLI
|
|
||||||
|
|
||||||
Use `ob` for headless access to Obsidian services tied to a local vault path.
|
|
||||||
|
|
||||||
`ob` is especially useful when the Obsidian desktop app is not running or is not available at all, such as on a VPS, CI runner, remote server, or other headless environment.
|
|
||||||
|
|
||||||
## Install and docs
|
|
||||||
|
|
||||||
Install `ob` with:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
npm install -g obsidian-headless
|
|
||||||
```
|
|
||||||
|
|
||||||
If installation details need verification or the user hits platform-specific issues, use the official headless documentation:
|
|
||||||
|
|
||||||
- https://obsidian.md/help/headless
|
|
||||||
|
|
||||||
Do not guess alternate package names or unofficial install methods.
|
|
||||||
|
|
||||||
Use this skill when the task is about:
|
|
||||||
|
|
||||||
- Logging into an Obsidian account from the terminal
|
|
||||||
- Connecting a local vault to Obsidian Sync or Obsidian Publish
|
|
||||||
- Running or checking sync for a vault
|
|
||||||
- Publishing vault changes from the command line
|
|
||||||
- Inspecting or changing sync/publish configuration for a vault
|
|
||||||
|
|
||||||
Do not use this skill for note editing, search, task management, or plugin/theme debugging inside the app. Use the `obsidian` CLI skill for those workflows when the desktop app is running.
|
|
||||||
|
|
||||||
If the desktop app is unavailable, manipulate the vault files directly with standard agent or Unix tools and the `obsidian-markdown` skill as needed. Treat `ob` as the service-side tool for Sync and Publish, not as the primary editor for note contents.
|
|
||||||
|
|
||||||
## Quick check
|
|
||||||
|
|
||||||
Start with:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
ob --help
|
|
||||||
```
|
|
||||||
|
|
||||||
If the user needs the exact flags for a subcommand, prefer `ob <command> --help` over memory.
|
|
||||||
|
|
||||||
## Path model
|
|
||||||
|
|
||||||
Most `ob` commands target a local vault by filesystem path:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
ob sync --path "/path/to/vault"
|
|
||||||
ob publish --path "/path/to/vault"
|
|
||||||
```
|
|
||||||
|
|
||||||
If `--path` is omitted, `ob` uses the current directory. Set the shell `workdir` to the vault root when possible.
|
|
||||||
|
|
||||||
## Core workflows
|
|
||||||
|
|
||||||
### Account login
|
|
||||||
|
|
||||||
Check login status or authenticate:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
ob login
|
|
||||||
ob login --email "user@example.com"
|
|
||||||
```
|
|
||||||
|
|
||||||
Use `--password` and `--mfa` only when the task explicitly requires non-interactive auth handling.
|
|
||||||
|
|
||||||
### Sync setup
|
|
||||||
|
|
||||||
List available vaults first if needed:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
ob sync-list-remote
|
|
||||||
ob sync-list-local
|
|
||||||
```
|
|
||||||
|
|
||||||
Connect a local vault to Sync:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
ob sync-setup --vault "Vault Name or ID" --path "/path/to/vault"
|
|
||||||
```
|
|
||||||
|
|
||||||
Important setup/config options:
|
|
||||||
|
|
||||||
- `--password` for the end-to-end encryption password
|
|
||||||
- `--device-name` to label this client in sync history
|
|
||||||
- `--config-dir` when the vault uses a nonstandard config folder instead of `.obsidian`
|
|
||||||
|
|
||||||
### Run sync
|
|
||||||
|
|
||||||
One-shot sync:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
ob sync --path "/path/to/vault"
|
|
||||||
```
|
|
||||||
|
|
||||||
Continuous sync:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
ob sync --path "/path/to/vault" --continuous
|
|
||||||
```
|
|
||||||
|
|
||||||
Check state first when diagnosing:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
ob sync-status --path "/path/to/vault"
|
|
||||||
```
|
|
||||||
|
|
||||||
### Sync configuration
|
|
||||||
|
|
||||||
Use `sync-config` when the user wants to change how sync behaves for a vault:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
ob sync-config --path "/path/to/vault" --mode pull-only
|
|
||||||
ob sync-config --path "/path/to/vault" --excluded-folders "Templates,Attachments/tmp"
|
|
||||||
```
|
|
||||||
|
|
||||||
Notable flags:
|
|
||||||
|
|
||||||
- `--conflict-strategy merge|conflict`
|
|
||||||
- `--mode bidirectional|pull-only|mirror-remote`
|
|
||||||
- `--excluded-folders`
|
|
||||||
- `--file-types image,audio,video,pdf,unsupported`
|
|
||||||
- `--configs` for Obsidian config categories to sync
|
|
||||||
- `--device-name`
|
|
||||||
- `--config-dir`
|
|
||||||
|
|
||||||
Use extra care with `mirror-remote`, which reverts local changes to match the remote state.
|
|
||||||
|
|
||||||
### Publish setup
|
|
||||||
|
|
||||||
List sites:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
ob publish-list-sites
|
|
||||||
```
|
|
||||||
|
|
||||||
Connect a vault to a Publish site:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
ob publish-setup --site "site-slug-or-id" --path "/path/to/vault"
|
|
||||||
```
|
|
||||||
|
|
||||||
### Publish changes
|
|
||||||
|
|
||||||
Preview before changing anything:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
ob publish --path "/path/to/vault" --dry-run
|
|
||||||
```
|
|
||||||
|
|
||||||
Publish without confirmation only when the task is explicitly automated or unattended:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
ob publish --path "/path/to/vault" --yes
|
|
||||||
```
|
|
||||||
|
|
||||||
Include files without a publish flag only when the user asks for a broad publish:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
ob publish --path "/path/to/vault" --all
|
|
||||||
```
|
|
||||||
|
|
||||||
### Publish configuration
|
|
||||||
|
|
||||||
Configure include/exclude folders:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
ob publish-config --path "/path/to/vault" --includes "Notes,Docs"
|
|
||||||
ob publish-config --path "/path/to/vault" --excludes "Private,Drafts"
|
|
||||||
```
|
|
||||||
|
|
||||||
Adjust site options:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
ob publish-site-options --path "/path/to/vault" --site-name "My Site"
|
|
||||||
```
|
|
||||||
|
|
||||||
Common `publish-site-options` flags:
|
|
||||||
|
|
||||||
- `--index-file`
|
|
||||||
- `--logo`
|
|
||||||
- `--show-navigation`
|
|
||||||
- `--show-search`
|
|
||||||
- `--show-backlinks`
|
|
||||||
- `--show-outline`
|
|
||||||
- `--show-hover-preview`
|
|
||||||
- `--show-theme-toggle`
|
|
||||||
- `--default-theme light|dark`
|
|
||||||
- `--nav-order`
|
|
||||||
- `--nav-hidden`
|
|
||||||
|
|
||||||
## Decision guide
|
|
||||||
|
|
||||||
Use `ob` when the task is service-oriented and path-based:
|
|
||||||
|
|
||||||
- "Set this vault up with Obsidian Sync"
|
|
||||||
- "Run sync for this vault"
|
|
||||||
- "Publish these vault changes"
|
|
||||||
- "Configure which folders Publish includes"
|
|
||||||
- "Check whether this machine is linked to the right remote vault"
|
|
||||||
|
|
||||||
Use the `obsidian` CLI instead when the task is app-oriented:
|
|
||||||
|
|
||||||
- Read or edit note contents
|
|
||||||
- Search notes, backlinks, tags, tasks, or properties
|
|
||||||
- Create daily notes
|
|
||||||
- Reload plugins or inspect the Obsidian UI
|
|
||||||
|
|
||||||
Use direct filesystem tools plus `obsidian-markdown` when the task is content-oriented but the desktop app is not available:
|
|
||||||
|
|
||||||
- Editing notes on a VPS or remote shell
|
|
||||||
- Creating or reorganizing vault files in CI or automation
|
|
||||||
- Bulk-fixing Markdown, wikilinks, frontmatter, or embeds without a running app
|
|
||||||
- Preparing vault content locally before running `ob sync` or `ob publish`
|
|
||||||
|
|
||||||
## Safety and verification
|
|
||||||
|
|
||||||
- Prefer `--dry-run` for publish previews when available.
|
|
||||||
- Prefer status/list commands before mutating setup in an already-configured vault.
|
|
||||||
- When a vault path is ambiguous, inspect the filesystem first instead of guessing.
|
|
||||||
- When a command could change remote state, confirm the target path/site/vault name from command output before proceeding.
|
|
||||||
|
|
||||||
## Reference
|
|
||||||
|
|
||||||
- Headless Obsidian docs: https://obsidian.md/help/headless
|
|
||||||
Reference in New Issue
Block a user