onit
v0.7.0
Published
Build daily whatever files in Markdown
Downloads
59
Maintainers
Readme
Onit
Onit allows you to build daily Markdown files and create note files, all stored in one place. Onit exists to allow you to keep your daily todos in Markdown without having to manage the files to make that happen.
Overview
Let's walk through how you would use Onit over a couple of days. Once you've installed Onit, you'll need to initialize the Onit directory, which is a directory named onit
stored in your home directory. After you've done this, you can start using Onit to keep track of your daily tasks and notes.
Let's start our first day.
onit new
This create a file in the days
folder in the Onit directory with today's date as the filename. It adds a heading to the file (unless I don't want that) and saves the file. It then opens this file in the editor in which I've associated Markdown. Let's add my tasks for the day to end up with a file that looks something like this.
# Thursday Apr.09.2015
- [ ] Go for a walk
- [ ] Pickup milk
- [ ] Plan my trip
Throughout the day, I can view and update my log by typing onit today
or onit t
in my command line. Let's say I finally get to start my task for planning a trip and I'd like to write down some notes for that. I can run a command like such onit note "Upcoming Trip"
, which would create a file in my notes
directory. I can type that command any time I'd like and open my "Upcoming Trip" file. Interestingly, this would allow me to have a "Someday" file if I wanted that.
We'll say my file at the end of the day looked something like this.
# Thursday Apr.09.2015
- [x] Go for a walk
- [x] Pickup milk
- [ ] Plan my trip
With a mostly-complete task list, I finally head to bed and get a good night of sleep. I wake up the next day and grab a tall glass of the milk I picked up the day before. I head over to my computer and start the day with onit prep
. This opens the file for the previous day (though still considered by Onit to be today
—I know, confusing) and allows you to check off anything missed.
I then run onit new
. This creates a new file for the day, tells Onit that today is today and yesterday was the previous today, and opens my new file. I could use onit n -i
to copy over incomplete tasks from the day before, but I won't go to far into that now. Once done, I can now plan my current day to look something like this.
# Friday Apr.10.2015
- [ ] Mow the lawn
- [ ] Drink milk
- [ ] Take a nap
I'm probably working with others throughout the week, and I may want to let them know what I did yesterday and what I'll be doing today. I can run the onit log
command anytime and it will print today and yesterday's files to my terminal and copy that to my clipboard. If asked, I can also quickly see what yesterday looked like by typing onit yesterday
.
Maybe after a hard week of days like these I want to see what all I did. For that, you can run onit last 5
and get the last five daily entries. This is nice for keeping up with how quickly time flies by.
Onit can do more than this, but not that much more. There are some flags for some of these commands along with some aliases, all of which can be found with onit --help
.
Install
Install Onit globally so you can use it on your command line.
npm install onit -g
Usage
Init
To create the needed directories and config file, initialize Onit.
onit init
This will create an onit
folder in your home directory. There you will find all of the daily files along with the config.json
, where some defaults may be changed.
New Day
Start a new day with Onit.
onit new
or
onit n
This creates a new file and stores the previous today
file to yesterday
. Today is tomorrow's yesterday.
Flags
- To overwrite an existing file, use the
-o, --overwrite
flag - To create an empty file, use
-e, --empty
(Onit adds a header with the day's date by default) - To copy yesterday's content, use the
-c, --copy
flag - To set the date for today, use
-d, --date
with a date in the format ofYYYY-MM-DD
. Useful if you missed a day. - To copy over incomplete tasks, use the
-i, --incomplete
flag. Only works with GitHub Markdown task list syntax
Open Today's File
onit today
or
onit t
Open Yesterday's File
onit yesterday
or
onit y
Prepare by Opening the Day You Just Finished
It feels strange to finish a day, start a new one, and have to use onit today
to close out yesterday. That was even a hard sentence to write. This command is mostly an alias for onit today
, but makes more sense in its context.
onit prep
Open File for Given Date
To look what you did on a given date, give the date to Onit.
onit open 2015-04-04
or
onit o 2015-04-04
Print a Log of Today and Yesterday
To print what you did yesterday and what you're doing today, ask Onit to print a log. It will also copy the log to your clipboard.
onit log
or
onit l
Plan for the Future
You can use Onit to plan ahead as well. If that day file exists, it will open it, otherwise it will create it.
onit plan 2015-04-01
Notes
Onit can create notes. They are stored in the onit/notes
folder.
onit note Thoughts
or
onit note "More Thoughts"
If a file exists with that title, it will be opened up for editing. Otherwise it is created.
If you want to prepend the file name with a date, use the -d, --date
flag.
onit note "Thoughts for Today" -d
This creates a file named onit/notes/2015-04-08-Thoughts-for-Today.md
.
Open Folders
Onit can open Onit-specific folders for you. If not given a folder, it will open the root onit
folder. You can open specific folders, too, like notes
, day
, onit
, or query
directory.
onit folder notes
or
onit f notes
Last
Onit can print out a given number of daily entries with the last
command.
onit last 5
By default, if a number is not given, it will default to 5
. To save the query and open it up in an editor, you may use the -s, --save
flag.
License
Licensed under MIT license. See LICENSE file.