mirror of
https://github.com/kepano/obsidian-skills.git
synced 2026-12-05 10:05:18 -08:00
Compare commits
34 Commits
a1dc48e681
...
1.1.0
| Author | SHA1 | Date | |
|---|---|---|---|
| 95b7225be1 | |||
| 0cff8071f1 | |||
| 3fce00b0d3 | |||
| 60b7f25b04 | |||
| 330aed55c3 | |||
| e389391fa6 | |||
| c649fc0aa6 | |||
| d5dde60af0 | |||
| 5f7c648180 | |||
| 2c495a512b | |||
| c1d50cd76c | |||
| 1072e377da | |||
| 51f8f89e28 | |||
| 86ef1200c9 | |||
| 94c423c434 | |||
| ad475e618c | |||
| d55b393fde | |||
| 0cb7b09cd9 | |||
| bca2821056 | |||
| 5b451029ba | |||
| 3ccff5338e | |||
| d66e2e8a20 | |||
| 1969ad4433 | |||
| 715c6b3ece | |||
| b9dc51eb6b | |||
| 8ccef29ae8 | |||
| 957c634e06 | |||
| f4c0036a69 | |||
| 856640528f | |||
| 5d31732317 | |||
| d9d7a8cacd | |||
| ba8f1a6ffb | |||
| 2dd110c409 | |||
| c2029197d9 |
@@ -0,0 +1,20 @@
|
||||
{
|
||||
"name": "obsidian-skills",
|
||||
"interface": {
|
||||
"displayName": "Obsidian Skills"
|
||||
},
|
||||
"plugins": [
|
||||
{
|
||||
"name": "obsidian",
|
||||
"source": {
|
||||
"source": "local",
|
||||
"path": "./plugins/obsidian"
|
||||
},
|
||||
"policy": {
|
||||
"installation": "AVAILABLE",
|
||||
"authentication": "ON_INSTALL"
|
||||
},
|
||||
"category": "Productivity"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -1,15 +1,16 @@
|
||||
{
|
||||
"name": "obsidian-skills",
|
||||
"description": "Agent Skills for Obsidian Markdown, Bases, JSON Canvas, the Obsidian CLI, Defuddle, and Knap.",
|
||||
"owner": {
|
||||
"name": "Steph Ango",
|
||||
"url": "https://stephango.com/"
|
||||
"name": "Obsidian",
|
||||
"url": "https://obsidian.md/"
|
||||
},
|
||||
"plugins": [
|
||||
{
|
||||
"name": "obsidian",
|
||||
"source": "./",
|
||||
"description": "Claude Skills for Obsidian",
|
||||
"version": "1.0.1"
|
||||
"source": "./plugins/obsidian",
|
||||
"description": "Work with local Obsidian vaults using the Obsidian CLI and skills for Markdown, Bases, Canvas, web extraction, and templates.",
|
||||
"version": "1.1.0"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
{
|
||||
"name": "obsidian",
|
||||
"version": "1.0.1",
|
||||
"description": "Create and edit Obsidian vault files including Markdown, Bases, and Canvas. Use when working with .md, .base, or .canvas files in an Obsidian vault.",
|
||||
"author": {
|
||||
"name": "Steph Ango",
|
||||
"url": "https://stephango.com/"
|
||||
},
|
||||
"repository": "https://github.com/kepano/obsidian-skills",
|
||||
"license": "MIT",
|
||||
"keywords": [
|
||||
"obsidian",
|
||||
"markdown",
|
||||
"bases",
|
||||
"canvas",
|
||||
"pkm",
|
||||
"notes"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"name": "obsidian-skills",
|
||||
"owner": {
|
||||
"name": "Obsidian"
|
||||
},
|
||||
"metadata": {
|
||||
"description": "Agent Skills for Obsidian Markdown, Bases, JSON Canvas, the Obsidian CLI, Defuddle, and Knap."
|
||||
},
|
||||
"plugins": [
|
||||
{
|
||||
"name": "obsidian",
|
||||
"source": "./plugins/obsidian",
|
||||
"description": "Work with local Obsidian vaults using the Obsidian CLI and skills for Markdown, Bases, Canvas, web extraction, and templates."
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -4,53 +4,87 @@ These skills follow the [Agent Skills specification](https://agentskills.io/spec
|
||||
|
||||
## Installation
|
||||
|
||||
### Marketplace
|
||||
### Claude Code marketplace
|
||||
|
||||
From terminal:
|
||||
|
||||
```sh
|
||||
claude plugin marketplace add obsidianmd/obsidian-skills
|
||||
claude plugin install obsidian@obsidian-skills
|
||||
```
|
||||
/plugin marketplace add kepano/obsidian-skills
|
||||
|
||||
From within a Claude Code session:
|
||||
|
||||
```sh
|
||||
/plugin marketplace add obsidianmd/obsidian-skills
|
||||
/plugin install obsidian@obsidian-skills
|
||||
```
|
||||
|
||||
To get new skills later, run `claude plugin update obsidian@obsidian-skills`.
|
||||
|
||||
### Codex marketplace
|
||||
|
||||
```sh
|
||||
codex plugin marketplace add obsidianmd/obsidian-skills
|
||||
```
|
||||
|
||||
Then install Obsidian from the plugin directory in Codex or the ChatGPT desktop app.
|
||||
|
||||
### Cursor
|
||||
|
||||
Install Obsidian from the [Cursor Marketplace](https://cursor.com/marketplace).
|
||||
|
||||
### npx skills
|
||||
|
||||
```
|
||||
npx skills add git@github.com:kepano/obsidian-skills.git
|
||||
```sh
|
||||
npx skills add git@github.com:obsidianmd/obsidian-skills.git
|
||||
```
|
||||
|
||||
Instead of ssh, if you prefer to use https:
|
||||
|
||||
```
|
||||
npx skills add https://github.com/kepano/obsidian-skills
|
||||
```sh
|
||||
npx skills add https://github.com/obsidianmd/obsidian-skills
|
||||
```
|
||||
|
||||
### Manually
|
||||
|
||||
#### Claude Code
|
||||
|
||||
Add the contents of this repo to a `/.claude` folder in the root of your Obsidian vault (or whichever folder you're using with Claude Code). See more in the [official Claude Skills documentation](https://platform.claude.com/docs/en/agents-and-tools/agent-skills/overview).
|
||||
Copy the `plugins/obsidian/skills/` directory to `.claude/skills/` in the root of your Obsidian vault (or whichever folder you're using with Claude Code). See more in the [official Claude Skills documentation](https://platform.claude.com/docs/en/agents-and-tools/agent-skills/overview).
|
||||
|
||||
#### Codex
|
||||
|
||||
Copy the `skills/` directory into your Codex skills path (typically `~/.codex/skills`). See the [Agent Skills specification](https://agentskills.io/specification) for the standard skill format.
|
||||
Copy the `plugins/obsidian/skills/` directory into your Codex skills path (typically `~/.agents/skills`). See the [Agent Skills specification](https://agentskills.io/specification) for the standard skill format.
|
||||
|
||||
#### OpenCode
|
||||
|
||||
Clone the entire repo into the OpenCode skills directory (`~/.opencode/skills/`):
|
||||
|
||||
```sh
|
||||
git clone https://github.com/kepano/obsidian-skills.git ~/.opencode/skills/obsidian-skills
|
||||
git clone https://github.com/obsidianmd/obsidian-skills.git ~/.opencode/skills/obsidian-skills
|
||||
```
|
||||
|
||||
Do not copy only the inner `skills/` folder — clone the full repo so the directory structure is `~/.opencode/skills/obsidian-skills/skills/<skill-name>/SKILL.md`.
|
||||
Do not copy only the inner `skills/` folder — clone the full repo so the directory structure is `~/.opencode/skills/obsidian-skills/plugins/obsidian/skills/<skill-name>/SKILL.md`.
|
||||
|
||||
OpenCode auto-discovers all `SKILL.md` files under `~/.opencode/skills/`. No changes to `opencode.json` or any config file are needed. Skills become available after restarting OpenCode.
|
||||
|
||||
## Release maintenance
|
||||
|
||||
Update the plugin version in every manifest with:
|
||||
|
||||
```sh
|
||||
./scripts/bump.sh patch
|
||||
```
|
||||
|
||||
The script also accepts `major`, `minor`, or an explicit version like `1.1.0`.
|
||||
|
||||
## Skills
|
||||
|
||||
| Skill | Description |
|
||||
|-------|-------------|
|
||||
| [obsidian-markdown](skills/obsidian-markdown) | Create and edit [Obsidian Flavored Markdown](https://help.obsidian.md/obsidian-flavored-markdown) (`.md`) with wikilinks, embeds, callouts, properties, and other Obsidian-specific syntax |
|
||||
| [obsidian-bases](skills/obsidian-bases) | Create and edit [Obsidian Bases](https://help.obsidian.md/bases/syntax) (`.base`) with views, filters, formulas, and summaries |
|
||||
| [json-canvas](skills/json-canvas) | Create and edit [JSON Canvas](https://jsoncanvas.org/) files (`.canvas`) with nodes, edges, groups, and connections |
|
||||
| [obsidian-cli](skills/obsidian-cli) | Interact with Obsidian vaults via the [Obsidian CLI](https://help.obsidian.md/cli) including plugin and theme development |
|
||||
| [defuddle](skills/defuddle) | Extract clean markdown from web pages using [Defuddle](https://github.com/kepano/defuddle), removing clutter to save tokens |
|
||||
| -------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
||||
| [obsidian-markdown](plugins/obsidian/skills/obsidian-markdown) | Create and edit [Obsidian Flavored Markdown](https://help.obsidian.md/obsidian-flavored-markdown) (`.md`) with wikilinks, embeds, callouts, properties, and other Obsidian-specific syntax |
|
||||
| [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 |
|
||||
| [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 |
|
||||
| [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 |
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
{
|
||||
"name": "obsidian",
|
||||
"version": "1.1.0",
|
||||
"description": "Work with local Obsidian vaults using the Obsidian CLI and skills for Markdown, Bases, Canvas, web extraction, and templates.",
|
||||
"author": {
|
||||
"name": "Obsidian",
|
||||
"url": "https://obsidian.md/"
|
||||
},
|
||||
"homepage": "https://obsidian.md/",
|
||||
"repository": "https://github.com/obsidianmd/obsidian-skills",
|
||||
"license": "MIT",
|
||||
"keywords": [
|
||||
"obsidian",
|
||||
"markdown",
|
||||
"bases",
|
||||
"canvas",
|
||||
"pkm",
|
||||
"notes"
|
||||
],
|
||||
"icon": "./assets/icon.png"
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
{
|
||||
"name": "obsidian",
|
||||
"version": "1.1.0",
|
||||
"description": "Work with local Obsidian vaults using the Obsidian CLI and skills for Markdown, Bases, Canvas, web extraction, and templates.",
|
||||
"author": {
|
||||
"name": "Obsidian"
|
||||
},
|
||||
"homepage": "https://obsidian.md/",
|
||||
"repository": "https://github.com/obsidianmd/obsidian-skills",
|
||||
"license": "MIT",
|
||||
"keywords": [
|
||||
"obsidian",
|
||||
"markdown",
|
||||
"bases",
|
||||
"canvas",
|
||||
"pkm",
|
||||
"notes"
|
||||
],
|
||||
"logo": "assets/icon.png"
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2026 Steph Ango (@kepano)
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
@@ -0,0 +1,38 @@
|
||||
# Obsidian
|
||||
|
||||
Skills for working with Obsidian vaults: Obsidian Markdown, Bases, Canvas, the Obsidian CLI, web pages, and templates.
|
||||
|
||||
## Install
|
||||
|
||||
In Claude Code:
|
||||
|
||||
```
|
||||
/plugin install obsidian --marketplace obsidianmd/obsidian-skills
|
||||
```
|
||||
|
||||
In Codex, run `codex plugin marketplace add obsidianmd/obsidian-skills`, then install Obsidian from the plugin directory.
|
||||
|
||||
In Cursor, install Obsidian from the [Cursor Marketplace](https://cursor.com/marketplace).
|
||||
|
||||
## Requirements
|
||||
|
||||
The CLI skill runs the `obsidian` command, which needs the Obsidian desktop app installed, running, and with the CLI turned on. See https://help.obsidian.md/cli for setup. It needs a host that can run local commands, such as Claude Code, Codex, Cursor, or a desktop app session on your computer.
|
||||
|
||||
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.
|
||||
|
||||
## Included skills
|
||||
|
||||
- obsidian-cli: search, read, create, and manage notes through the running app.
|
||||
- obsidian-markdown: Obsidian links, properties, callouts, and embeds.
|
||||
- obsidian-bases: Bases files, views, filters, formulas, and summaries.
|
||||
- json-canvas: Canvas files with nodes, edges, groups, and connections.
|
||||
- defuddle: extract readable Markdown from public web pages.
|
||||
- knap: render templates from structured data.
|
||||
|
||||
## Scope
|
||||
|
||||
This plugin contains skills only, with no MCP server, hooks, or background processes. Using it can bring vault content you ask about into the conversation, and that content is processed by the AI model you use, not only on your computer.
|
||||
|
||||
Source: https://github.com/obsidianmd/obsidian-skills
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 72 KiB |
@@ -0,0 +1,64 @@
|
||||
{
|
||||
"$schema": "https://agent-plugins.org/schemas/1.0.0/plugin.schema.json",
|
||||
"name": "obsidian",
|
||||
"version": "1.1.0",
|
||||
"description": "Work with local Obsidian vaults using the Obsidian CLI and skills for Markdown, Bases, Canvas, web extraction, and templates.",
|
||||
"author": {
|
||||
"name": "Obsidian",
|
||||
"url": "https://obsidian.md/"
|
||||
},
|
||||
"homepage": "https://obsidian.md/",
|
||||
"repository": "https://github.com/obsidianmd/obsidian-skills",
|
||||
"license": "MIT",
|
||||
"keywords": [
|
||||
"obsidian",
|
||||
"markdown",
|
||||
"bases",
|
||||
"canvas",
|
||||
"pkm",
|
||||
"notes"
|
||||
],
|
||||
"extensions": {
|
||||
"com.openai": {
|
||||
"requires_local_executor": true,
|
||||
"interface": {
|
||||
"displayName": "Obsidian",
|
||||
"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.",
|
||||
"category": "Productivity",
|
||||
"developerName": "Obsidian",
|
||||
"defaultPrompt": [
|
||||
"Find notes about my current project and summarize the open tasks.",
|
||||
"Create a reading list Base from the books in my vault.",
|
||||
"Make a Canvas connecting the main ideas in these notes."
|
||||
],
|
||||
"websiteURL": "https://obsidian.md/",
|
||||
"supportURL": "https://obsidian.md/help/",
|
||||
"privacyPolicyURL": "https://obsidian.md/privacy",
|
||||
"termsOfServiceURL": "https://obsidian.md/terms",
|
||||
"logo": "./assets/icon.png",
|
||||
"composerIcon": "./assets/icon.png",
|
||||
"logoDark": "./assets/icon.png",
|
||||
"composerIconDark": "./assets/icon.png",
|
||||
"brandColor": "#6C31E3",
|
||||
"brandColorDark": "#A882FF"
|
||||
},
|
||||
"review": {
|
||||
"commerce": false,
|
||||
"prompts": [
|
||||
"Search my selected vault for project notes and summarize their open tasks with links to the sources.",
|
||||
"Create a note in my selected vault with a summary, related-note links, and a status property.",
|
||||
"Create a reading list Base with table and card views from the books in my selected vault.",
|
||||
"Create a Canvas with three idea cards and labeled connections in my selected vault.",
|
||||
"Extract this public article into Markdown and save it as a note in my selected vault.",
|
||||
"Use my supplied Knap template and JSON data to create a note in my selected vault.",
|
||||
"Read a note using the CLI while Obsidian is closed and explain what is needed to continue."
|
||||
]
|
||||
},
|
||||
"publication": {
|
||||
"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."
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
---
|
||||
name: defuddle
|
||||
description: Extract clean Markdown from HTML pages with Defuddle CLI.
|
||||
---
|
||||
|
||||
# Defuddle
|
||||
|
||||
Use Defuddle CLI when the user wants clean Markdown extracted from a web page. It removes navigation, ads, and other page clutter.
|
||||
|
||||
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.
|
||||
|
||||
## Usage
|
||||
|
||||
Always use `--md` for markdown output:
|
||||
|
||||
```bash
|
||||
defuddle parse <url> --md
|
||||
```
|
||||
|
||||
Save to file:
|
||||
|
||||
```bash
|
||||
defuddle parse <url> --md -o content.md
|
||||
```
|
||||
|
||||
Extract specific metadata:
|
||||
|
||||
```bash
|
||||
defuddle parse <url> -p title
|
||||
defuddle parse <url> -p description
|
||||
defuddle parse <url> -p domain
|
||||
```
|
||||
|
||||
## Output formats
|
||||
|
||||
| Flag | Format |
|
||||
|------|--------|
|
||||
| `--md` | Markdown (default choice) |
|
||||
| `--json` | JSON with both HTML and markdown |
|
||||
| (none) | HTML |
|
||||
| `-p <name>` | Specific metadata property |
|
||||
@@ -92,6 +92,10 @@ Nodes are objects placed on the canvas. Array order determines z-index: first no
|
||||
|
||||
**Newline pitfall**: Use `\n` for line breaks in JSON strings. Do **not** use the literal `\\n` -- Obsidian renders that as the characters `\` and `n`.
|
||||
|
||||
**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.
|
||||
|
||||
Write `.canvas` files directly. Don't create them with `obsidian create content=`, which turns every `\n` into a raw newline and breaks the JSON.
|
||||
|
||||
### File Nodes
|
||||
|
||||
| Attribute | Required | Type | Description |
|
||||
@@ -99,6 +103,8 @@ Nodes are objects placed on the canvas. Array order determines z-index: first no
|
||||
| `file` | Yes | string | Path to file within the system |
|
||||
| `subpath` | No | string | Link to heading or block (starts with `#`) |
|
||||
|
||||
**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"`.
|
||||
|
||||
```json
|
||||
{
|
||||
"id": "a1b2c3d4e5f67890",
|
||||
@@ -211,13 +217,15 @@ Generate 16-character lowercase hexadecimal strings (64-bit random value):
|
||||
- Space nodes 50-100px apart; leave 20-50px padding inside groups
|
||||
- Align to grid (multiples of 10 or 20) for cleaner layouts
|
||||
|
||||
| Node Type | Suggested Width | Suggested Height |
|
||||
|-----------|-----------------|------------------|
|
||||
| Small text | 200-300 | 80-150 |
|
||||
| Medium text | 300-450 | 150-300 |
|
||||
| Large text | 400-600 | 300-500 |
|
||||
| File preview | 300-500 | 200-400 |
|
||||
| Link preview | 250-400 | 100-200 |
|
||||
| Node Type | Suggested Width | Suggested Height | CJK Width (1.5x) |
|
||||
|-----------|-----------------|------------------|-------------------|
|
||||
| Small text | 200-300 | 80-150 | 300-450 |
|
||||
| Medium text | 300-450 | 150-300 | 450-675 |
|
||||
| Large text | 400-600 | 300-500 | 600-900 |
|
||||
| File preview | 300-500 | 200-400 | 450-750 |
|
||||
| Link preview | 250-400 | 100-200 | 375-600 |
|
||||
|
||||
**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.
|
||||
|
||||
## Validation Checklist
|
||||
|
||||
@@ -230,7 +238,8 @@ After creating or editing a canvas file, verify:
|
||||
5. `fromSide`/`toSide` values are one of: `top`, `right`, `bottom`, `left`
|
||||
6. `fromEnd`/`toEnd` values are one of: `none`, `arrow`
|
||||
7. Color presets are `"1"` through `"6"` or valid hex (e.g., `"#FF0000"`)
|
||||
8. JSON is valid and parseable
|
||||
8. Double quotes in `text` and `file` values are properly escaped as `\"`
|
||||
9. JSON is valid and parseable
|
||||
|
||||
If validation fails, check for duplicate IDs, dangling edge references, or malformed JSON strings (especially unescaped newlines in text content).
|
||||
|
||||
@@ -0,0 +1,102 @@
|
||||
---
|
||||
name: knap
|
||||
description: Render Markdown from templates and structured data using Knap CLI. Use when the user asks to apply a Knap template, turn JSON or CSV data into notes, batch-generate Markdown files, or format Defuddle output into a note.
|
||||
---
|
||||
|
||||
# Knap
|
||||
|
||||
Use Knap CLI to render Markdown templates with variables, filters, and logic.
|
||||
|
||||
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.
|
||||
|
||||
Run `knap --help` for available commands and options. Discover the language through the CLI's offline reference:
|
||||
|
||||
```bash
|
||||
knap help syntax
|
||||
knap help filters
|
||||
knap help filter date
|
||||
knap help tags
|
||||
knap help tag for
|
||||
```
|
||||
|
||||
Use the lists to find names, then request individual help for syntax, parameters, and examples with expected output.
|
||||
|
||||
## Usage
|
||||
|
||||
Render a template with JSON variables:
|
||||
|
||||
```bash
|
||||
knap render template.md --data article.json -o note.md
|
||||
```
|
||||
|
||||
Supply a template and data inline:
|
||||
|
||||
```bash
|
||||
knap render -t '# {{ title | trim }}' --data-json '{"title":"Hello"}'
|
||||
```
|
||||
|
||||
Override a variable or pipe JSON data:
|
||||
|
||||
```bash
|
||||
knap render template.md --data article.json --set 'title=Custom title'
|
||||
cat article.json | knap render template.md --data -
|
||||
```
|
||||
|
||||
Data must be a JSON object; its properties become template variables. `--set` overrides literal top-level keys with strings. Use JSON for nested objects, arrays, numbers, and booleans.
|
||||
|
||||
Choose one template source (file, `-t`, or stdin) and one data source (`--data` or `--data-json`). Only one input can read stdin. Without a template file or `-t`, Knap reads the template from stdin.
|
||||
|
||||
Output defaults to stdout. `-o` creates parent directories and overwrites the destination after rendering succeeds. Errors exit with status `1`; diagnostics go to stderr. Warnings can accompany successful output.
|
||||
|
||||
## Templates
|
||||
|
||||
Use `{{ variable }}` for values, `|` for filters, and `{% ... %}` for logic. For example, save this as `template.md`:
|
||||
|
||||
```knap
|
||||
---
|
||||
{{ title | yaml_property:"title" }}
|
||||
{{ tags | yaml_property:"tags" }}
|
||||
---
|
||||
# {{ title | trim }}
|
||||
{% if author %}
|
||||
By {{ author }}
|
||||
{% endif %}
|
||||
|
||||
{{ content }}
|
||||
```
|
||||
|
||||
Use `yaml_property` for complete frontmatter properties so values are quoted and indented correctly. The CLI includes standard filters, but does not supply Web Clipper browser variables, selectors, prompts, or DOM-dependent HTML filters. Supply variables through JSON.
|
||||
|
||||
Check a template before rendering:
|
||||
|
||||
```bash
|
||||
knap validate template.md
|
||||
```
|
||||
|
||||
Validation checks syntax, filter names, and static filter arguments without data or file output. It does not check variable existence, runtime values, or dynamic arguments; render with real data to check runtime behavior. Diagnostics go to stderr and include relevant help commands.
|
||||
|
||||
## Defuddle pipeline
|
||||
|
||||
Extract a web page as JSON with Markdown content, then render it into a note:
|
||||
|
||||
```bash
|
||||
defuddle parse https://example.com/article --md --json \
|
||||
| knap render template.md --data - -o note.md
|
||||
```
|
||||
|
||||
Defuddle's JSON properties, such as `title` and `content`, become template variables directly.
|
||||
|
||||
## Batch rendering
|
||||
|
||||
Create one file per CSV row, JSON array object, or JSON file in a folder:
|
||||
|
||||
```bash
|
||||
knap batch template.md --data articles.csv --output-dir notes \
|
||||
--filename '{{ title | safe_name }}.md'
|
||||
```
|
||||
|
||||
Use `--data articles.json` for an array or `--data ./articles` for a folder of JSON objects. CSV headers become variable names and values remain strings. Piped data defaults to JSON; add `--format csv` for piped CSV.
|
||||
|
||||
Use `--dry-run` to validate and list output paths without writing files. Existing files require `--overwrite`, including during a dry run. Duplicate output names within a batch are errors even with `--overwrite`.
|
||||
|
||||
Filename templates must produce a single filename with its extension, without directories. Use `safe_name` for data-derived names. Without `--filename`, Knap preserves source JSON basenames or numbers CSV rows and array items as `1.md`, `2.md`, and so on.
|
||||
@@ -53,6 +53,9 @@ views:
|
||||
groupBy: # Optional: group results
|
||||
property: property_name
|
||||
direction: ASC | DESC
|
||||
sort: # Optional: sort results (supports multiple properties)
|
||||
- property: property_name
|
||||
direction: ASC | DESC
|
||||
filters: # View-specific filters follow the same rules
|
||||
and:
|
||||
- 'status == "active"'
|
||||
@@ -268,6 +271,35 @@ views:
|
||||
# Map-specific settings for lat/lng properties
|
||||
```
|
||||
|
||||
## Sorting
|
||||
|
||||
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.
|
||||
|
||||
```yaml
|
||||
views:
|
||||
- type: table
|
||||
name: "Sorted Tasks"
|
||||
sort:
|
||||
- property: due
|
||||
direction: ASC
|
||||
- property: file.name
|
||||
direction: ASC
|
||||
order:
|
||||
- file.name
|
||||
- due
|
||||
- status
|
||||
```
|
||||
|
||||
Sort options depend on the property type:
|
||||
|
||||
| Property Type | ASC | DESC |
|
||||
|---------------|-----|------|
|
||||
| Text | A→Z | Z→A |
|
||||
| Number | 0→9 | 9→0 |
|
||||
| Date | Old→New | New→Old |
|
||||
|
||||
You can sort by any property including formulas (`formula.my_formula`), file properties (`file.mtime`), and note properties.
|
||||
|
||||
## Default Summary Formulas
|
||||
|
||||
| Name | Input Type | Description |
|
||||
@@ -326,6 +358,11 @@ views:
|
||||
groupBy:
|
||||
property: status
|
||||
direction: ASC
|
||||
sort:
|
||||
- property: due
|
||||
direction: ASC
|
||||
- property: file.name
|
||||
direction: ASC
|
||||
summaries:
|
||||
formula.days_until_due: Average
|
||||
|
||||
@@ -415,7 +452,9 @@ views:
|
||||
|
||||
## Embedding Bases
|
||||
|
||||
Embed in Markdown files:
|
||||
### Embed a `.base` file
|
||||
|
||||
Embed an external `.base` file in any Markdown note:
|
||||
|
||||
```markdown
|
||||
![[MyBase.base]]
|
||||
@@ -424,6 +463,26 @@ Embed in Markdown files:
|
||||
![[MyBase.base#View Name]]
|
||||
```
|
||||
|
||||
### Embed inline with a code block
|
||||
|
||||
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:
|
||||
|
||||
````markdown
|
||||
```base
|
||||
filters:
|
||||
and:
|
||||
- file.hasTag("example")
|
||||
views:
|
||||
- type: table
|
||||
name: Table
|
||||
order:
|
||||
- file.name
|
||||
- status
|
||||
```
|
||||
````
|
||||
|
||||
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.
|
||||
|
||||
## YAML Quoting Rules
|
||||
|
||||
- Use single quotes for formulas containing double quotes: `'if(done, "Yes", "No")'`
|
||||
@@ -434,7 +493,7 @@ Embed in Markdown files:
|
||||
|
||||
### YAML Syntax Errors
|
||||
|
||||
**Unquoted special characters**: Strings containing `:`, `{`, `}`, `[`, `]`, `,`, `&`, `*`, `#`, `?`, `|`, `-`, `<`, `>`, `=`, `!`, `%`, `@`, `` ` `` must be quoted.
|
||||
**Unquoted special characters**: Strings containing `:`, `{`, `}`, `[`, `]`, `,`, `&`, `*`, `#`, `?`, `|`, `-`, `<`, `>`, `=`, `%`, `@`, `` ` ``, `!` must be quoted.
|
||||
|
||||
```yaml
|
||||
# WRONG - colon in unquoted string
|
||||
@@ -0,0 +1,139 @@
|
||||
---
|
||||
name: obsidian-cli
|
||||
description: Interact with Obsidian vaults using the Obsidian CLI to read, create, search, and manage notes, tasks, properties, and more. Also supports plugin and theme development with commands to reload plugins, run JavaScript, capture errors, take screenshots, and inspect the DOM. Use when the user asks to interact with their Obsidian vault, manage notes, search vault content, perform vault operations from the command line, or develop and debug Obsidian plugins and themes.
|
||||
---
|
||||
|
||||
# Obsidian CLI
|
||||
|
||||
Use the `obsidian` CLI to interact with a running Obsidian instance. Requires Obsidian to be open.
|
||||
|
||||
## Before using the CLI
|
||||
|
||||
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.
|
||||
|
||||
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.
|
||||
|
||||
## Command reference
|
||||
|
||||
Run `obsidian help` to see all available commands. This is always up to date. Full docs: https://help.obsidian.md/cli
|
||||
|
||||
## Syntax
|
||||
|
||||
**Parameters** take a value with `=`. Quote values with spaces:
|
||||
|
||||
```bash
|
||||
obsidian create name="My Note" content="Hello world"
|
||||
```
|
||||
|
||||
**Flags** are boolean switches with no value:
|
||||
|
||||
```bash
|
||||
obsidian create name="My Note" open overwrite
|
||||
```
|
||||
|
||||
Use `overwrite` only when replacing an existing file is intended.
|
||||
|
||||
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.
|
||||
|
||||
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.
|
||||
|
||||
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"`.
|
||||
|
||||
## File targeting
|
||||
|
||||
Many commands accept `file` or `path` to target a file. Without either, the active file is used.
|
||||
|
||||
- `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.
|
||||
- `path=<path>` — exact path from vault root, e.g. `folder/note.md`
|
||||
|
||||
## Vault targeting
|
||||
|
||||
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:
|
||||
|
||||
```bash
|
||||
obsidian vault="My Vault" search query="test"
|
||||
```
|
||||
|
||||
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.
|
||||
|
||||
## Common patterns
|
||||
|
||||
```bash
|
||||
obsidian read file="My Note"
|
||||
obsidian create name="New Note" template="Template" # a template replaces content=
|
||||
obsidian create name="New Note" content="# Hello" open # also open in Obsidian
|
||||
obsidian append file="My Note" content="New line"
|
||||
obsidian rename path="folder/note.md" name="New name"
|
||||
obsidian move path="folder/note.md" to="archive/"
|
||||
obsidian delete path="folder/note.md"
|
||||
obsidian search query="search term" limit=10
|
||||
obsidian daily:read
|
||||
obsidian daily:append content="- [ ] New task"
|
||||
obsidian property:set name="status" value="done" file="My Note"
|
||||
obsidian tasks daily todo
|
||||
obsidian tags sort=count counts
|
||||
obsidian backlinks file="My Note"
|
||||
```
|
||||
|
||||
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.
|
||||
|
||||
Use `total` on list commands to get a count.
|
||||
|
||||
**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:
|
||||
|
||||
```bash
|
||||
obsidian tasks todo total --copy
|
||||
obsidian vault="My Vault" search query="TODO" --copy
|
||||
obsidian tasks todo format=json # many list commands also accept format=
|
||||
# Wrong: obsidian --copy vault="My Vault" tasks todo
|
||||
```
|
||||
|
||||
## Plugin development
|
||||
|
||||
### Develop/test cycle
|
||||
|
||||
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:
|
||||
|
||||
1. **Reload** the plugin to pick up changes:
|
||||
```bash
|
||||
obsidian plugin:reload id=my-plugin
|
||||
```
|
||||
2. **Check for errors** — if errors appear, fix and repeat from step 1:
|
||||
```bash
|
||||
obsidian dev:errors
|
||||
```
|
||||
3. **Verify visually** with a screenshot or DOM inspection:
|
||||
```bash
|
||||
obsidian dev:screenshot
|
||||
obsidian dev:dom selector=".workspace-leaf" text
|
||||
```
|
||||
4. **Check console output** for warnings or unexpected logs:
|
||||
```bash
|
||||
obsidian dev:console level=error
|
||||
```
|
||||
|
||||
`dev:screenshot` saves to a temporary file and prints its path. A relative `path=` saves inside the vault.
|
||||
|
||||
### Additional developer commands
|
||||
|
||||
Run JavaScript in the app context (prefer dedicated commands like `rename`, `move`, `create`, and `append` for vault mutations):
|
||||
|
||||
```bash
|
||||
obsidian eval code="app.vault.getFiles().length"
|
||||
```
|
||||
|
||||
Inspect CSS values:
|
||||
|
||||
```bash
|
||||
obsidian dev:css selector=".workspace-leaf" prop=background-color
|
||||
```
|
||||
|
||||
Toggle mobile emulation:
|
||||
|
||||
```bash
|
||||
obsidian dev:mobile on
|
||||
```
|
||||
|
||||
Run `obsidian help` to see additional developer commands including CDP and debugger controls.
|
||||
+8
-2
@@ -27,6 +27,9 @@ Create and edit valid Obsidian Flavored Markdown. Obsidian extends CommonMark an
|
||||
[[Note Name#^block-id]] Link to block
|
||||
[[#Heading in same note]] Same-note heading link
|
||||
```
|
||||
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.
|
||||
|
||||
Links resolve by file name, not by the `aliases` property. A bare `[[Alias]]` stays unresolved; write `[[Note|Alias]]` to show an alias.
|
||||
|
||||
Define a block ID by appending `^block-id` to any paragraph:
|
||||
|
||||
@@ -89,7 +92,7 @@ cssclasses:
|
||||
---
|
||||
```
|
||||
|
||||
Default properties: `tags` (searchable labels), `aliases` (alternative note names for link suggestions), `cssclasses` (CSS classes for styling).
|
||||
Default properties: `tags` (searchable labels), `aliases` (alternative names offered in link suggestions; links still use the file name), `cssclasses` (CSS classes for styling).
|
||||
|
||||
See [PROPERTIES.md](references/PROPERTIES.md) for all property types, tag syntax rules, and advanced usage.
|
||||
|
||||
@@ -100,7 +103,7 @@ See [PROPERTIES.md](references/PROPERTIES.md) for all property types, tag syntax
|
||||
#nested/tag Nested tag with hierarchy
|
||||
```
|
||||
|
||||
Tags can contain letters, numbers (not first character), underscores, hyphens, and forward slashes. Tags can also be defined in frontmatter under the `tags` property.
|
||||
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.
|
||||
|
||||
## Comments
|
||||
|
||||
@@ -116,8 +119,11 @@ This entire block is hidden in reading view.
|
||||
|
||||
```markdown
|
||||
==Highlighted text== Highlight syntax
|
||||
==🔴Highlighted text== Colored highlight (Obsidian 1.14.1 and later)
|
||||
```
|
||||
|
||||
A colored highlight starts with 🔴, 🟠, 🟡, 🟢, 🔵 or 🟣 (or the matching square) right after `==`. Other emoji stay as text.
|
||||
|
||||
## Math (LaTeX)
|
||||
|
||||
```markdown
|
||||
+5
-3
@@ -31,12 +31,14 @@ due: 2024-02-01T14:30:00
|
||||
| Date | `date: 2024-01-15` |
|
||||
| Date & Time | `due: 2024-01-15T14:30:00` |
|
||||
| List | `tags: [one, two]` or YAML list |
|
||||
| Links | `related: "[[Other Note]]"` |
|
||||
| Tags | Only for the `tags` property |
|
||||
|
||||
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.
|
||||
|
||||
## Default Properties
|
||||
|
||||
- `tags` - Note tags (searchable, shown in graph view)
|
||||
- `aliases` - Alternative names for the note (used in link suggestions)
|
||||
- `aliases` - Alternative names for the note, offered in link suggestions. A bare `[[Alias]]` doesn't resolve; write `[[Note|Alias]]`
|
||||
- `cssclasses` - CSS classes applied to the note in reading/editing view
|
||||
|
||||
## Tags
|
||||
@@ -48,7 +50,7 @@ due: 2024-02-01T14:30:00
|
||||
#tag_with_underscores
|
||||
```
|
||||
|
||||
Tags can contain: letters (any language), numbers (not first character), underscores `_`, hyphens `-`, forward slashes `/` (for nesting).
|
||||
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.
|
||||
|
||||
In frontmatter:
|
||||
|
||||
Executable
+39
@@ -0,0 +1,39 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
cd "$(dirname "$0")/.."
|
||||
|
||||
if [[ $# -ne 1 ]]; then
|
||||
echo "Usage: $0 <major|minor|patch|x.y.z>" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
files=(
|
||||
"plugins/obsidian/plugin.json"
|
||||
"plugins/obsidian/.claude-plugin/plugin.json"
|
||||
"plugins/obsidian/.cursor-plugin/plugin.json"
|
||||
".claude-plugin/marketplace.json"
|
||||
)
|
||||
|
||||
current_version="$(sed -nE 's/^[[:space:]]*"version": "([0-9]+\.[0-9]+\.[0-9]+)".*/\1/p' "${files[0]}" | head -n 1)"
|
||||
IFS=. read -r major minor patch <<< "$current_version"
|
||||
|
||||
case "$1" in
|
||||
major) new_version="$((major + 1)).0.0" ;;
|
||||
minor) new_version="$major.$((minor + 1)).0" ;;
|
||||
patch) new_version="$major.$minor.$((patch + 1))" ;;
|
||||
*)
|
||||
if [[ "$1" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
|
||||
new_version="$1"
|
||||
else
|
||||
echo "Usage: $0 <major|minor|patch|x.y.z>" >&2
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
for file in "${files[@]}"; do
|
||||
perl -0pi -e "s/\"version\": \"[0-9]+\\.[0-9]+\\.[0-9]+\"/\"version\": \"$new_version\"/" "$file"
|
||||
done
|
||||
|
||||
echo "Updated version: $current_version -> $new_version"
|
||||
@@ -1,41 +0,0 @@
|
||||
---
|
||||
name: defuddle
|
||||
description: Extract clean markdown content from web pages using Defuddle CLI, removing clutter and navigation to save tokens. Use instead of WebFetch when the user provides a URL to read or analyze, for online documentation, articles, blog posts, or any standard web page. Do NOT use for URLs ending in .md — those are already markdown, use WebFetch directly.
|
||||
---
|
||||
|
||||
# Defuddle
|
||||
|
||||
Use Defuddle CLI to extract clean readable content from web pages. Prefer over WebFetch for standard web pages — it removes navigation, ads, and clutter, reducing token usage.
|
||||
|
||||
If not installed: `npm install -g defuddle`
|
||||
|
||||
## Usage
|
||||
|
||||
Always use `--md` for markdown output:
|
||||
|
||||
```bash
|
||||
defuddle parse <url> --md
|
||||
```
|
||||
|
||||
Save to file:
|
||||
|
||||
```bash
|
||||
defuddle parse <url> --md -o content.md
|
||||
```
|
||||
|
||||
Extract specific metadata:
|
||||
|
||||
```bash
|
||||
defuddle parse <url> -p title
|
||||
defuddle parse <url> -p description
|
||||
defuddle parse <url> -p domain
|
||||
```
|
||||
|
||||
## Output formats
|
||||
|
||||
| Flag | Format |
|
||||
|------|--------|
|
||||
| `--md` | Markdown (default choice) |
|
||||
| `--json` | JSON with both HTML and markdown |
|
||||
| (none) | HTML |
|
||||
| `-p <name>` | Specific metadata property |
|
||||
@@ -1,106 +0,0 @@
|
||||
---
|
||||
name: obsidian-cli
|
||||
description: Interact with Obsidian vaults using the Obsidian CLI to read, create, search, and manage notes, tasks, properties, and more. Also supports plugin and theme development with commands to reload plugins, run JavaScript, capture errors, take screenshots, and inspect the DOM. Use when the user asks to interact with their Obsidian vault, manage notes, search vault content, perform vault operations from the command line, or develop and debug Obsidian plugins and themes.
|
||||
---
|
||||
|
||||
# Obsidian CLI
|
||||
|
||||
Use the `obsidian` CLI to interact with a running Obsidian instance. Requires Obsidian to be open.
|
||||
|
||||
## Command reference
|
||||
|
||||
Run `obsidian help` to see all available commands. This is always up to date. Full docs: https://help.obsidian.md/cli
|
||||
|
||||
## Syntax
|
||||
|
||||
**Parameters** take a value with `=`. Quote values with spaces:
|
||||
|
||||
```bash
|
||||
obsidian create name="My Note" content="Hello world"
|
||||
```
|
||||
|
||||
**Flags** are boolean switches with no value:
|
||||
|
||||
```bash
|
||||
obsidian create name="My Note" silent overwrite
|
||||
```
|
||||
|
||||
For multiline content use `\n` for newline and `\t` for tab.
|
||||
|
||||
## File targeting
|
||||
|
||||
Many commands accept `file` or `path` to target a file. Without either, the active file is used.
|
||||
|
||||
- `file=<name>` — resolves like a wikilink (name only, no path or extension needed)
|
||||
- `path=<path>` — exact path from vault root, e.g. `folder/note.md`
|
||||
|
||||
## Vault targeting
|
||||
|
||||
Commands target the most recently focused vault by default. Use `vault=<name>` as the first parameter to target a specific vault:
|
||||
|
||||
```bash
|
||||
obsidian vault="My Vault" search query="test"
|
||||
```
|
||||
|
||||
## Common patterns
|
||||
|
||||
```bash
|
||||
obsidian read file="My Note"
|
||||
obsidian create name="New Note" content="# Hello" template="Template" silent
|
||||
obsidian append file="My Note" content="New line"
|
||||
obsidian search query="search term" limit=10
|
||||
obsidian daily:read
|
||||
obsidian daily:append content="- [ ] New task"
|
||||
obsidian property:set name="status" value="done" file="My Note"
|
||||
obsidian tasks daily todo
|
||||
obsidian tags sort=count counts
|
||||
obsidian backlinks file="My Note"
|
||||
```
|
||||
|
||||
Use `--copy` on any command to copy output to clipboard. Use `silent` to prevent files from opening. Use `total` on list commands to get a count.
|
||||
|
||||
## Plugin development
|
||||
|
||||
### Develop/test cycle
|
||||
|
||||
After making code changes to a plugin or theme, follow this workflow:
|
||||
|
||||
1. **Reload** the plugin to pick up changes:
|
||||
```bash
|
||||
obsidian plugin:reload id=my-plugin
|
||||
```
|
||||
2. **Check for errors** — if errors appear, fix and repeat from step 1:
|
||||
```bash
|
||||
obsidian dev:errors
|
||||
```
|
||||
3. **Verify visually** with a screenshot or DOM inspection:
|
||||
```bash
|
||||
obsidian dev:screenshot path=screenshot.png
|
||||
obsidian dev:dom selector=".workspace-leaf" text
|
||||
```
|
||||
4. **Check console output** for warnings or unexpected logs:
|
||||
```bash
|
||||
obsidian dev:console level=error
|
||||
```
|
||||
|
||||
### Additional developer commands
|
||||
|
||||
Run JavaScript in the app context:
|
||||
|
||||
```bash
|
||||
obsidian eval code="app.vault.getFiles().length"
|
||||
```
|
||||
|
||||
Inspect CSS values:
|
||||
|
||||
```bash
|
||||
obsidian dev:css selector=".workspace-leaf" prop=background-color
|
||||
```
|
||||
|
||||
Toggle mobile emulation:
|
||||
|
||||
```bash
|
||||
obsidian dev:mobile on
|
||||
```
|
||||
|
||||
Run `obsidian help` to see additional developer commands including CDP and debugger controls.
|
||||
Reference in New Issue
Block a user