# Mirror your Hjarni notes into an Obsidian vault

Hjarni is the AI-readable knowledge base. Obsidian is the offline-first vault. A one-way export keeps a mirror inside Obsidian.

25 notes free, forever. No credit card required.

## Connect Obsidian in about two minutes

1. Sign up for Hjarni and write a few notes, or import an existing vault from Settings → Import.
2. Generate a personal API token at hjarni.com/settings/connections and store it in HJARNI_TOKEN.
3. Create a Hjarni folder inside your Obsidian vault. The script writes one Markdown file per note into it.
4. Save the script as ~/bin/hjarni-sync and schedule it: a cron entry like '\*/15 \* \* \* \* ~/bin/hjarni-sync' refreshes the mirror every fifteen minutes.
5. If you have more notes than one page of the API returns, wrap the curl call in a loop over the page parameter. The /docs/api page documents pagination.

```
# Requires curl, jq, and a Hjarni API token in $HJARNI_TOKEN.
# One-way mirror: pulls one page of notes (up to 100 via per_page) and
# writes one Markdown file per note into ~/ObsidianVault/Hjarni/, named by
# title plus the note id, so two notes with the same title both survive.
# For larger libraries, loop over the page parameter, see /docs/api.
VAULT="$HOME/ObsidianVault/Hjarni"
mkdir -p "$VAULT"
curl -s -H "Authorization: Bearer $HJARNI_TOKEN" \
  "https://hjarni.com/api/v1/notes?per_page=100" \
  | jq -c '.[]' \
  | while read -r note; do
      id=$(echo "$note" | jq -r .id)
      title=$(echo "$note" | jq -r .title | tr '/' '-')
      body=$(echo "$note" | jq -r .body)
      printf '%s\n' "$body" > "$VAULT/$title ($id).md"
    done
```

The mirror script calls Hjarni's REST API at `https://hjarni.com/api/v1/notes` and authenticates with a bearer token. Generate one at hjarni.com/settings/connections and export it as `$HJARNI_TOKEN` before the cron job runs.

## Workflows that actually use your context

1. Keep an offline Markdown mirror of your notes

   Hjarni is hosted. A scheduled export to an Obsidian vault gives you a local Markdown mirror. Open the laptop on a plane and the notes are still right there.

2. Use Obsidian's editor on Hjarni-managed notes

   Read and search in Obsidian when that is the workflow you want. The mirror is one-way for now, so make changes in Hjarni, or treat the Obsidian copy as a scratch surface until you copy edits back through the API.

3. Use Obsidian's graph and plugins on a hosted knowledge base

   Local graph view, Dataview queries, themes: Obsidian's plugin ecosystem is enormous. The mirror gives you Hjarni's MCP access without giving up Obsidian's local power tools.

4. Survive any one product going away

   Hjarni's notes are Markdown. So are Obsidian's. The mirror is just a folder of .md files. If either product disappears, the other still has the notes.

5. Try Hjarni without giving up your vault

   Coming from Obsidian? Run the regular import to move your vault into Hjarni once. The mirror script then sends a read-only copy back, so you can use Hjarni as the source of truth while Obsidian keeps showing the same notes locally.

## Why use Obsidian as a mirror instead of the primary store

Obsidian's strength is local-first editing, a beautiful editor, and the plugin ecosystem. Its weak point for the AI workflow is the MCP server: there is no built-in one, and the community plugins require setup per machine, with no shared state between devices. Hjarni inverts that: the knowledge lives once, in the cloud, with a remote MCP server every AI client can read from.

Treating Obsidian as a one-way mirror gets you both: cloud-hosted knowledge that AI assistants reach over MCP, and a local Markdown vault you can read, search, and graph offline. If you stop using Hjarni, you still have the vault. If you stop using Obsidian, you still have the notes in Hjarni.

If you would rather move an existing vault into Hjarni instead, the regular import flow at /import/new accepts a ZIP of your Obsidian vault with folders, frontmatter, wiki-links, and attachments intact. Mirror and import solve different problems: mirror for ongoing read-only sync, import for a one-time move.

> Before Hjarni, my detailed notes lived in Obsidian. The MCP setups all assume your main computer is running and Claude is talking to it locally. I needed Claude to write from my iPad with no dependency on my Mac being awake. I went through a device bridge, a headless sync client on a VPS, git syncing the vault, and putting the vault on a server. Hjarni is hosted with MCP always connected, so that all went away. Obsidian is still my permanent human curated archive. Hjarni took over the part Obsidian was never shaped for.

Masao S., Japan

one-person business owner

Common questions

## Questions before you connect Obsidian

**Is this two-way sync or one-way?**

The script above is one-way: Hjarni → Obsidian. Two-way is doable with the same REST API (write changes from the vault back via PATCH /api/v1/notes/:id), but it is more careful work because you need a conflict policy. Start with one-way and add the reverse direction once you have a need.

**What happens if I edit the same note in both places at once?**

On a one-way pull, the next run overwrites the Obsidian copy with whatever is in Hjarni. Edit in Hjarni if you want the change to stick. If you want to edit in Obsidian, pause the script first, push the change back through the API, and then resume.

**How is this different from importing my Obsidian vault?**

Import is one-time: a ZIP of your vault becomes Hjarni notes, and from then on Hjarni is the source of truth. The mirror is ongoing: Hjarni stays the source of truth and Obsidian stays a read-only local copy.

**Will wiki-links work in Obsidian after the mirror?**

Not by default. Hjarni notes use \[\[id:Title\]\] wiki-links and the script writes raw note bodies, so Obsidian will see the literal \[\[42:My Note\]\] form. If you want clickable links inside Obsidian, add a small sed/awk step in the script to rewrite \[\[id:Title\]\] to \[\[Title\]\] before saving each file. Duplicate titles still need folder-qualified links.

**Do I need an Obsidian plugin to make this work?**

No. The script writes plain Markdown into a folder. Obsidian sees it the next time the vault is opened. No plugin, no configuration on the Obsidian side. Plugins like Templater or Dataview keep working on top.
