Personal Knowledge Base

Run Demarkus locally as a private markdown wiki — browse with the TUI, publish through the protocol, full version history on every document.

What you’ll have

Setup

1. Install

curl -fsSL https://raw.githubusercontent.com/latebit-io/demarkus/main/install.sh | bash

This installs the server, client tools, and registers the server as a background service. The content directory (~/.demarkus/content by default, or the path you pass with --root) is created automatically.

2. Generate a write token

All writes go through the Mark Protocol. Generate a token to allow publishing:

demarkus-token generate -paths "/*" -ops publish -tokens ~/.demarkus/tokens.toml

Copy the raw token from the output — you’ll use it as $TOKEN below.

If you used the full installer, the tokens file path is already configured. The installer saves an initial token to ~/.demarkus/initial-token.txt.

4. Start the server with write access

If running manually (the installer starts the server automatically as a background service):

demarkus-server -root ~/.demarkus/content -tokens ~/.demarkus/tokens.toml

The server uses a built-in self-signed certificate and listens on localhost:6309.

5. Publish your first documents

Everything goes through the protocol — no writing files directly to disk:

export TOKEN=<your-token>

demarkus --insecure -X PUBLISH -auth $TOKEN mark://localhost:6309/index.md \
  -body "# My Wiki

- [Notes](notes.md)
- [Ideas](ideas.md)"

demarkus --insecure -X PUBLISH -auth $TOKEN mark://localhost:6309/notes.md \
  -body "# Notes

Start writing here."

Each publish creates a new immutable version. Run demarkus -X VERSIONS to see the history:

demarkus --insecure -X VERSIONS mark://localhost:6309/index.md

6. Browse with the TUI

demarkus-tui --insecure mark://localhost:6309/index.md

Keyboard shortcuts:

Key Action
Tab Cycle through links
Enter Follow selected link
[ Back
] Forward
d Document graph view
? Help

7. Read and write documents

Fetch a document to stdout:

demarkus --insecure mark://localhost:6309/notes.md

Publish from a file:

demarkus --insecure -X PUBLISH -auth $TOKEN mark://localhost:6309/notes.md \
  -body "$(cat notes.md)"

8. Edit documents

The edit subcommand opens a document in $EDITOR and publishes on save:

demarkus edit -auth $TOKEN --insecure mark://localhost:6309/notes.md

If the document doesn’t exist yet, it opens an empty editor and creates it on save.

Why publish through the protocol?

Writing files directly to the content directory bypasses version history — those changes won’t be tracked. Everything published via demarkus -X PUBLISH gets a version number, a hash, and an immutable record. That’s what makes it a knowledge base rather than just a folder of files.

Running on startup (macOS)

If you used the full installer, the server starts automatically via launchd. To start/stop manually:

# macOS 14+
launchctl bootstrap "gui/$(id -u)" ~/Library/LaunchAgents/io.demarkus.server.plist
launchctl bootout "gui/$(id -u)" ~/Library/LaunchAgents/io.demarkus.server.plist

Running on startup (Linux)

sudo systemctl enable --now demarkus
sudo systemctl status demarkus