Support stdin pipe for obsidian CLI

Use case or problem

I want to provide larger chunks of content to various Obsidian CLI commands. For example, larger multiline scripts for eval, or larger multi-line content chunks for ‘append’.

Proposed solution

Use nix-style ‘-’ to mean ‘stdin’, e.g.:
echo “helloWorld()” | obsidian eval code=-
echo “Hello World” | obsidian append file=Inbox content=-

Current workaround (optional)

Probably something like:
echo <<-EOF > script.js
helloWorld()
EOF
obsidian eval code=“$(<script.js)”
But this is likely to be full of annoying quote problems.

Related feature requests (optional)

2 Likes