Quick and easy CLI journaling tool for Github wiki journals.
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.

README.md

jrnl

A quick and easy CLI journaling tool that uses Github Wiki repos for organizing journal entries.

View an example wiki journal


GoDoc

Requirements

  • Git
  • Github account (and access to a repo for the wiki)

Installation

MacOS

brew install cjsaylor/tap/jrnl

Windows & Linux

Download the binary from the latest release

Compiling from source

go get -u github.com/cjsaylor/jrnl/cmd/jrnl

Quick start

Install jrnl

go get -u github.com/cjsaylor/jrnl/cmd/jrnl

Clone a github wiki you want to act as the store of your journal:

git clone https://github.com/<yourname>/<journel_repo>.wiki.git ~/journal.wiki

Quickly drop into the editor of your choice (default vim but configurable via $JRNL_EDITOR):

jrnl

Write your entry and then "memorize":

jrnl memorize

Options

You can configure jrnl with the following environment variables:

  • JRNL_EDITOR (vim) - Editor to use
  • JRNL_EDITOR_OPTIONS ("") - Additional CLI flags for your editor. IE, for VS Code: -n $HOME/journal.wiki/
  • JOURNAL_PATH (~/journal.wiki) - Path to your cloned Github wiki repo.

Commands

Tag

jrnl has the ability to tag a journal entry so that it can be easily referenced and found.

jrnl tag -t sometag

This would append "sometag" to the journal entry in frontmatter format:

---
tags:
- sometag
---

Index

jrnl has the ability to generate an Index.md that allows you to easily reference any journal entry by a tag.

You can use the tag command specified above to specify tags.

jrnl tag -t cooltag -t another cool tag -d "2017-12-01"

Then run the index command:

jrnl index

Which generates:

~/journal.wiki/Index.md

If there is more than one journal entry that uses the same tag:

jrnl tag -t cooltag -t -d "2017-12-04"

Then jrnl index would generate:

~/journal.wiki/Index.md

Append an image

Many developers use hand-written notes (or a whiteboard) and want to store it in a common journal.

You can use the jrnl image /path/to/image command to quickly add an image to the journal repo and append it to the current journal entry.

Tips & Tricks

Use Find Command to Create a Book

You can use the find command (as of v0.3.0) to create a single document of all journal entries related to a tag (or tags):

jrnl find --tag sometag --tag somerelatedtag | xargs cat > sometag.md

Use find command to add a common tag

You can use the find (as of v0.3.0) command and the tag command (as of v0.4.0) to add a common tag or tags:

jrnl tag -t newtag $(jrnl find -tag existingtag | xargs -I {} echo "-f {}")

Development

To compile the CLI tool:

go build -o jrnl cmd/jrnl/main.go

To run the unit tests:

go test $(go list ./... | grep -v /vendor/)

To add a dependency use the dep tool

For distribution, the goreleaser tool is used. Simply run goreleaser to tag and distribute.