Background
template-sync syncs Obsidian template files with schema examples. It reads templateDir, templatePrefix, and fieldMap from the markdown plugin config, making it inherently markdown-specific.
The plugin architecture currently supports a parse hook. If plugins could also register CLI commands, template-sync would naturally live inside the markdown plugin, alongside the config that drives it.
Options
Option A: Plugin command registration hook
Add a commands(program: Command): void hook to OstToolsPlugin. The markdown plugin registers template-sync directly and owns all its config. The core CLI only calls plugin.commands(program) during setup.
Option B: template-sync stays global, markdown is a template provider
Treat template syncing as a generic capability — define a templateSync hook on OstToolsPlugin so any plugin can provide templates. The core template-sync command invokes whichever plugin supports it. Less opinionated but adds abstraction for a single use case.
Option C: Keep as-is, accept the coupling
template-sync is explicitly a markdown workflow tool. The coupling to the markdown plugin is intentional and documented. No architecture change needed.
Current state
The config lookup (getMarkdownConfig) is encapsulated in the markdown plugin module, so index.ts doesn't reach into markdown internals by key. The residual coupling is that template-sync as a top-level command implies all spaces use markdown templates.
Background
template-syncsyncs Obsidian template files with schema examples. It readstemplateDir,templatePrefix, andfieldMapfrom the markdown plugin config, making it inherently markdown-specific.The plugin architecture currently supports a
parsehook. If plugins could also register CLI commands,template-syncwould naturally live inside the markdown plugin, alongside the config that drives it.Options
Option A: Plugin command registration hook
Add a
commands(program: Command): voidhook toOstToolsPlugin. The markdown plugin registerstemplate-syncdirectly and owns all its config. The core CLI only callsplugin.commands(program)during setup.Option B: template-sync stays global, markdown is a template provider
Treat template syncing as a generic capability — define a
templateSynchook onOstToolsPluginso any plugin can provide templates. The coretemplate-synccommand invokes whichever plugin supports it. Less opinionated but adds abstraction for a single use case.Option C: Keep as-is, accept the coupling
template-syncis explicitly a markdown workflow tool. The coupling to the markdown plugin is intentional and documented. No architecture change needed.Current state
The config lookup (
getMarkdownConfig) is encapsulated in the markdown plugin module, soindex.tsdoesn't reach into markdown internals by key. The residual coupling is thattemplate-syncas a top-level command implies all spaces use markdown templates.