Category: Bug Reports
Tag: cli
Issue
Several CLI commands silently return empty or zero results when called from a terminal session. The commands succeed (exit code 0) but produce wrong output because they default to “active file” scope — which doesn’t exist in a CLI context.
This affects tasks, tags, and properties format=json.
Steps to reproduce
Tested in the Obsidian Sandbox vault (Help > Sandbox Vault) — no community plugins or themes enabled.
1. tasks returns empty even when tasks exist
The Sandbox vault contains 6 tasks:
> tasks all
- [x] #tags, [links](), **formatting** supported
- [x] list syntax required (any unordered or ordered list supported)
- [x] this is a complete item
- [?] this is also a complete item (works with every character)
- [ ] this is an incomplete item
- [ ] tasks can be clicked in Preview to be checked off
But without all:
> tasks total
0
> tasks todo
No tasks found.
Same in a 600+ note vault: tasks todo total → 0, tasks all todo total → 684.
2. tags returns empty even when tags exist
> tags counts total
0
> tags all counts total
1
Same in main vault: tags counts → “No tags found.”, tags all counts → 141 lines of data.
3. Error messages still return exit code 0
$ obsidian base:views
Error: Active file is not a base file: ...
$ echo $?
0
4. properties format=json returns YAML-like output instead of JSON
$ obsidian properties path=somefile.md format=json
# Output is YAML-like, not valid JSON
(Tested in main vault. Sandbox vault’s default files have no frontmatter.)
Did you follow the troubleshooting guide? [Y]
Expected result
tasks/tagswithoutallscope: either default to vault-wide, or show a warning like “No active file — did you meantasks all todo?”- Commands that print
Error:should return a non-zero exit code format=jsonshould return valid JSON
Actual result
tasks total→0(should be 6 in Sandbox, 684 in main vault)tasks todo→No tasks found.(should be 2 in Sandbox)tags counts total→0(should be 1 in Sandbox)- All commands return exit code 0, even on error
- No warning about missing active file context
Environment
- Obsidian 1.12.1 (installer 1.11.4)
- macOS Sonoma 14.3
- CLI called from terminal (no active file)
- Reproduced in Sandbox vault — no community plugins or themes
Additional information
These issues are especially impactful for programmatic/automation use cases. AI coding agents (Claude Code, Codex, Cursor) that call the CLI get “successful” responses with wrong results.

