Command line tool to manage a personal wiki, written in zig.
wk is a command line tool to manage a personal wiki. By design, the wiki is
minimal and made up of simple plain text files. It is designed to be used
solely in the terminal (it has no GUI or web interface) and to be synchronized
using external tools (e.g. version control or a syncing service such as
Nextcloud or Syncthing).
New wiki pages are given a
.md extension, although there is nothing enforcing
that they be written in Markdown syntax. New pages are also given a YAML
metadata template, which is used by
wk to extract the wiki page title and
tags, which is used by various subcommands.
--- title: Some wiki page date: July 26, 2020 tags: example --- This is an example of a wiki page.
All new pages are given a unique ID, which is prepended to its filename. This
ID is displayed in the various
wk commands. Pages can be linked together
using these IDs.
Download and extract a release to the location of your choosing.
If you use macOS and Homebrew you can use
brew install --HEAD gpanders/tap/wk
Install zig. After cloning this repository, build
This will build
zig-cache/bin/. You can install
By default, this installs to
/usr/local/bin/. To install to a different
location, set the
prefix variable. For example, to install under
make prefix=$HOME/.local install
Notes are stored in the directory represented by the environment variable
$WIKI_DIR is unset, it defaults to
Notes are created with
wk new TITLE
The file name of the new note will be the given title prepended with a unique
ID and a
.md extension. The title can contain spaces, but be sure to wrap it
in quotes so your shell doesn't split it.
To list all of your existing notes, use
This will print the title of each existing note along with its ID.
For a full list of available commands, use
wk help. For more information on
a specific command, use
wk help COMMAND.
For commands that take arguments, the argument can be a note ID, title, or file
name (with or without the extension) of an existing note. The output of any
wk command can be used with other commands, allowing commands to be
composed. For example, to open all notes containing the tag "foo", use
wk tag foo | wk open
Most commands can be abbreviated. Use
wk help CMD for more information.