node package manager
Easy sharing. Manage teams and permissions with one click. Create a free org »



DayOne CLI with template support.

Note: this only works with DayOne v2.

NPM Build Status js-standard-style Greenkeeper badge



# Install the dayone2 executable
sudo /Applications/Day\


npm install @lukekarrys/dayone-templates -g


npm install @lukekarrys/dayone-templates --save


This module is a system for creating DayOne entries that are populated via templates and passing data to those templates.

By default dayone-templates will look for templates in ~/.config/dayone-templates. If you want to point it to somewhere else, use the dir option.

So first thing you should do is create some mustache templates in the templates directory. For this example, let's say there's one in there called run.

Templates can have front-matter which can be used to populate the template with default data. When you're creating an entry, you can pass in data which will override that default data.


title: Run
  - run
  - workout
# {{title}}




Then you can run the dayone-templates command. Specify the name of the template you just created, and any additional tags you want the entry to have. You can also populate any of the template variables. Also since title wasn't passed in, it will use the default title from the front-matter.

dayone-templates \
  --name run \
  --tags intervals \
  --workout "4x400" \
  --result "52, 51, 50, 49" \
  --notes "😄"

Then you'll have an entry that looks like this:


See the real dayone CLI for a list of all available options. All those options can be passed to dayone-templates as well.

name (required)


The name of the template to use. This should be a file located inside the dir option.

dir (optional, default: ~/.config/dayone-templates)


The directory to look for templates in.