Note is a simple but amazing note-taking tool for the command, written in Go. It supports creating, editing, viewing, searching notes, and includes Git integration to keep your notes synchronized and version-controlled. It works amazingly well with note systems like Obsidian.
- Create and edit notes using your preferred text editor.
- Scratch note functionality for instant note-taking, and piping output into a note. (
echo !! | note
) - Automatically save notes in the specified notes directory (
NOTES_PATH
). - Supports searching notes by their content to easily locate what you need.
- Git integration for version control
- Shell autocompletion for commands AND file names (supports Bash, Zsh, Fish, and PowerShell).
go install github.com/rymdlego/note@latest
This will place the executable in $HOME/go/bin or $GOPATH (if you have it set to something else). Make sure to have that in your $PATH
-
Clone the repository:
git clone https://github.com/rymdlego/note.git cd note
-
Build the application:
go build -o note
-
Move the
note
binary to your PATH:sudo mv note /usr/local/bin/
Before using the note
CLI, ensure that the following environment variable is set:
NOTES_PATH
: Path to the directory where notes are stored.
Optional environment variables:
EDITOR
: The text editor to use when editing notes (default:vi
).NOTES_FILETYPE
: The file type for notes (default:md
).NOTES_SCRATCHFILE
: The scratch file name for quick notes (default:scratch
).
For example:
export NOTES_PATH="$HOME/notes"
export EDITOR="nvim"
export NOTES_SCRATCHFILE="random"
-
Edit or Open a new Note:
note edit <name>
This command opens the note for editing, or just opens the editor with the desired document name.
Alias:
note insert <name>
-
View a Note:
note show <name>
Displays the contents of the note using the configured viewer (
NOTES_VIEWER
, default iscat
, you might want to use something cool likeglow
).Aliases:
note view
,note display
-
List Notes:
note list
List all notes in a tree structure.
Alias:
note ls
-
Search Notes by Name or Content:
note find <searchstring>
Finds notes whose content contain the search string.
-
Version:
note version
Displays the current version of the application.
-
Git Integration: You can run any Git command inside your notes directory.
note git <git-command>
Examples:
note git status
note git add .
note git commit -m "Updated notes"
You can also use these shorthand commands for common Git actions:
note status
note add <files>
note commit -m "message"
note push
note pull
If you run note
without any arguments, it opens the "scratch" note, which is just a generic note for unsorted ideas:
note
You can also pipe content to the scratch note:
echo "Eggs and Avocadoes" | note
Why not document that long command you just ran:
kubectl create secret generic something -n default --from-env-file myfile --dry-run=client -o yaml
echo !! | note
To enable shell autocompletion, use the following command based on your shell:
-
Bash:
source <(note completion bash)
-
Zsh:
source <(note completion zsh)
-
Fish:
note completion fish | source
-
PowerShell:
note completion powershell | Out-String | Invoke-Expression
To permanently enable autocompletion, add the corresponding command to your shell’s configuration file (~/.bashrc
, ~/.zshrc
, etc.).
This project is licensed under the MIT License. See the LICENSE file for details.