A quick and easy CLI journaling tool that uses Github Wiki repos for organizing journal entries.
- Git
- Github account (and access to a repo for the wiki)
brew install cjsaylor/tap/jrnl
Download the binary from the latest release
go get -u github.com/cjsaylor/jrnl/cmd/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
You can configure jrnl
with the following environment variables:
JRNL_EDITOR
(vim
) - Editor to useJRNL_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.
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
---
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
- cooltag 2017-12-01
- another cool tag 2017-12-01
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
- cooltag 2017-12-01, 2017-12-04
- another cool tag 2017-12-01
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.
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
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 {}")
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 go modules
For distribution, the goreleaser
tool is used. Tag a new version and run goreleaser --rm-dist
to tag and distribute.