A CLI Note Manager
nom
is a CLI for managing notes written in markdown. Designed with publishing and searching in mind.
.index.md
file separates drafts from published notes - making it easier to hop into an unfinished draft. .index
is also organized A->Z for both lists.To use the CLI, install it globally:
$ yarn global add note-mgr-cli
# or
$ npm install note-mgr-cli --global
At this point, nom
will be installed. You can confirm by seeing the help menu
$ nom --help
Before using nom
, it must be initialized with nom init
-i --init
initialize nom
-n --new
will create a new note and add it to the .contents
list-u --update
will update the frontmatter for the selected note-r --remove
will prompt for a note to remove-d --date
will interrogate the notes to understand dates of the notes (e.g., publish date)-c --count
will count the notes based on flags provided% nom init -t path/to/target
If no target directory is passed, you will be prompted to provide one in an interactive session.
To create a new note, at a minimum nom
requires either a title (-t --title
) or to create the note interactively (-i --interactive
).
All options are available for setting declaratively with the following options:
"-c --category <category...>", "The frontmatter for category"
$ nom new -c "note category"
"-d --date ", "The frontmatter for publish"
$ nom new -d 2020-02-20
"-i --interactive", "Interactively publish a note"
$ nom new -i
"-p --publish ", "The frontmatter for publish"
$ nom new -p 2020-02-20
"-t --title <title>", "The frontmatter for the title"
$ nom new --title "the note's title"
"--private", "Mark the note private"
$ nom new --private
"--tags <tag...>", "The frontmatter for the tags"
$ nom new --tag "tag one" --tag second --tag "a third"
The nom update
command begins by finding a note interactively using a fuzzy search of all files within the notes directory. The search is based on the file name, which is tied to the slug of the note.
Nota Bene: If a note is not updated interactively, only the options passed in from the command line will be updated. So, if no options are passed, nothing will get updated, even after the note is selected.
To update a new note, at a minimum nom
requires either a title (-t --title
) or to create the note interactively (-i --interactive
). All options are available for setting declaratively with the following options:
"-c --category <category...>", "The frontmatter for category"
$ nom update -c "note category"
"-d --date ", "The frontmatter for publish"
$ nom update -d 2020-02-20
"-i --interactive", "Interactively publish a note"
$ nom update --interactive
"-p --publish ", "The frontmatter for publish"
$ nom update -p 2020-02-20
"-t --title <title>", "The frontmatter for the title"
$ nom update --title "the note's title"
"--private", "Mark the note private"
$ nom update --private
"--tag <tag...>", "The frontmatter for the tags"
$ nom update --tag "tag one" --tag second --tag "a third"
nom
has a built in remove
method for deleting notes that are no longer desired. The process is interactive by default.
Nota Bene: Use caution as this is a destructive action. It cannot currently be undone. There's an open issue to make remove a soft delete.
The date
command for nom
is intended to identify certain relevant dates quickly.
"-f --first", "Return the earliest published note"
$ nom date --first
"-l --latest", "(Default) Return the latest published note"
$ nom date --latest
"-r --recent", "Return the most recent published note in the past"
$ nom date --recent
WIP "-p --private", "Filters only for private notes" and "-np --no-private", "Filters only for public notes" These options are intended to be used in conjunction with other date filters.
$ nom date --recent --private
# or
$ nom date --latest --no-private
Similar to dates, the count
command in nom
is intended to aid simply querying of your notes. It does not currently support stacking of counters (e.g., nom count --stage --category
will list the counts by stage and category independently).
This project uses yarn
to manage dependencies.
yarn build && yarn start
will launch the application locally.
If you want the experience of a globally installed CLI, create a link using yarn link
from the root of the project. When done, clean up the link with yarn unlink
.
If you run into a permission denied
error, make sure the script is executable:
zsh: permission denied: note-mgr
$ chmod +x index.js
This project follows SemVer and an adaptation of the conventional commit standard.
Commits are prefixed with the following emoji to indicate their purpose.
Symbol | code | Interpretation |
---|---|---|
โจ | :sparkles: |
feature |
๐ | :bug: |
fix |
๐ | :nail-polish: |
style |
๐งผ | :soap: |
chore |
๐ | :memo: |
docs |
๐ | :racehorse: |
perf |
๐งช | :lab: |
test |
๐๏ธ | :building-construction: |
refactor |
๐งฐ | :toolbox: |
tooling / infrastructure |
๐ | :rocket: |
major version bump |
๐ฆ | :package: |
minor version bump |