Is your feature request related to a problem? Please describe.
Creating a note from a Templater template currently requires either:
obsidian command id=templater-obsidian:create-new-note-from-template — opens a UI modal to pick a template
- Direct filesystem write — bypasses Templater processing entirely
Neither is suitable for automation. Scripts, AI assistants, and headless workflows cannot create templated notes silently.
Describe the solution you'd like
Implement a create-from-template CLI handler using the registerCliHandler API from Obsidian v1.12.2:
obsidian templater:create-from-template template="project" file="1 - Projects/Foo/Foo.md"
Behavior:
- Resolve template from templates folder (by name) or full vault path
- Run Templater processing (execute
tp.* functions)
- Write rendered content to output path
- Return the created file path
Arguments:
| Flag |
Required |
Description |
template |
Yes |
Template name (without path/extension) or full vault path |
file |
Yes |
Output file path in vault |
open |
No |
Open in UI after creation (default: false) |
Describe alternatives you've considered
- Using the existing command with UI modal — not suitable for automation
- Writing files directly and running
templater:replace-in-file-templater — race conditions and doesn't work with tp.file.title/tp.file.folder at creation time
- Custom userscripts — works but requires per-vault setup and doesn't integrate with CLI
Additional context
The handler should call Templater's internal create_running_config() + read_and_parse_template() pipeline so all tp.* functions (like tp.date.now(), tp.file.title) resolve correctly.
API reference:
// obsidian.d.ts — new in v1.12.2
interface Plugin {
registerCliHandler(name: string, handler: CliHandler): void;
}
type CliHandler = (args: CliData) => Promise<string>;
I'm working on a PR for this.
Is your feature request related to a problem? Please describe.
Creating a note from a Templater template currently requires either:
obsidian command id=templater-obsidian:create-new-note-from-template— opens a UI modal to pick a templateNeither is suitable for automation. Scripts, AI assistants, and headless workflows cannot create templated notes silently.
Describe the solution you'd like
Implement a
create-from-templateCLI handler using theregisterCliHandlerAPI from Obsidian v1.12.2:Behavior:
tp.*functions)Arguments:
templatefileopenDescribe alternatives you've considered
templater:replace-in-file-templater— race conditions and doesn't work withtp.file.title/tp.file.folderat creation timeAdditional context
The handler should call Templater's internal
create_running_config()+read_and_parse_template()pipeline so alltp.*functions (liketp.date.now(),tp.file.title) resolve correctly.API reference:
I'm working on a PR for this.