Skip to content
/ nn Public

A command line tool to handle notes

License

GPL-3.0, MIT licenses found

Licenses found

GPL-3.0
LICENSE
MIT
LICENSE.txt
Notifications You must be signed in to change notification settings

hectron/nn

nn

A command line tool to handle notes

Interface

The nn interface is comprised of the following commands:

  • doctor
  • new
  • edit
  • ls
  • rm
  • template
    • new
    • edit
    • rm
    • ls
  • setup
  • sync

Creating notes

nn new example.go # => $NOTE_DIR/YYYYmmdd_example.go

# Creates a note in a nested folder
nn new path/to/the/note.md # => $NOTE_DIR/path/to/the/note.md

# With default filetype `go`, set in config
nn new example # => $NOTE_DIR/example.go

Configuring nn

nn stores settings in .nn/settings.json. nn looks for the settings in the following hierarchy:

  1. $HOME/.nn/settings.json
  2. $PWD/.nn/settings.json
  3. ENV["NN_<SETTING_NAME>"] (uppercased and underscored, without default_)

These are combined from the top down (local .nn/settings.json overwrites previous settings).

nn offers the following configurations:

setting value type required default
default_file_type string true '.md'
default_note_dir string true cwd (if a git directory)
default_template string false None
default_prefix string (ISO 8601) true '%Y%m%d'
# Creates a new `.nn/settings.json`, and walks through the configuration
nnn config init

# Lists current settings (grouped by source)
nnn config

# Sets one or more configs in $PWD/.nnn/settings.json
nnn config set <config>=<value> ... <configN>=<valueN>

Templates

nn supports creating templates, and using them as a basis for creating new notes.

nn stores templates in $NOTE_DIR/.nn/templates/

# To view available templates
nn template ls

# To create a new template
nn template new meeting     # => $NOTE_DIR/.nnn/templates/meeting
nn template new meeting.md  # => $NOTE_DIR/.nnn/templates/meeting.md

# Edit a template
nn template edit meeting    # => $NOTE_DIR/.nnn/templates/meeting
nn template edit meeting.md # => $NOTE_DIR/.nnn/templates/meeting.md

# To remove a template
nn template rm meeting.md

# Creates a note using `$NOTE_DIR/.nnn/templates/meeting`
nn new poc.md -t meeting

Syncing

nn syncs notes in $NOTE_DIR using git. It pushes up a commit titled "Note sync: %Y%m%d".

nn sync

About

A command line tool to handle notes

Resources

License

GPL-3.0, MIT licenses found

Licenses found

GPL-3.0
LICENSE
MIT
LICENSE.txt

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages