Tools: How to run Obsidian CLI on WSL (2026)

Tools: How to run Obsidian CLI on WSL (2026)

Reason

Quick Fix

Permanent Fix: Create a Wrapper Script My preferred dev terminal nowadays is WSL2 of Ubuntu. After installing Obsidian CLI on windows, I could not figure out how to run the new cli tool on WSL. The following instruction does not work in WSL However, the same works perfectly fine on Powershell or command prompt as the executable path is already added to environment variables path. Usually windows path is imported into WSL. Once your app is in the Windows PATH, you can run it by: If you try running on WSL (in my case Ubuntu) the output appears all garbled now. Windows executables output \r\n (CRLF) line endings, while Linux terminals expect \n (LF). The extra carriage return (\r) causes the cursor to jump back to the start of the line, producing messy output. Pipe the output through tr -d '\r' to strip carriage returns: Instead of typing the pipe every time, create a wrapper script: Create ~/bin/obsidian with the following content: Make it executable and add ~/bin to your PATH: Now just run obsidian instead of obsidian.exe — clean output, every time. Templates let you quickly answer FAQs or store snippets for re-use. Hide child comments as well For further actions, you may consider blocking this person and/or reporting abuse

Code Block

Copy

obsidian help obsidian help obsidian help nano ~/.wslconfig nano ~/.wslconfig nano ~/.wslconfig [interop] appendWindowsPath=true [interop] appendWindowsPath=true [interop] appendWindowsPath=true wsl --shutdown wsl --shutdown wsl --shutdown obsidian.exe obsidian.exe obsidian.exe obsidian.exe help obsidian.exe help obsidian.exe help obsidian.exe 2>&1 | tr -d '\r' obsidian.exe 2>&1 | tr -d '\r' obsidian.exe 2>&1 | tr -d '\r' mkdir -p ~/bin mkdir -p ~/bin mkdir -p ~/bin #!/bin/bash obsidian.exe "$@" 2>&1 | tr -d '\r' #!/bin/bash obsidian.exe "$@" 2>&1 | tr -d '\r' #!/bin/bash obsidian.exe "$@" 2>&1 | tr -d '\r' chmod +x ~/bin/obsidian echo 'export PATH="$HOME/bin:$PATH"' >> ~/.bashrc source ~/.bashrc chmod +x ~/bin/obsidian echo 'export PATH="$HOME/bin:$PATH"' >> ~/.bashrc source ~/.bashrc chmod +x ~/bin/obsidian echo 'export PATH="$HOME/bin:$PATH"' >> ~/.bashrc source ~/.bashrc