$ cd new # Print help for `zk new` $ zk new --help >Usage: zk new [] > >Create a new note in the given notebook directory. > >Arguments: > [] Directory in which to create the note. > >Flags: > -h, --help Show context-sensitive help. > --notebook-dir=PATH Turn off notebook auto-discovery and set manually > the notebook where commands are run. > -W, --working-dir=PATH Run as if zk was started in instead of the > current working directory. > --no-input Never prompt or ask for confirmation. > > -i, --interactive Read contents from standard input. > -t, --title=TITLE Title of the new note. > --date=DATE Set the current date. > -g, --group=NAME Name of the config group this note belongs to. > Takes precedence over the config of the > directory. > --extra=KEY=VALUE,... Extra variables passed to the templates. > --template=PATH Custom template used to render the note. > -p, --print-path Print the path of the created note instead of > editing it. > -n, --dry-run Don't actually create the note. Instead, prints > its content on stdout and the generated path on > stderr. > --id=ID Skip id generation and use provided value. # Default note title. $ zk new --print-path >{{working-dir}}/untitled.md $ cat untitled.md ># Untitled > > # Provide a custom title. $ zk new --title "Custom title" --print-path >{{working-dir}}/custom-title.md $ cat custom-title.md ># Custom title > > # Provide a custom note id $ zk new --group id --id 123abc --dry-run 2>{{working-dir}}/123abc.md # Provide a custom title (short flag). $ zk new -t "Another custom title" -p >{{working-dir}}/another-custom-title.md # Opens the editor after creating a new note. $ EDITOR="echo 'edit'" zk new --title "Edit" >edit {{working-dir}}/edit.md # Prints the path of newly created note instead of editing it. $ EDITOR="echo 'edit'" zk new --title "Print path" --print-path >{{working-dir}}/print-path.md # Set explicitely today's date (natural dates). $ zk new --group date --date "January 2nd" --dry-run 2>{{working-dir}}/02-01.md $ zk new --group date --date "December 24th" --dry-run 2>{{working-dir}}/24-12.md # Set explicitely today's date (RFC 3339) $ zk new --group date-raw --date "2022-01-23T13:55:48+01:00" --dry-run 2>{{working-dir}}/2022-01-23 13:55:48 +0100 {{match ".+"}}.md $ zk new --group date-raw --date "2022-02-17T17:53:12" --dry-run 2>{{working-dir}}/2022-02-17 17:53:12 {{match ".+"}}.md $ zk new --group date-raw --date "2022-02-17T17:53" --dry-run 2>{{working-dir}}/2022-02-17 17:53:00 {{match ".+"}}.md $ zk new --group date-raw --date "2022-02-17" --dry-run 2>{{working-dir}}/2022-02-17 00:00:00 {{match ".+"}}.md $ zk new --group date-raw --date "2022-02" --dry-run 2>{{working-dir}}/2022-02-01 00:00:00 {{match ".+"}}.md $ zk new --group date-raw --date "2022" --dry-run 2>{{working-dir}}/2022-01-01 00:00:00 {{match ".+"}}.md # Dry run doesn't write the note. $ zk new --dry-run --title "Dry run" ># Dry run > > 2>{{working-dir}}/dry-run.md 1$ cat dry-run.md 2>cat: dry-run.md: No such file or directory # Dry run (short flag). $ zk new -n --title "Dry run" ># Dry run > > 2>{{working-dir}}/dry-run.md # Pipe content in a new note. $ echo "Content of the note" | EDITOR=cat zk new --interactive --title "Piped note" ># Piped note > >Content of the note > # Redirect file to standard input when creating a new note. $ echo "Content of the note" > input $ EDITOR=cat zk new --interactive --title "Note from redirected input" < input ># Note from redirected input > >Content of the note > # Existing notes are not overwritten, but can be edited. $ zk new --force-input n --title "Piped note" >? piped-note.md already exists, do you want to edit this note instead? (y/N) # Check that the content was not overwritten $ cat piped-note.md ># Piped note > >Content of the note >