Introducing Note Cli
Note CLI is a tool that allows users to create or open notes without ever leaving the terminal. If you're someone like me who lives in the terminal and is obsessed with note-taking, this might be the perfect tool for you.
Whether you’re using Nvim or Obsidian, this utility helps you create notes on the fly without losing focus losing focus.
Table of Contents
Install
Requirements
- Golang version > 1.21
- Nvim installed
Binary Installation
go install github.com/MovieMaker93/note-cli@latest
This installs a go binary that will automatically bind to your $GOPATH
Building and Installing from Source
Clone the Note-Cli repository from GitHub:
git-clone https://github.com/MovieMaker93/note-cli
Build the Note-Cli binary:
go build
Install in your PATH
to make it accessible system-wide:
go install
Verify the installation by running:
note-cli version
Environment Configuration
You can set up your Vault path, Daily Note directory, New Note default directory, and date format via environment variables. A full example can be found in the .env
file.
Brief description:
DAILY_PATH
: Defines the directory where you store your daily notes in Obsidian
NEW_NOTE_PATH
: Defines the directory for your new notes in Obsidian (consume or refine)
VAULT
: Defines the absolute path to your Obsidian Vault
DATE_FORMAT
: Set your preferred date format. For gg/mm/dd
format, use 02-01-2006
; for the US format use 2006-01-02
.
Commands
You can either create a new note (of type refine
or consume
) or open/create today’s note.
When creating a new note, you have two options:
- Interact with the UI
- Use an imperative command
Both methods allow you to create a note with a title, content, and type. The available note types are consume
and refine
.
Example
[!NOTE]
For consume notes, a link to the new note will be automatically created in your Today note.
For the second option, you can use the provided flags to create a refine note without interacting with the UI:
note-cli new -t example-consume -c example-content --type consume
See note-cli new -h
for all the options and shorthands.
Another useful command is today
, which allows you to open the existing today’s note or create one if it’s missing:
note-cli today
How to Customize Note templates
The creation of both the Today and New notes is based on custom templates. You can find them inside: cmd/template/note/files
These templates are built using Go's tmpl
package. If you wish to customize them, simply modify the following files:
cmd/template/note/file/consume.tmpl
--> for consume note
cmd/template/note/file/refine.tmpl
--> for refine note
cmd/template/note/file/today.tmpl
--> for today note