Obsidian-central tool

I am about to start the development of a tool to make a central Obsidian vault for deployment of common resources across vaults.

The tool would use an Obsidian central vault where you write, test, and deploy feature to other vaults. That way the destination vault is not affected by potential overwriting. Of course, the best is having a Git repo where you can go forward and backward in time, or also create worktrees to work in different tasks on the same repository.

I am thinking on using Python; not developing inside Obsidian as a JS script, template or plugin, to be able to handle it at system level.

| Tool               | Direction        | Purpose                             | |--------------------|------------------|-------------------------------------| | obsidian-central   | Central β†’ Vaults | Deploy shared configs & resources   |

The obsidian-central concept would work like this:

  central-vault/
  β”œβ”€β”€ templates/           β†’ deploy to multiple vaults
  β”œβ”€β”€ scripts/
  β”œβ”€β”€ hotkeys/
  β”œβ”€β”€ properties/
  β”œβ”€β”€ maps/
  β”œβ”€β”€ folder-structures/
  β”œβ”€β”€ attachments/
  β”œβ”€β”€ dashboards/
  β”œβ”€β”€ plugins-config/
  β”œβ”€β”€ dashboards/
  └── deploy.json          β†’ defines what goes where

Potential features:

  1. Deploy modes: copy, symlink, or hardlink
  2. Target vaults: deploy to one or many vaults that share commonalities
  3. Selective sync: choose what to deploy (templates only, hotkeys only, data.json, etc.)
  4. Profiles: β€œminimal”, β€œfull”, β€œwriting”, β€œcoding” preset configurations
  5. Diff/preview: show log what would change before deploying
  6. Dry run mode

Sample config for deployment:


  { 
    "central": "/home/user/obsidian/central", 
    "targets": [ 
      "/home/user/obsidian/work", 
      "/home/user/obsidian/personal" 
    ], 
    "deploy": { 
      "templates": { "mode": "symlink" }, 
      "hotkeys": { "mode": "copy" }, 
      "scripts": { "mode": "symlink" } 
    } 
  }

If you have any ideas or suggestions, be welcome.

After I finish it, I will share it via GitHub.

Thanks,

f0nzie@thewoodlands-tx

2 Likes

What I do is have different vaults and for all and I use various Python scripts to create and update information in them.
I did not think of a master vault as command control but I do keep all my scripts there so I have them safe (I don’t like to put anyhing in dot folders, yet).
In one, I removed a large, resource-heavy part and delegated it to a different repo and I do use a symlink to reference and incorporate it.
I use VS Code Editor with various workspaces which hold all or parts of my vaults/repos and can query the workspace (whether a single vault or more) via the index generated by VS Code through the remote repos (unlimited).

A one-vault-to-rule-them-all stace with multiple apps/tools open

  • Obsidian: can run any script, shell, or js/ts to call python scripts even
  • AI capable querier/editor like the unlimited repo indexer VS Code Editor (never mind the fancier clones)
  • CLI/terminal

takes some getting used to and probably years of putting together, depending on one’s needs and I am curious how the proposed solution can benefit and lure in the average note taker.

I’ve completed the proof of concept of obsidian-central. Working as intended. But still many more tests in specific situations. Feel free to send Pull Request, and report issues.

Here is the repo:

https://github.com/Physics-of-Data/obsidian-central

I am thinking, if this POC works for many Obsidian users, I may go all the way to add a GUI with selectors and all.

Use Cases

  1. Centralized Templates - Maintain templates in one place, deploy to all vaults

  2. Shared Hotkeys - Use the same keyboard shortcuts across vaults

  3. Common Scripts - Write scripts once, use everywhere

  4. Plugin Configurations - Share Templater, Dataview, or other plugin settings

  5. CSS Snippets - Consistent styling across vaults

  6. Dashboard Templates - Deploy standard MOCs and dashboards to new vaults

Features

  • Multiple Deploy Modes: copy, symlink, or hardlink

  • Multiple Targets: Deploy to one or many vaults at once

  • Named Resources: Organize deployments by resource type

  • Multiple Profiles: Predefined resource combinations (minimal, full, etc.)

  • Dry Run Mode: Preview changes before deploying

  • Diff Preview: Show what would change with colored diff output

  • Smart Skip: Skip unchanged files to speed up deployments

Command Line Options

Option Description
config Path to JSON configuration file
--dry-run Preview changes without deploying
--diff Show colored diff for changed files
--skip-unchanged Skip files that are unchanged (don’t redeploy)
--profile NAME Use a named profile to select resources
--create-config PATH Create a sample configuration file
-h, --help Show help message

Example Configuration file

This is a real case. Copying settings from ab old established vault to a new fresh one. Templates and hotkeys fully working after running this tools

{
  "central": "/home/msfz751/obsidian/Daily",
  "targets": [
    "/home/msfz751/obsidian/osp-sciml"
  ],
  "resources": {
    "templates": {
      "source": "templates",
      "dest": "templates",
      "mode": "symlink"
    },
    "hotkeys": {
      "source": ".obsidian/hotkeys.json",
      "dest": ".obsidian/hotkeys.json",
      "mode": "copy"
    },
    "snippets": {
      "source": ".obsidian/snippets",
      "dest": ".obsidian/snippets",
      "mode": "copy"
    },
    "templater-config": {
      "source": ".obsidian/plugins/templater-obsidian/data.json",
      "dest": ".obsidian/plugins/templater-obsidian/data.json",
      "mode": "copy"
    },
    "scripts": {
      "source": "Extras/Scripts",
      "dest": "Extras/Scripts",
      "mode": "copy"
    }
  },
  "profiles": {
    "minimal": ["hotkeys"],
    "standard": ["hotkeys", "templates", "snippets"],
    "full": ["hotkeys", "templates", "snippets", "templater-config", "scripts"],
    "snippets": ["snippets"],
    "scripts": ["scripts"]
  }
}

More details in the README.

Enjoy!