This command line interface provides an assortment of features for working with an Obsidian (or other markdown-based) knowledge base from the command line.
While it results in some duplication of functionality, this toolkit is designed to not require any Obsidian plugins, so you really don't even need Obsidian to use this (if you use FOAM, in VS Code, for instance).
macOS/Linux:
# Clone the repository
git clone https://github.com/kenlefeb/Obsidian-CLI.git
cd Obsidian-CLI
# Run the installation script
./install.shWindows (PowerShell):
# Clone the repository
git clone https://github.com/kenlefeb/Obsidian-CLI.git
cd Obsidian-CLI
# Run the installation script
.\install.ps1The installation script will:
- ✓ Run all tests to ensure everything works
- ✓ Build the project in Release mode
- ✓ Install the
obsidiancommand to your local bin directory - ✓ Add the installation directory to your PATH (if needed)
Installation locations:
- macOS/Linux:
~/bin/obsidian-cli/(with symlink at~/bin/obsidian) - Windows:
%LOCALAPPDATA%\Programs\obsidian\obsidian.exe
If you prefer to build manually:
dotnet publish src/CLI/CLI.csproj -c Release -o ./binThen copy the binaries to a directory in your PATH.
To uninstall Obsidian CLI:
macOS/Linux:
./uninstall.shWindows (PowerShell):
.\uninstall.ps1The uninstall script will remove all installed files and optionally clean up PATH modifications.
> obsidian daily-note add --date 2025-01-01 --vault vaultThis will create a new daily note, using your default daily note template, in the vault with an id of "vault".
I am using Handlebars.NET to implement the templating, so you can visit their repo for more details on how to compose a template. Note that, currently, the only data being passed into the template is date which represents the date of the note being created.
If there are particular pieces of data that you would find helpful for use in a template, let me know.
-
Polish this MVP to make it more robust, with error handling, better documentation, etc.
-
Be more cross-platform-aware. I use Obsidian on MacOS at home, and on Windows at work, so I want this tool to work well on both operating systems.
-
Implement the recurrence pattern support so you can use different templates for different days, based on the patters defined in the settings file.
-
Implement template "inheritance". My thinking, at the moment, is to just do this by running templates in order from the top-down against the target note, so the "child" templates are just applying themselves over top of "parent" templates.
-
Implement configuration editing from the CLI.
-
Implement Task support, so when you create a new daily-note, we look at the last daily-note to find all the uncompleted tasks and pull them forward into the new note.
# Run all tests
dotnet test
# Run with coverage
dotnet test --collect:"XPlat Code Coverage"
# Run in watch mode
dotnet watch test --project tests/obsidian.testsTest Coverage: 47% overall - Domain: 92% coverage 🎉
- See TEST-COVERAGE.md for detailed coverage report
- We follow Test-Driven Development (TDD) practices - see CLAUDE.MD
Current test suite:
- ✅ 33 tests passing - all green!
- ✅ Template & Recurrence classes 100% tested
- ✅ DailyNote class 89% coverage
- ✅ DailyNotes collection 90% coverage
- ✅ Fixed 3 critical bugs discovered through TDD
Contributions are always welcome!
See contributing.md for ways to get started.
Please adhere to this project's code of conduct.