Skip to main content

CLI to merge Vim and 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_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 Neovim behavior
export ZETTELKASTEN_NVIM_ARGS="+ normal Gzzo"
export ZETTELKASTEN_NVIM_COMMANDS=":NoNeckPain,:set wrap"

Expected Directory Structure

The CLI expects the following structure within your ZETTELKASTEN directory:

$ZETTELKASTEN/
├── 0 Inbox/              # New notes are created here
├── periodic-notes/
│   ├── daily/            # Daily notes (YYYY-MM-DD.md)
│   └── weekly/           # Weekly notes (YYYY-Www.md)
└── zk/
    ├── daily.md          # Template for daily notes
    └── weekly.md         # Template for weekly notes

Templates

Daily and weekly note templates are read from the zk/ directory. 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.

  1. Use Conventional Commits for commit messages:

    • feat: for new features (bumps minor version)
    • fix: for bug fixes (bumps patch version)
    • feat!: or fix!: for breaking changes (bumps major version)
  2. When commits are pushed to main, release-please creates/updates a release PR

  3. Merging the release PR automatically:

    • Creates a GitHub release with changelog
    • Publishes to PyPI

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

zettelkasten_cli-0.4.0.tar.gz (14.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

zettelkasten_cli-0.4.0-py3-none-any.whl (7.3 kB view details)

Uploaded Python 3

File details

Details for the file zettelkasten_cli-0.4.0.tar.gz.

File metadata

  • Download URL: zettelkasten_cli-0.4.0.tar.gz
  • Upload date:
  • Size: 14.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for zettelkasten_cli-0.4.0.tar.gz
Algorithm Hash digest
SHA256 afb06d38126aa88c94bdcb3efd8cb166303ea0df3d965d37fce60e98ca93a393
MD5 dc1857577eff8ff9da285d4c9f23839f
BLAKE2b-256 124a97063cb07b1382e6aa9b582af51f1c398f427b2169b39f2e5a322adf9181

See more details on using hashes here.

File details

Details for the file zettelkasten_cli-0.4.0-py3-none-any.whl.

File metadata

File hashes

Hashes for zettelkasten_cli-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f124d7d6944994efac0752269ad6968b7708cfd3f8861528b0b3c50426c80439
MD5 40943e7c6de40a41bab8335dc1376abf
BLAKE2b-256 f362cf53f17bb3743541c765242830aa376fbc9c5e0e3ffef2ebf51fdfad0918

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page