Skip to content

sduras/duras

Repository files navigation

duras

Daily notes as plain text files, with search and optional GPG encryption.

duras append "started work on new feature #project"
duras search project
duras show

One file per day:

~/Documents/Notes/YYYY/MM/YYYY-MM-DD.dn

No database. No index. No background processes. Writes are atomic. If duras is removed, the notes remain readable with any text editor.

Optional Vim/Neovim integration: duras_bridge.

Install

Linux (x86_64)

Using curl:

curl -L \
  https://codeberg.org/duras/duras/releases/download/v2.0.0/duras-linux-amd64 \
  -o ~/.local/bin/duras &&
chmod +x ~/.local/bin/duras

Using wget:

wget -O ~/.local/bin/duras \
  https://codeberg.org/duras/duras/releases/download/v2.0.0/duras-linux-amd64 &&
chmod +x ~/.local/bin/duras

macOS (Apple Silicon)

curl -L \
  https://codeberg.org/duras/duras/releases/download/v2.0.0/duras-macos-arm64 \
  -o /usr/local/bin/duras &&
chmod +x /usr/local/bin/duras

macOS (Intel)

curl -L \
  https://codeberg.org/duras/duras/releases/download/v2.0.0/duras-macos-amd64 \
  -o /usr/local/bin/duras &&
chmod +x /usr/local/bin/duras

Verify

duras --version

If ~/.local/bin is not in your PATH, add to your shell configuration file:

export PATH="$HOME/.local/bin:$PATH"

Build from source

Requires OCaml and dune.

git clone https://codeberg.org/duras/duras.git
cd duras
make install

macOS note

macOS may block unsigned binaries. If a security warning appears:

xattr -d com.apple.quarantine /usr/local/bin/duras

Commands

duras                        open today's note in $EDITOR
duras append [TEXT]          append timestamped entry; reads stdin if no text
duras show [DATE]            print note to stdout
duras list [-n N]            list notes, newest first (default: 10)
duras search KEYWORD [-i]    search notes for literal string
duras tags [TAG]             list #tags with counts, or notes for a tag
duras stats                  counts, size, date range, streak
duras export [DIR]           create tar.gz archive
duras audit                  validate notes directory structure
duras path [DATE]            print absolute path of note file
duras dir                    print notes directory
duras today                  print today's date
duras echo [DATE]            notes on this month-day across all years
duras near [DATE]            notes within ±3 days
duras mv FROM TO             move a note to a different date

Global flag: -c — use GPG-encrypted note (applies to open, append, show, path).

Dates

YYYY-MM-DD    absolute
0             today
-1            yesterday
-7            one week ago

Environment

Variable Default Purpose
DURAS_DIR ~/Documents/Notes Notes directory
EDITOR nano, vi, or ed Editor for open
DURAS_GPG_KEY self GPG recipient for -c

Exit codes

Code Meaning
0 Success
1 Generic error
2 Not found
3 Invalid input
4 External tool failure

Documentation

man duras
duras --help

Specification: spec/

Other implementations

See HISTORY.md for implementation history and benchmarks.

License

ISC. See LICENSE.

About

daily notes as plain text files, with search and optional gpg encryption

Topics

Resources

License

Stars

Watchers

Forks

Contributors