gn
get_notes.md

gn (Get Notes) is a zero-dependency CLI note utility that saves your markdown files directly to a private GitHub, GitLab, or Codeberg repository. 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-name, it instantly pulls the latest file version from your Git host via HTTP API, opens it in your default $EDITOR, and automatically pushes your changes back immediately as soon as you save and exit.

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 - hello.md
user@terminal:~$ gn hello
user@terminal:~$ gn hello
Fetching latest cloud updates...
Syncing changes to repository...
Sync complete!
user@terminal:~$
Usage: gn [options] [note_name]

Options:
  -h        Show this help message
  -l        List all notes in your notes directory
  -g QUERY  Search for text across all notes (grep)
  -t        Quickly open today's journal note (YYYY-MM-DD.md)
  -d NOTE   Delete a note locally and from cloud remote repository
  -r OLD NEW Rename a note locally and on cloud remote repository
Examples:
  gn                  Opens index.md
  gn log              Creates log.md
  gn work/todo        Opens work/todo.md
user@terminal:~$

Prerequisites & Provider Configuration:

gn requires a private remote repository and a personal access token generated from your chosen host provider. Local Git software packages are not required.

0 Git Cloud Workspace Account

Create an account with GitHub, GitLab, or Codeberg if you do not already have one.

1 GitHub Configuration

Create a private repository named gn and generate a token with full repo permissions.

2 GitLab Configuration

Create a private project named gn. Generate a Personal Access Token inside your user settings and ensure you check the api scope permission box.

3 Codeberg Configuration

Create a private repository named gn. Go to Settings → Applications to generate a token with repository access permissions.

Download gn

Run the one-liner below, or manually configure gn using the directions further down.

Option A: One-liner (Recommended)

Paste this into your terminal. It downloads install.sh, makes it executable, and runs it. You will be prompted to select your platform and credentials.

Paste Into Terminal

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

Prefer to inspect before running? Download install.sh first.

Option B: Manual Set Up

# Script content dynamic loading zone...

Manual Installation

If you prefer not to use the automated install.sh script, follow these steps to configure gn manually:

1 Create the Config File

Create the configuration folder hierarchy, then build the target configuration file:

mkdir -p ~/gn
nano ~/gn/gn.conf
chmod 600 ~/gn/gn.conf

Add these four core values, adjusting for your personal platform profile context:

GIT_PROVIDER=github
GIT_TOKEN=your_personal_access_token_here
GIT_OWNER=your_username
GIT_REPO=gn
  • GIT_PROVIDER - Your target hosting provider platform (github, gitlab, or codeberg).
  • GIT_TOKEN - Your workspace security authorization token with repository write permissions.
  • GIT_OWNER - Your explicit user account handle name.
  • GIT_REPO - The name of the remote target repository (defaults to gn).
2 Make the Script Available Globally

Make the downloaded gn.sh script executable and copy it into your system's binaries directory:

chmod +x gn.sh
sudo cp gn.sh /usr/local/bin/gn
3 Using gn

Run gn from your Terminal. Use flags for advanced features.

gn                  # Opens your main index.md
gn daily-log        # Creates/Opens daily-log.md
gn work/reminders   # Creates work/ directory and opens reminders.md
gn -h               # Displays help page
gn -l               # Lists all your notes
gn -g "todo"        # Finds text matching "todo" inside any note
gn -t               # Opens today's automated scratchpad entry
gn -d daily-log     # Deletes daily-log.md locally and from cloud remote
gn -r old new       # Renames old.md to new.md locally and on cloud remote

Setting Up a Second Computer

Your notes live in the cloud and sync via the API, so there's nothing to clone. Just create the directory, drop in your config file, and install the script.

1 Create the notes directory and config file
mkdir -p ~/gn
nano ~/gn/gn.conf
chmod 600 ~/gn/gn.conf
GIT_PROVIDER=github
GIT_TOKEN=your_personal_access_token_here
GIT_OWNER=your_username
GIT_REPO=gn
2 Install gn

Download gn.sh and configure permissions globally:

chmod +x gn.sh
sudo cp gn.sh /usr/local/bin/gn

That's it - run gn and it will pull your notes before opening the editor.