save-to-obsidian
Saves markdown content to remote Obsidian vault via SSH
Packaged view
This page reorganizes the original catalog entry around fit, installability, and workflow context first. The original raw source lives below.
Install command
npx @skill-hub/cli install openclaw-skills-save-to-obsidian
Repository
Skill path: skills/chunhualiao/save-to-obsidian
Saves markdown content to remote Obsidian vault via SSH
Open repositoryBest for
Primary workflow: Write Technical Docs.
Technical facets: Full Stack, Tech Writer.
Target audience: everyone.
License: Unknown.
Original source
Catalog source: SkillHub Club.
Repository owner: openclaw.
This is still a mirrored public skill entry. Review the repository before installing into production workflows.
What it helps with
- Install save-to-obsidian into Claude Code, Codex CLI, Gemini CLI, or OpenCode workflows
- Review https://github.com/openclaw/skills before adding save-to-obsidian to shared team environments
- Use save-to-obsidian for development workflows
Works across
Favorites: 0.
Sub-skills: 0.
Aggregator: No.
Original source / Raw SKILL.md
--- name: save-to-obsidian description: Saves markdown content to remote Obsidian vault via SSH version: 1.0.0 --- # Save to Obsidian Saves markdown content to remote Obsidian vault via SSH. ## Prerequisite **This skill is for machines WITHOUT iCloud sync** (e.g., Linux/Ubuntu servers). If your machine already has iCloud Desktop sync enabled and direct access to the Obsidian vault, you don't need this skill — just copy files directly to the vault path. ## When to Use User says: "save to obsidian", "send to obsidian", "copy to obsidian" ## Process 1. Write content to a temp .md file (enforce formatting rules below) 2. Copy to remote vault: `scp <filepath> user@remote-host:/path/to/obsidian/vault/` 3. Confirm success to user **Example:** ```bash # Write content to temp file cat > /tmp/my-note.md << 'EOF' # My Note Content here EOF # Copy to remote Obsidian vault scp /tmp/my-note.md [email protected]:~/Obsidian/MyVault/ # Clean up rm /tmp/my-note.md ``` **Configuration:** The agent should use the SSH host and vault path configured in workspace TOOLS.md ## Formatting Rules All content saved to Obsidian MUST follow these rules: ### Diagrams: Use Mermaid (mandatory) - **Never** use ASCII box diagrams, ASCII art, or plaintext diagrams - **Always** use Mermaid fenced code blocks (` ```mermaid `) - Obsidian renders Mermaid natively — ASCII diagrams look broken - Supported types: flowchart, sequence, state, class, ER, gantt, pie, mindmap, timeline, quadrant, graph ### Tables: Use Markdown tables - Obsidian renders markdown tables natively - For complex data, prefer tables over bullet lists ### Links: Use wiki-links or relative links - Link between Obsidian notes: `[[note-name]]` - External links: standard markdown `[text](url)` ### General - Use headers (##) for structure — Obsidian outline panel relies on them - Use YAML frontmatter if metadata is needed - Keep filenames kebab-case (no spaces) for cross-platform compatibility ## Agent Owner This skill is executed by the main OpenClaw agent session. The `save-to-obsidian.sh` script runs as a shell command via the exec tool. No sub-agents are spawned. iCloud sync is handled automatically after file transfer — no agent action needed. ## Success Criteria Save succeeds when: 1. scp exits with code 0 2. File appears in vault directory with correct filename 3. iCloud sync propagates the file (typically 1-2 minutes; not verified by skill) Failure conditions: SSH unreachable, vault path does not exist, disk full, filename contains characters invalid for iCloud sync (handled by sanitization in script). ## Edge Cases - **SSH failure**: script exits with error message and non-zero code; agent should report and stop - **Duplicate filename**: overwrites silently — scp does not warn; user must check if overwrite is desired - **Special characters in filename**: sanitized by script (spaces → hyphens, invalid chars stripped) - **Empty content**: scp will transfer a 0-byte file; not an error but should be flagged - **No clear title**: if content has no H1 header, agent should prompt user for filename before saving - **iCloud sync delay**: file appears in vault within 1-2 min; if not visible after 5 min, check iCloud status ## Notes - Uses existing SSH key auth (no password) - Target: remote-host → Obsidian vault location - Files sync via iCloud automatically (if vault is in iCloud folder) ## Configuration This skill reads SSH and vault configuration from your workspace TOOLS.md: | Variable | Description | Where to set | |----------|-------------|--------------| | SSH host | Hostname/IP of the remote machine hosting the Obsidian vault | TOOLS.md (e.g., `myserver.local`) | | SSH user | Username on the remote machine | TOOLS.md (e.g., `your-username`) | | SSH key path | Path to SSH private key (default: `~/.ssh/id_rsa`) | TOOLS.md | | Vault path | Absolute path to Obsidian vault on remote machine | TOOLS.md (e.g., `~/Obsidian/MyVault/`) | **Example TOOLS.md entry:** ``` ## Obsidian Remote Vault - SSH host: myserver.local - SSH user: your-username - Vault path: ~/Obsidian/MyVault/ ``` No API keys or tokens required — uses SSH key authentication only. --- ## Skill Companion Files > Additional files collected from the skill directory layout. ### README.md ```markdown # Save to Obsidian An OpenClaw skill that saves markdown content to an Obsidian vault via SSH, with automatic formatting rules for diagrams, tables, and links. ## Prerequisite **This skill is for machines WITHOUT iCloud sync** (e.g., Linux/Ubuntu servers, remote machines). If your machine already has iCloud Desktop sync enabled and direct access to the Obsidian vault folder, you don't need this skill — just copy files directly to the vault path. ## What It Does This skill allows your OpenClaw agent to save any generated markdown content directly to your Obsidian vault on a remote machine. It automatically enforces formatting rules to ensure content renders properly in Obsidian: - Converts or enforces Mermaid diagrams (no ASCII art) - Uses markdown tables (Obsidian native rendering) - Applies kebab-case filenames for cross-platform compatibility ## How to Install 1. Copy this skill to your OpenClaw skills directory 2. Set up SSH access to the remote machine hosting your Obsidian vault 3. Create a script at `~/.openclaw/scripts/save-to-obsidian.sh` that copies files to your vault location 4. Ensure the script is executable and works with your SSH key Example script: ```bash #!/bin/bash scp "$1" user@remote-host:/path/to/obsidian-vault/ ``` ## Usage Say to your agent: - "save to obsidian" - "send to obsidian" - "copy to obsidian" The agent will format the content appropriately and transfer it to your vault. ## Requirements - SSH access to the remote machine hosting the Obsidian vault - Obsidian vault accessible on the remote machine - A save-to-obsidian.sh script configured for your setup - **Note:** Not needed if your local machine already has iCloud sync to the vault ## Future Work - Support for multiple vault destinations - Direct iCloud sync without SSH intermediary - Automatic tagging and frontmatter generation - Batch save operations ## License MIT ``` ### _meta.json ```json { "owner": "chunhualiao", "slug": "save-to-obsidian", "displayName": "Save to Obsidian", "latest": { "version": "1.1.0", "publishedAt": 1771393719651, "commit": "https://github.com/openclaw/skills/commit/003088c1f86b2883e7f2a8f0b0fcbbda59ae9fae" }, "history": [ { "version": "1.0.0", "publishedAt": 1771275359846, "commit": "https://github.com/openclaw/skills/commit/f2afa8594a661facc61b2316c048fb59ac6ff672" } ] } ``` ### references/README.md ```markdown # References - [Obsidian Markdown Guide](https://help.obsidian.md/Editing+and+formatting/Basic+formatting+syntax) - [Mermaid Documentation](https://mermaid.js.org/) - [Obsidian Mermaid Support](https://help.obsidian.md/Editing+and+formatting/Advanced+formatting+syntax#Diagram) ``` ### scripts/save-to-obsidian.sh ```bash #!/bin/bash # Save content to Obsidian vault via scp # Usage: ./save-to-obsidian.sh <source_file> <vault_dir> [ssh_host] [filename_override] # Set OBSIDIAN_HOST and OBSIDIAN_VAULT_PATH in TOOLS.md set -euo pipefail SOURCE="${1:?Usage: $0 <source_file> <vault_dir> [ssh_host] [filename_override]}" VAULT_DIR="${2:?Usage: $0 <source_file> <vault_dir> [ssh_host] [filename_override]}" SSH_HOST="${3:-${OBSIDIAN_HOST:-}}" FILENAME="${4:-$(basename "$SOURCE")}" if [[ -z "$SSH_HOST" ]]; then echo "Error: SSH host required (arg 3 or OBSIDIAN_HOST env var)" exit 1 fi # Sanitize filename (no spaces, safe for iCloud) SAFE_FILENAME=$(echo "$FILENAME" | tr ' ' '-' | tr -cd '[:alnum:]._-') if [[ -z "$SAFE_FILENAME" ]]; then SAFE_FILENAME="obsidian-note-$(date +%Y%m%d-%H%M%S).md" fi DEST_PATH="${VAULT_DIR}/${SAFE_FILENAME}" echo "Saving to Obsidian..." echo " Source: $SOURCE" echo " Dest: ${SSH_HOST}:${DEST_PATH}" if scp "$SOURCE" "${SSH_HOST}:${DEST_PATH}"; then echo "✅ Saved: $SAFE_FILENAME" echo " iCloud sync will propagate within 1-2 minutes" else echo "❌ scp failed. Check: SSH access to $SSH_HOST, vault path exists, disk space" exit 1 fi ```