# CLI: command hangs when piping CLI output to the \`head\` command

**URL:** <https://forum.obsidian.md/t/cli-command-hangs-when-piping-cli-output-to-the-head-command/111691>\
**Category:** Bug reports\
**Tags:** tracked, cli\
**Created:** [February 28, 2026, 2:53am UTC](https://forum.obsidian.md/t/cli-command-hangs-when-piping-cli-output-to-the-head-command/111691 "2026-02-28T02:53:37Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![onlyice](https://forum.obsidian.md/user_avatar/forum.obsidian.md/onlyice/32/47789_2.png) [@onlyice](https://forum.obsidian.md/u/onlyice)\
**Post date:** [February 28, 2026, 2:53am UTC](https://forum.obsidian.md/t/cli-command-hangs-when-piping-cli-output-to-the-head-command/111691/1 "2026-02-28T02:53:37Z")

</div>

### Steps to reproduce

1. Open a terminal
2. Run `obsidian help | head -10`

### Did you follow the troubleshooting guide? [Y/N]

Yes.

### Expected result

The command prints 10 lines then exit.

### Actual result

The command prints 10 lines but doesn’t exit.

### Environment

```plaintext
SYSTEM INFO:
	Obsidian version: 1.12.3
	Installer version: 1.10.6
	Operating system: Darwin Kernel Version 25.2.0: Tue Nov 18 21:09:40 PST 2025; root:xnu-12377.61.12~1/RELEASE_ARM64_T6000 25.2.0
	Login status: logged in
	Language: en
	Catalyst license: insider
	Insider build toggle: on
	Live preview: on
	Base theme: adapt to system
	Community theme: Cupertino 3.2.5
	Snippets enabled: 0
	Restricted mode: off
	Plugins installed: 46
	Plugins enabled: 20
		1: Style Settings v1.0.9
		2: Vault Statistics v0.1.3
		3: Paste URL into selection v1.11.4
		4: Outliner v4.10.0
		5: Quick Switcher++ v6.0.0
		6: QuickAdd v2.11.0
		7: Local Images Plus v0.16.4
		8: AttachFlow v0.4.5
		9: Paste image rename v1.6.1
		10: Advanced URI v1.46.1
		11: BRAT v2.0.2
		12: Dataview v0.5.68
		13: Image Captions v1.1.7
		14: Image Converter v1.4.1
		15: Kanban v2.0.51
		16: Linter v1.31.0
		17: File Cleaner Redux v1.13.4
		18: Collapsible Code Blocks v1.0.6
		19: Claudian v1.3.65
		20: Terminal v3.21.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.

```

* * *

### Additional information

In kepano’s [Obsidian CLI skill](https://github.com/kepano/obsidian-skills/blob/main/skills/obsidian-cli/SKILL.md) it says, “Run obsidian help to see all available commands.” Coding agents that read this will often run “obsidian help” and pipe its output to the head command to quickly verify it. Because the command hangs, the agents’ execution also stalls until it times out.

---

<div class="post-metadata">

**Author:** ![WhiteNoise](https://forum.obsidian.md/user_avatar/forum.obsidian.md/whitenoise/32/11_2.png) [@WhiteNoise](https://forum.obsidian.md/u/WhiteNoise)\
**Post date:** [February 28, 2026, 3:01am UTC](https://forum.obsidian.md/t/cli-command-hangs-when-piping-cli-output-to-the-head-command/111691/2 "2026-02-28T03:01:35Z")

</div>

> [@onlyice](#):
>
> ### Did you follow the troubleshooting guide? [Y/N]
> 
> Yes.

In the Troubleshooting guide, you are asked to download and reinstall obsidian, did you do it?

---

<div class="post-metadata">

**Author:** ![onlyice](https://forum.obsidian.md/user_avatar/forum.obsidian.md/onlyice/32/47789_2.png) [@onlyice](https://forum.obsidian.md/u/onlyice)\
**Post date:** [February 28, 2026, 3:08am UTC](https://forum.obsidian.md/t/cli-command-hangs-when-piping-cli-output-to-the-head-command/111691/3 "2026-02-28T03:08:47Z")

</div>

I didn’t reinstall before. After reinstalling, the problem persists.

---

<div class="post-metadata">

**Author:** ![WhiteNoise](https://forum.obsidian.md/user_avatar/forum.obsidian.md/whitenoise/32/11_2.png) [@WhiteNoise](https://forum.obsidian.md/u/WhiteNoise)\
**Post date:** [February 28, 2026, 3:41am UTC](https://forum.obsidian.md/t/cli-command-hangs-when-piping-cli-output-to-the-head-command/111691/4 "2026-02-28T03:41:26Z")

</div>

Is obsidian already running?

because the cli works only if obsidian is already running.

---

<div class="post-metadata">

**Author:** ![onlyice](https://forum.obsidian.md/user_avatar/forum.obsidian.md/onlyice/32/47789_2.png) [@onlyice](https://forum.obsidian.md/u/onlyice)\
**Post date:** [February 28, 2026, 3:46am UTC](https://forum.obsidian.md/t/cli-command-hangs-when-piping-cli-output-to-the-head-command/111691/5 "2026-02-28T03:46:29Z")

</div>

Yes, it’s running.

If I remove the `head` part from the command, it works normally.

---

<div class="post-metadata">

**Author:** ![WhiteNoise](https://forum.obsidian.md/user_avatar/forum.obsidian.md/whitenoise/32/11_2.png) [@WhiteNoise](https://forum.obsidian.md/u/WhiteNoise)\
**Post date:** [February 28, 2026, 8:41pm UTC](https://forum.obsidian.md/t/cli-command-hangs-when-piping-cli-output-to-the-head-command/111691/6 "2026-02-28T20:41:36Z")

</div>

Thanks, this seems to be a mac specific problem

---

<div class="post-metadata">

**Author:** ![UserNIck](https://forum.obsidian.md/letter_avatar_proxy/v4/letter/u/97f17d/32.png) [@UserNIck](https://forum.obsidian.md/u/UserNIck)\
**Post date:** [March 13, 2026, 10:38am UTC](https://forum.obsidian.md/t/cli-command-hangs-when-piping-cli-output-to-the-head-command/111691/7 "2026-03-13T10:38:52Z")

</div>

Hello,

I ran into the same problem. For what its worth, the LLM I’m using thinks the app isn’t handling SIGPIPE properly but I’m not really that makes sense if its a macOS only problem.

I did figure out though that while `obsidian | head` never exits, `obsidian | cat | head` works fine. This at least is able to be put in skill files to work around the issue for me.

I tested with version 1.12.5 and installer 1.11.7. Mainly posting to share the workaround I found.

---

<div class="post-metadata">

**Author:** ![WhiteNoise](https://forum.obsidian.md/user_avatar/forum.obsidian.md/whitenoise/32/11_2.png) [@WhiteNoise](https://forum.obsidian.md/u/WhiteNoise)\
**Post date:** [March 13, 2026, 2:04pm UTC](https://forum.obsidian.md/t/cli-command-hangs-when-piping-cli-output-to-the-head-command/111691/8 "2026-03-13T14:04:23Z")

</div>

Hello, you do need to try this with the new installer.

Please, go on discord [channel #insider-desktop](https://discord.com/channels/686053708261228577/716028884885307432/1479204978106306712) and after you have downloaded and reinstalled obsidian report back.

Thanks

---

<div class="post-metadata">

**Author:** ![UserNIck](https://forum.obsidian.md/letter_avatar_proxy/v4/letter/u/97f17d/32.png) [@UserNIck](https://forum.obsidian.md/u/UserNIck)\
**Post date:** [March 16, 2026, 12:37pm UTC](https://forum.obsidian.md/t/cli-command-hangs-when-piping-cli-output-to-the-head-command/111691/9 "2026-03-16T12:37:39Z")

</div>

Thanks WhiteNoise. I’ve added a post there. I updated to the 1.12.4 installer and am seeing the same behavior. I did notice something extra though.

`obsidian version | head` works fine  
`obsidian help | head` does not.  
`obsidian help | cat | head` works fine.

Seems like longer output causes the problem.

---

<div class="post-metadata">

**Author:** ![tophee](https://forum.obsidian.md/user_avatar/forum.obsidian.md/tophee/32/38947_2.png) [@tophee](https://forum.obsidian.md/u/tophee)\
**Post date:** [April 20, 2026, 8:45am UTC](https://forum.obsidian.md/t/cli-command-hangs-when-piping-cli-output-to-the-head-command/111691/10 "2026-04-20T08:45:48Z")

</div>

I am seeing the exact same issue (also on MacOS). Where does this need to be fixed? My understanding is that `obsidian` doesn’t handle the closed pipe correctly, when `head` received the lines it wants and exits.

@UserNIck did you figure out a working rule to add to the `SKILL.md` to work around the issue?
