Steps to reproduce
On Windows, run the built-in CLI with a search query that contains any of Obsidian’s search operators (tag:, path:, file:, line:):
OBS="/c/Program Files/Obsidian/Obsidian.exe"
for q in 'MeToo' 'tag:#MeToo' 'tag:inbox' 'path:Facebook' 'file:Libya' 'line:inbox'; do
"$OBS" search query="$q" format=json 2>/tmp/err 1>/tmp/out
echo "query=\"$q\" exit=$? stdout=$(wc -c < /tmp/out)B stderr=$(wc -c < /tmp/err)B"
done
Plain-text queries work. Any query containing an operator fails.
As a sanity check, the in-app search engine itself handles these queries correctly - invoking the search plugin directly viaeval works:
"$OBS" eval code='app.internalPlugins.getPluginById("global-search").instance.openGlobalSearch("tag:#MeToo")'
So the engine is capable; the search CLI handler is the layer that drops the query.
Did you follow the troubleshooting guide? Y
Reproduced in the Sandbox vault as well. Restricted mode on, all community plugins disabled -same behavior. Reproduced in both Git Bash (MSYS2) and PowerShell 7.
Expected result
Either:
- The CLI returns results matching what in-app search returns for the same query (operators supported), or
- The CLI prints a clear error on stderr explaining that operators are not supported, with a documented non-zero exit code.
Actual result
Every query containing an operator exits with code 127, zero bytes on stdout, and zero bytes on stderr:
query="MeToo" exit=0 stdout=209B stderr=0B
query="tag:#MeToo" exit=127 stdout=0B stderr=0B
query="tag:inbox" exit=127 stdout=0B stderr=0B
query="path:Facebook" exit=127 stdout=0B stderr=0B
query="file:Libya" exit=127 stdout=0B stderr=0B
query="line:inbox" exit=127 stdout=0B stderr=0B
Same behavior with default text format and with format=json. Silent exit 127 with no stderr makes it impossible for a caller to distinguish “operator unsupported” from “query ran fine, zero matches” from “CLI crashed”.
Environment
SYSTEM INFO:
Obsidian version: 1.12.7
Installer version: 1.12.4
Operating system: Windows 11 Pro 10.0.26200
Login status: not logged in
Language: en-GB
Insider build toggle: off
Live preview: on
Base theme: adapt to system
Community theme: none
Snippets enabled: 2
Restricted mode: off
Plugins installed: 25
Plugins enabled: 21
1: Update time on edit v2.4.0
2: TimeStamper v1.3.0
3: Copilot v3.2.1
4: Commander v0.5.4
5: Callout Manager v1.1.0
6: Advanced Tables v0.22.1
7: Style Settings v1.0.9
8: Highlightr v1.2.2
9: BRAT v1.3.2
10: Auto Keyword Linker v3.3.0
11: Settings Search v1.3.10
12: Omnisearch v1.27.3
13: Local REST API v3.4.3
14: Dataview v0.5.68
15: Automatic Table Of Contents v1.7.3
16: Media Notes v1.3.0
17: Excalidraw v2.18.2
18: Editing Toolbar v3.2.1
19: Templater v2.16.4
20: Claudian v2.0.2
21: TOC compatible with Publish v3.1.0
RECOMMENDATIONS:
Custom theme and snippets: for cosmetic issues, please first try updating your theme and disabling your snippets. If still not fixed, please try to make the issue happen in the Sandbox Vault or disable community theme and snippets.
Community plugins: for bugs, please first try updating all your plugins to latest. If still not fixed, please try to make the issue happen in the Sandbox Vault or disable community plugins.
Obsidian 1.12.7 (installer 1.12.4), Windows 11 Pro 10.0.26200.
Additional information
External tooling that wraps Obsidian.exe search for tag-based or path-scoped queries silently returns “no matches” without any signal of failure. In our case this caused a multi-hour debugging session pointing at the wrong suspect (MSYS2 argv encoding, emoji handling) before we isolated the actual trigger: “query contains a : operator”. A stderr message alone would have saved
hours.
Suggested fix priority:
- Emit a clear stderr message and a documented exit code when the CLI cannot handle a query.
- Document in
Obsidian.exe help searchwhich operators are supported. - Ideally, route CLI
searchthrough the same query parser as in-app search so operators work uniformly.