~$ bn.sh
Get bn.sh

a bash script · one file · no server

Bana Notes
for the terminal.

bn.sh is a single, dependency-light bash script that turns any cloud storage account into a note-syncing backend for your terminal — plaintext or encrypted, from any machine, with no app to install and no service to trust.

Google Drive · OneDrive · Dropbox · Box · or any rclone remote — bring your own storage.

bn — recorded session
01 / about

What it actually does

No daemon, no account with Bana, no proprietary format. Just files, a fast editor loop, and rclone doing the transport.

Run bn and it opens today's scratchpad in $EDITOR. Save and quit, and the file is pushed to your cloud remote in the background — you're back at the prompt before the upload even finishes. Run bn groceries and it does the same for a note called groceries.txt. That's the whole idea: notes are plain .txt files on disk, mirrored to storage you already own, edited with the editor you already use.

For anything sensitive, bn -e NAME opens a note that's decrypted to a temp file, edited, then re-encrypted with OpenSSL (AES-256-CBC) before it ever touches the cloud — the plaintext never leaves your machine. A second, entirely separate profile (-c) lets you point at a second remote — a work Dropbox next to a personal Drive, say — without the two ever mixing.

02 / capabilities

Built for the prompt, not a browser tab

encryption

Vault notes

-e NAME encrypts with AES-256-CBC + SHA-512 before sync. Passphrases are never echoed or written to disk.

storage

Bring your own backend

Built on rclone: Google Drive, OneDrive, Dropbox, Box, or anything else rclone supports — including a fully headless setup flow.

profiles

Dual contexts

The -c flag swaps to a completely separate directory and remote — a second identity, one keystroke away.

sync

Conflict-aware pulls

Every edit checks remote mtimes first and pulls a newer copy before you start typing, so two machines don't fight each other.

speed

Background push

Saves return control to your shell immediately; the upload runs in a subshell and logs failures to .sync_errors instead of blocking you.

portable

Zero real dependencies

Pure POSIX-ish bash plus OpenSSL, which ships almost everywhere. Missing rclone gets offered as an automatic, scoped-to-your-home download.

03 / reference

Command reference

Exactly what bn -h prints.

bn -h
bn - Bana Notes Help bn [flags] Edit bn.txt and push to cloud storage bn [flags] NAME Create/edit NAME.txt and push to cloud storage Global profile flag
-cSwitch target to the ALTERNATE cloud profile / directory. Must be the *first* flag passed — e.g. bn -c -l or bn -c mynote.
Commands
-e NAMECreate/edit an encrypted note (NAME.txt.enc) and push to cloud storage
-rRename a file (locally and on cloud storage — plain or encrypted)
-dDelete a file (locally and on cloud storage — plain or encrypted)
-bBackup notes locally to ~/bn-YYYY-MM-DD
-lList local notes with size, modified date, and type
-pPull all notes (plain and encrypted) from cloud storage
-s TERMSearch across plaintext notes for TERM (encrypted notes are skipped)
-nCreate/edit a note with today's date
-a NAME NAMEOpen multiple plaintext notes at once
-cCreate alternate cloud storage configuration
-c NAMEWork on NOTE using the alternate cloud storage configuration
-xReset active cloud storage configuration to set up a different provider
-hShow this help
Active backend (example)
rclone remotebn
notes directory~/bn
04 / install

Get it running

Five minutes, one file, one setup wizard.

Download the script

Save bn.sh anywhere — your Downloads folder is fine, you'll relocate it in a moment.

↓ Download bn.sh

Make it executable

bash needs the execute bit set before it will run the file directly.

chmod +x bn.sh

Move it onto your PATH

Put it somewhere your shell already looks, so bn works from any directory. ~/bin or ~/.local/bin are the usual spots — create one if you don't have it yet.

mkdir -p ~/bin
mv bn.sh ~/bin/bn
chmod +x ~/bin/bn

If ~/bin isn't already on your PATH, add it to your shell profile:

echo 'export PATH="$HOME/bin:$PATH"' >> ~/.bashrc
source ~/.bashrc

Using zsh instead? Swap ~/.bashrc for ~/.zshrc.

Run it once to configure storage

The first run walks you through linking a cloud backend. rclone is required — if it's not already installed, bn offers to fetch a scoped copy into ~/bin automatically, no root needed.

bn

You'll be asked to pick a provider:

1 · Google Drive 2 · OneDrive 3 · Dropbox 4 · Box 5 · manual rclone config 6 · headless (no browser here)

Options 1–4 open a browser tab to authorize. Option 6 is for servers or headless boxes: it prints an rclone authorize command to run on a machine that does have a browser, then asks you to paste back the resulting token.

Start taking notes

Setup finishes by installing itself onto your PATH automatically, so from here on bn just works.

bn                 # today's scratchpad
bn groceries       # a named note
bn -e taxes        # an encrypted note
bn -l              # list everything
bn -h              # full help