The Obsidian CLI create command incorrectly handles filenames containing dots (.). When a name or path value includes a dot, the CLI treats the last dot before the appended .md extension as the start of a file extension and truncates everything after it, replacing it with .md. If the path value contains a dot, it is misinterpreted as a folder name, resulting in an unintended directory being created. Filenames without dots work correctly.
Steps to reproduce
- Open the Sandbox vault
- Run the following CLI commands:
Test 1: name with dot
obsidian create vault="Obsidian Sandbox" name="Test v2.0" content="test"
Expected: Test v2.0.md
Actual: Test v2.md (truncated at last dot)
Test 2: name with multiple dots
obsidian create vault="Obsidian Sandbox" name="Test 1.2.3 File" content="test"
Expected: Test 1.2.3 File.md
Actual: Test 1.2.md (truncated at last dot)
Test 3: name + path with dots
obsidian create vault="Obsidian Sandbox" name="Test 1.2.3 File" path="Test 1.2.3 File" content="test"
Expected: Test 1.2.3 File.md
Actual: Test 1.2.3 File/Test 1.2.md (path becomes folder, name truncated)
Test 4: no dots (works correctly)
obsidian create vault="Obsidian Sandbox" name="Test No Dots" content="test"
Expected: Test No Dots.md
Actual: Test No Dots.md (OK)
Did you follow the troubleshooting guide? [Y]
Reproduced in the Sandbox vault with restricted mode on (default state). No community plugins or themes involved.
Expected result
Files should be created with the full name provided, with .md appended. Dots in the middle of a filename should not be treated as file extension separators.
For example, name="Test v2.0" should create Test v2.0.md, and name="Test 1.2.3 File" should create Test 1.2.3 File.md.
Actual result
The CLI truncates the filename at the last dot before the appended .md extension and replaces everything after it with .md. When path also contains a dot, the path is interpreted as a folder name instead of a file path.
Summary of observed behavior:
-
name="Test v2.0"→Test v2.md(.0dropped) -
name="Test 1.2.3 File"→Test 1.2.md(.3 Namedropped) -
name="Test file.txt backup"→Test file.md(.txt backupdropped) -
name="Test end."→Test end.md(trailing dot works fine) -
name="Test No Dots"→Test No Dots.md(no dots works fine) -
path="Test 1.2.3 File"→ creates folderTest 1.2.3 File/instead of file
Environment
SYSTEM INFO:
Obsidian version: 1.12.7
Installer version: 1.12.6
Operating system: Darwin Kernel Version 25.5.0: Tue Apr 14 21:52:16 PDT 2026; root:xnu-12377.120.99.0.7~25/RELEASE_ARM64_T6041 25.5.0
Login status: logged in
Language: en
Catalyst license: insider
Insider build toggle: on
Live preview: on
Base theme: adapt to system
Community theme: none
Snippets enabled: 0
Restricted mode: off
Plugins installed: 0
Plugins enabled: 0
RECOMMENDATIONS:
none
Additional information
The overwrite flag also fails to work correctly with dotted filenames, as it targets the truncated filename rather than the intended one.