A CLI for managing your Neovim + Obsidian Zettelkasten
Project description
Zettelkasten CLI
A bespoke CLI for my Neovim + Obsidian Zettelkasten written in Python.
Installation
From PyPI
pip install zettelkasten-cli
Or with uv:
uv tool install zettelkasten-cli
From Source
git clone https://github.com/mischavandenburg/zettelkasten-cli.git
cd zettelkasten-cli
uv sync
uv run zk --help
Configuration
Environment Variables
| Variable | Required | Default | Description |
|---|---|---|---|
ZETTELKASTEN |
Yes | - | Path to your Zettelkasten root directory |
ZETTELKASTEN_INBOX_DIR |
No | 0 Inbox |
Directory for new notes (relative to root) |
ZETTELKASTEN_DAILY_DIR |
No | periodic-notes/daily-notes |
Directory for daily notes (relative to root) |
ZETTELKASTEN_WEEKLY_DIR |
No | periodic-notes/weekly-notes |
Directory for weekly notes (relative to root) |
ZETTELKASTEN_DAILY_TEMPLATE |
No | zk/daily.md |
Path to daily note template (relative to root) |
ZETTELKASTEN_WEEKLY_TEMPLATE |
No | zk/weekly.md |
Path to weekly note template (relative to root) |
ZETTELKASTEN_EDITOR |
No | nvim |
Editor command (nvim, vim, hx, code, etc.) |
ZETTELKASTEN_NVIM_ARGS |
No | + normal Gzzo |
Arguments passed to Neovim when opening notes |
ZETTELKASTEN_NVIM_COMMANDS |
No | :NoNeckPain |
Comma-separated Neovim commands to run on open |
Add to your shell profile (e.g., ~/.bashrc or ~/.zshrc):
export ZETTELKASTEN="$HOME/Documents/Zettelkasten"
# Optional: customize inbox directory
export ZETTELKASTEN_INBOX_DIR="Inbox"
# Optional: customize periodic notes directories
export ZETTELKASTEN_DAILY_DIR="daily-notes"
export ZETTELKASTEN_WEEKLY_DIR="weekly-notes"
# Optional: customize template locations
export ZETTELKASTEN_DAILY_TEMPLATE="templates/daily.md"
export ZETTELKASTEN_WEEKLY_TEMPLATE="templates/weekly.md"
# Optional: use a different editor
export ZETTELKASTEN_EDITOR="hx" # or vim, code, etc.
# Optional: customize Neovim behavior (only applies when using nvim)
export ZETTELKASTEN_NVIM_ARGS="+ normal Gzzo"
export ZETTELKASTEN_NVIM_COMMANDS=":NoNeckPain,:set wrap"
Default Directory Structure
With default settings, the CLI expects the following structure:
$ZETTELKASTEN/
├── 0 Inbox/ # New notes are created here
├── periodic-notes/
│ ├── daily-notes/ # Daily notes (YYYY-MM-DD.md)
│ ├── weekly-notes/ # Weekly notes (YYYY-Www.md)
│ ├── monthly-notes/ # (not yet implemented)
│ └── yearly-notes/ # (not yet implemented)
└── zk/
├── daily.md # Template for daily notes
└── weekly.md # Template for weekly notes
All paths are configurable via environment variables.
Templates
Templates are read from the configured template paths. If templates don't exist, minimal defaults are used.
Usage
zk [OPTIONS] COMMAND [ARGS]...
Options:
--install-completion: Install completion for the current shell.--show-completion: Show completion for the current shell.--help: Show this message and exit.
Commands:
day: Open daily note or create if it doesn't exist.week: Open weekly note or create if it doesn't exist.new: Create a new note with the provided title.
zk day
Open daily note or create if it doesn't exist.
zk day [OPTIONS]
zk week
Open weekly note or create if it doesn't exist.
zk week [OPTIONS]
zk new
Create a new note with the provided title. Will prompt if no title given. Adds Obsidian markdown link to the daily note.
zk new [OPTIONS] [TITLE]
Arguments:
[TITLE]- Note title (optional, will prompt if not provided)
Options:
--vim: Indicates input is coming from Neovim. Suppresses rich output.
Development
# Install dependencies
uv sync
# Run linter
uv run ruff check .
# Run tests
uv run pytest
# Build package
uv build
Releasing
This project uses release-please for automated releases.
-
Use Conventional Commits for commit messages:
feat:for new features (bumps minor version)fix:for bug fixes (bumps patch version)feat!:orfix!:for breaking changes (bumps major version)
-
When commits are pushed to main, release-please creates/updates a release PR
-
Merging the release PR automatically:
- Creates a GitHub release with changelog
- Publishes to PyPI
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file zettelkasten_cli-1.0.0.tar.gz.
File metadata
- Download URL: zettelkasten_cli-1.0.0.tar.gz
- Upload date:
- Size: 18.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a59cd8f1e46fc63dbad832b538474a8dd6ac62188405331103582c31491a1e47
|
|
| MD5 |
129fac8d8960041b8e672a112205ef38
|
|
| BLAKE2b-256 |
19bdbd638d8915b3148466d1757a42fb0941643996c0dca1d71038530b32a61a
|
File details
Details for the file zettelkasten_cli-1.0.0-py3-none-any.whl.
File metadata
- Download URL: zettelkasten_cli-1.0.0-py3-none-any.whl
- Upload date:
- Size: 11.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
72165e7d4b16002c0276ec55c27644fc356edb2a50e4c6451916b3f9df9ce890
|
|
| MD5 |
7541a4d47f59e3aa42899e1bed425782
|
|
| BLAKE2b-256 |
ee450fff2c040c866942becc2b666d81b95d1e42b0069c71d71ca6c700c77650
|