CLI utilities for managing your Zettelkasten knowledge base.
- Compatible with Linux
- Compatible with Windows
- Not tested with macOS but should work
⬑ Table of Contents
🠕 Overview
Adding new notes to a digital Zettelkasten should be easy. Blank note files present no problems, but what if new notes should comply with a certain template structure? What if a Zettelkasten uses several different note templates? This adds unnecessary friction to what should be a simple writing process. Copying and pasting templates can be an irritating distraction when all we really want to do is quickly record a sudden insight in a new note file.
Maintaining consistent note structure can also be a problem. What if we decide file names should follow a different format than our earlier notes? Or what if we suddenly need accurate metadata about each of our notes for a new Zettelkasten tool to function correctly? Reversing early note structure decisions becomes a time-consuming slog as a Zettelkasten grows. Our focus should be on writing new notes, not managing note files and metadata.
Zettelcorn takes the manual labor out of maintaining a digital Zettelkasten. Add one, two, or a hundred blank notes at a time using any custom template. Rename files in the entire Zettelkasten (or specific directories) with very little effort. Parse existing notes then inject a unique ID, title, and keyword list into YAML frontmatter for each note. Maintaining a digital Zettelkasten should not be a struggle. Zettelcorn makes it easy to focus on the fun parts.
🠕 Install
- Install Deno by following the steps on the official website.
- Open a terminal window.
- Run the Zettelcorn CLI script remotely.
$> deno run --import-map=import_map.json --allow-read --allow-write https://raw.githubusercontent.com/davidtimmons/zettelcorn/master/lib/zettelcorn.ts
After running Zettelcorn, Deno will cache all its dependencies. You will need to include a
--reload
flag whenever you want Deno to update your cache to use the latest Zettelcorn version.
Zettelcorn was last tested with Deno 1.21.0
.
--allow-read
- Zettelcorn reads zettel files from your file system.--allow-write
- Zettelcorn modifies and writes files but always with your permission.--reload
- Updates the Deno cache to use the latest version of Zettelcorn.
Consider creating an alias in your .bashrc
(or equivalent) configuration file to make
running Zettelcorn easier.
alias zettelcorn="deno run --import-map=import_map.json --allow-read --allow-write https://raw.githubusercontent.com/davidtimmons/zettelcorn/master/lib/zettelcorn.ts"
$> zettelcorn
Consider adding a function to your PowerShell profile to make running Zettelcorn easier. To do so, first create a profile that will load scripts when opening PowerShell.
$> Set-ExecutionPolicy -Scope CurrentUser Unrestricted
$> New-Item $profile -Type File -Force
$> notepad $profile
Then, paste a zettelcorn
function into the profile open in Notepad.
function zettelcorn {
$im = "https://raw.githubusercontent.com/davidtimmons/zettelcorn/master/import_map.json";
$zc = "https://raw.githubusercontent.com/davidtimmons/zettelcorn/master/lib/zettelcorn.ts";
deno.exe run --import-map=$im --allow-read --allow-write $zc @args
}
Finally, run zettelcorn
from a PowerShell prompt.
$> zettelcorn
Zettelcorn modifies files in your Zettelkasten. While Zettelcorn is well-tested, be sure to back up your files before using it. The only undo is the one you provide!
🠕 Documentation
See the Zettelcorn manual for detailed instructions on using this CLI tool.
🠕 Develop
Zettelcorn includes a permissive license. You are free to modify the source code to suit your needs. Use the included Makefile
to run this project, or use Deno directly from the command line.
After cloning the project, install and cache the dependencies:
make install
ordeno cache --reload --lock=lock.json ./deps.ts
Run the Zettelcorn test suite with the following command:
make test
ordeno test --lock=lock.json --import-map=import_map.json --allow-read --allow-write ./test/
Run Zettelcorn from a local directory with this command:
make run
ordeno run --lock=lock.json --import-map=import_map.json --allow-read --allow-write ./lib/zettelcorn.ts
🠕 Contribute
Is there a feature you want that Zettelcorn doesn't have? Suggestions and contributions are welcome!
🠕 Credits
The illustration above is from unDraw.
🠕 License
Licensed under the MIT license.