You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This plan was written by synthetic/hf:zai-org/GLM-5.1:low.
obsdx Global Config: Design Options
Current State
Vault resolution priority: OBSDX_VAULT env -> --vault flag -> cwd walk-up to .obsidian/. Cache lives at <vault>/.obsidian/obsdx/. No global config file exists.
Option A: Docker Context Model (Named Vaults + Active Vault)
Concept: Like docker context. Vaults are named entries in a config file. One is "active" (default). Switching is a sticky operation that updates the config file.
obsdx vault add <name> --path <dir> # register a vault
obsdx vault remove <name> # unregister
obsdx vault list # list named vaults
obsdx vault use <name> # set active default
obsdx vault show # print active vault name
obsdx config path # show config file location
obsdx config edit # open config in $EDITOR
Vault resolution (highest to lowest priority):
--vault <path> (raw path, bypasses named vaults)
--vault <name> (named vault from config) — new: overload --vault to accept names OR paths
OBSDX_VAULT env var (name or path)
Cwd walk-up (discover from current directory)
[defaults].vault from config (the "active" vault)
Cache location: Each vault entry can optionally specify cache_dir. Default: $XDG_CACHE_HOME/obsdx/<name>/ if named, or <vault>/.obsidian/obsdx/ if discovered (backward compat).
Pros:
Familiar pattern (docker context users will feel at home)
Sticky default means zero-arg usage is smooth after one vault use
--vault <name> is shorter than --vault /long/path/to/vault
Clean separation: config is about naming, cache location is per-vault
Cons:
--vault overload (name vs path) adds ambiguity — must detect which
Sticky vault use changes state globally (all shells affected), which can surprise
More concepts for a single-vault user to learn
Option B: Git-Style (Cwd Discovery + Named Shortcuts)
Concept: Like git / gh. The cwd is the primary vault selector. Named vaults exist only as shortcuts to avoid typing long paths. No "active" vault — you're always in a vault (via cwd) or explicitly targeting one.
Concept: Combines A and B. Named vaults are shortcuts. A default vault exists for when cwd discovery fails. But cwd discovery is still first-class — if you're inside a vault, that vault wins.
obsdx config path # show config file path
obsdx config edit # open in $EDITOR
obsdx config show # print resolved config
obsdx vault list # list named vaults
obsdx vault add <name> --path <dir> # register
obsdx vault remove <name> # unregister
obsdx vault default [name] # get/set default vault (no --name = print current)
vault default <name> updates the default_vault key. Unlike docker context use, this is explicitly called "default" — not "use" — to signal it's a fallback, not the primary selection mechanism.
Vault resolution (highest to lowest):
--vault <path-or-name> flag
OBSDX_VAULT env var (path or name)
Cwd walk-up (if inside a vault, use it — this is the happy path)
default_vault from config (fallback when not in a vault)
Error
Cache location strategy:
Named vault: $XDG_CACHE_HOME/obsdx/<name>/ by default (configurable per-vault)
Discovered-only vault (no config entry): <vault>/.obsidian/obsdx/ (backward compat)
Migration: on vault add, optionally move existing .obsidian/obsdx/ to the new location
Pros:
Cwd discovery is first-class (you don't lose the current workflow)
Default vault solves the "run from anywhere" case
Named vaults are shortcuts + allow centralized cache
No --vault overload for name-vs-path needed — could add --vault-name or just detect intelligently
Works for both 1-vault and 5-vault users
Backward compatible: no config file = current behavior
Cons:
More surface area than B, though less stateful than A
Cache migration on vault add is a one-time complexity
Two cache locations (named vs discovered) could confuse debugging
Con: Cache is no longer co-located with vault data. Two different vaults with the same name on different machines could collide.
Con: Migration needed for existing users who have cache inside .obsidian/obsdx/.
Con: Indexing a vault from a USB/network mount while cache is on local disk = mismatch.
Recommendation
Option C (Hybrid) hits the sweet spot. Here's why:
Cwd discovery stays primary — the current workflow (cd into vault, run obsdx) still works perfectly. No behavioral change for existing users.
Default vault as fallback — solves "I have one vault and want obsdx files list to work from ~" without introducing sticky state that changes per-shell behavior.
Named vaults are bookmarks + cache config — --vault work instead of --vault /home/user/Documents/Obsidian/WorkVault. Also unlocks per-vault cache directory customization.
No config = current behavior — fully backward compatible.
OBSDX_CONFIG_DIR override env var for the config directory (XDG-compliant).
Unresolved questions:
Should --vault accept names and paths (smart detect), or should there be a separate --vault-name flag? Smart detect is nicer but can break if a name collides with a relative path.
Cache migration on vault add: auto-migrate or require --migrate-cache flag?
Should vault default with no args print the current default, or the resolved vault for the current cwd? (I'd suggest: print the default from config, since vault info already tells you the resolved vault.)
Should the daemon (daemon start) auto-start for the default vault, or require explicit vault selection?
Note
This plan was written by
synthetic/hf:zai-org/GLM-5.1:low.obsdx Global Config: Design Options
Current State
Vault resolution priority:
OBSDX_VAULTenv ->--vaultflag -> cwd walk-up to.obsidian/. Cache lives at<vault>/.obsidian/obsdx/. No global config file exists.XDG Paths (the defaults we'd respect)
XDG_CONFIG_HOME~/.configXDG_CACHE_HOME~/.cacheXDG_DATA_HOME~/.local/shareXDG_STATE_HOME~/.local/stateOverride env var:
OBSDX_CONFIG_DIR(parallelsGH_CONFIG_DIR,DOCKER_CONFIG).Option A: Docker Context Model (Named Vaults + Active Vault)
Concept: Like
docker context. Vaults are named entries in a config file. One is "active" (default). Switching is a sticky operation that updates the config file.Config file:
$XDG_CONFIG_HOME/obsdx/config.tomlCommand surface:
Vault resolution (highest to lowest priority):
--vault <path>(raw path, bypasses named vaults)--vault <name>(named vault from config) — new: overload--vaultto accept names OR pathsOBSDX_VAULTenv var (name or path)[defaults].vaultfrom config (the "active" vault)Cache location: Each vault entry can optionally specify
cache_dir. Default:$XDG_CACHE_HOME/obsdx/<name>/if named, or<vault>/.obsidian/obsdx/if discovered (backward compat).Pros:
vault use--vault <name>is shorter than--vault /long/path/to/vaultCons:
--vaultoverload (name vs path) adds ambiguity — must detect whichvault usechanges state globally (all shells affected), which can surpriseOption B: Git-Style (Cwd Discovery + Named Shortcuts)
Concept: Like
git/gh. The cwd is the primary vault selector. Named vaults exist only as shortcuts to avoid typing long paths. No "active" vault — you're always in a vault (via cwd) or explicitly targeting one.Config file:
$XDG_CONFIG_HOME/obsdx/config.tomlNo
[defaults]section. Novault use.Command surface:
Vault resolution:
--vault <path-or-name>(if name, resolve from config; if path, use directly)OBSDX_VAULTenv var (name or path)Cache location: Always
<vault>/.obsidian/obsdx/(current behavior). No centralization.Pros:
Cons:
cdinto the vault or type--vault work— no "just run obsdx from anywhere"Option C: Hybrid — Named Vaults + Cwd Discovery + Default Vault
Concept: Combines A and B. Named vaults are shortcuts. A default vault exists for when cwd discovery fails. But cwd discovery is still first-class — if you're inside a vault, that vault wins.
Config file:
$XDG_CONFIG_HOME/obsdx/config.tomlCommand surface:
vault default <name>updates thedefault_vaultkey. Unlikedocker context use, this is explicitly called "default" — not "use" — to signal it's a fallback, not the primary selection mechanism.Vault resolution (highest to lowest):
--vault <path-or-name>flagOBSDX_VAULTenv var (path or name)default_vaultfrom config (fallback when not in a vault)Cache location strategy:
$XDG_CACHE_HOME/obsdx/<name>/by default (configurable per-vault)<vault>/.obsidian/obsdx/(backward compat)vault add, optionally move existing.obsidian/obsdx/to the new locationPros:
--vaultoverload for name-vs-path needed — could add--vault-nameor just detect intelligentlyCons:
vault addis a one-time complexityOption D: Minimal Config (Just Default Vault Path)
Concept: No named vaults at all. Just a single
default_vaultpath in a tiny config file. For anything else, use--vaultorOBSDX_VAULTor cwd.Config file:
$XDG_CONFIG_HOME/obsdx/config.tomlCommand surface:
Pros:
Cons:
--vault /long/pathevery time for non-default vaults.Cache Location Comparison
<vault>/.obsidian/obsdx/$XDG_CACHE_HOME/obsdx/<name>/<vault>/.obsidian/obsdx/<vault>/.obsidian/obsdx/<vault>/.obsidian/obsdx/$XDG_CACHE_HOME/obsdx/<name>/<vault>/.obsidian/obsdx/<vault>/.obsidian/obsdx/cache_dironlyCentralizing cache (Options A/C) has these tradeoffs:
gitignore-proof. Can be blown away without touching vault files.~/.cache).nameon different machines could collide..obsidian/obsdx/.Recommendation
Option C (Hybrid) hits the sweet spot. Here's why:
obsdx files listto work from ~" without introducing sticky state that changes per-shell behavior.--vault workinstead of--vault /home/user/Documents/Obsidian/WorkVault. Also unlocks per-vault cache directory customization.OBSDX_CONFIG_DIRoverride env var for the config directory (XDG-compliant).Unresolved questions:
--vaultaccept names and paths (smart detect), or should there be a separate--vault-nameflag? Smart detect is nicer but can break if a name collides with a relative path.vault add: auto-migrate or require--migrate-cacheflag?vault defaultwith no args print the current default, or the resolved vault for the current cwd? (I'd suggest: print the default from config, sincevault infoalready tells you the resolved vault.)daemon start) auto-start for the default vault, or require explicit vault selection?