gn (Get Notes) is a zero-dependency CLI
note utility that saves your markdown files directly
to a private GitHub repository or Dropbox folder. It
acts as a lightweight sync layer using nothing but
native Bash and curl - no local Git installation or
setup required. When you run gn [note], it pulls the
latest file version from your storage host via HTTP
API, opens it in your default $EDITOR, and
automatically pushes your changes back immediately
as soon as you save and exit. gn runs
anywhere Bash does - including Linux, MacOS, WSL and
BSD. It runs completely in the foreground with zero
background daemons, no local databases, and no
tracking. It is built to give you seamless cloud
backups while keeping your notes as raw, standalone
text files under your own control.
Before you run the install script below, prepare your storage account using one of the two options:
gn, or
anything you like) to hold your notes. (The
setup script will offer to create this for you
automatically if it doesn't already exist.)
repo scope - this is what lets
gn read and write files in your
repository over the GitHub API.
files.content.write and
files.content.read, then click
*Submit* at the bottom.
Run Installer Setup Command:
curl -fsSL https://gn-notes.pages.dev/install.sh -o
install.sh && chmod +x install.sh && ./install.sh
Prefer to do things yourself instead of running the installer? Here's the whole process by hand.
Download gn.sh into ~/gn, make
it executable, and link it onto your $PATH.
mkdir -p ~/gn
curl -fsSL https://gn-notes.pages.dev/gn.sh -o ~/gn/gn.sh
chmod +x ~/gn/gn.sh
sudo cp ~/gn/gn.sh /usr/local/bin/gn
Generate a Personal Access Token with the
repo scope from your
GitHub token settings, then create the repository you want to sync notes to
(or let it 404 and create it manually). Write the
following to ~/gn/gn.conf:
# gn configuration (GitHub backend)
GIT_TOKEN=ghp_your_personal_access_token
GIT_OWNER=your-github-username
GIT_REPO=gn
Then protect the file:
chmod 600 ~/gn/gn.conf
Create a scoped, app-folder Dropbox app at the
Dropbox Developer Console, enable the files.content.write and
files.content.read permissions, and note
its App key and
App secret.
Visit this URL (replace
YOUR_APP_KEY) to authorize the app and get
a one-time code:
https://www.dropbox.com/oauth2/authorize?client_id=YOUR_APP_KEY&response_type=code&token_access_type=offline
Exchange that code for a long-lived refresh token:
curl -s -X POST https://api.dropbox.com/oauth2/token \
-d code=YOUR_AUTH_CODE \
-d grant_type=authorization_code \
-d client_id=YOUR_APP_KEY \
-d client_secret=YOUR_APP_SECRET
Copy the refresh_token from the response
and write the following to ~/gn/gn.conf:
# gn configuration (Dropbox backend)
DROPBOX_APP_KEY=your_app_key
DROPBOX_APP_SECRET=your_app_secret
DROPBOX_REFRESH_TOKEN=your_refresh_token
DROPBOX_PATH=/notes
Then lock the file down:
chmod 600 ~/gn/gn.conf
Run gn to open the default note, or
gn myfile to open or create
myfile.md. gn automatically pulls the
latest version before editing and pushes your changes
back on save. Run gn -h for the full list
of options.
# Source text preview area...