gn
get_notes.md

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.

bash – 80×24
user@terminal:~$
GNU nano 7.2 - binary.md
user@terminal:~$ gn quicknote
user@terminal:~$ gn binary
Fetching... [via GITHUB]
Pushing... [via GITHUB]
Done.
user@terminal:~$
Usage: gn [options] [note]

  -h        Show this help
  -l        List notes
  -g PATTERN  Search notes (grep)
  -t        Open today's note (YYYY-MM-DD)
  -d NOTE   Delete a note
  -r OLD NEW Rename a note

Defaults to 'note' if no note is given.

Engine: GITHUB

Cloud Storage Setup Guide

Before you run the install script below, prepare your storage account using one of the two options:

Option 1: GitHub

  • Github Account: If you do not already have one, create an account.
  • Private Repository: Create a private repository (named 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.)
  • Personal Access Token: Generate a new Personal Access Token with full repo scope - this is what lets gn read and write files in your repository over the GitHub API.
  • Keep it handy: The setup script will ask you to paste in your token, username, and repository name once; these are saved to your local config file.

Option 2: Dropbox API App

  • Dropbox Account: If you do not already have one, create an account.
  • Create an App: Go to the Dropbox Developer Console and click *Create App*. Select *Scoped access* and choose the *App folder* option.
  • Set Permissions: Before finishing, click on the *Permissions* tab of your new app. Check the boxes for files.content.write and files.content.read, then click *Submit* at the bottom.
  • Keys: Keep your app's *App key* and *App secret* open from your settings tab. The setup script will ask for them to connect securely.
🔒 Privacy Note: Your credentials are kept private. The installer saves your choices into a configuration file and locks it down so that only your local computer user account can read it.

Quick Installation

Run Installer Setup Command:

curl -fsSL https://gn-notes.pages.dev/install.sh -o install.sh && chmod +x install.sh && ./install.sh

Manual Setup

Prefer to do things yourself instead of running the installer? Here's the whole process by hand.

1. Install the script

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

2a. Configure gn.conf for GitHub

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

2b. Configure gn.conf for Dropbox

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

3. Start taking notes

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.

Manual Download

# Source text preview area...