Systems & CLI · Beginner

Jot: A Terminal Notes CLI

Build a fast CLI to add, list, search, and tag notes saved locally, packaged as a single installable binary.

Beginner8-12 hoursGo

Jot is a command-line notes tool that stores plain-text notes in a local SQLite database and ships as a single self-contained binary. You will wire up Cobra commands for adding, listing, searching, and tagging notes, then use Bubble Tea to add a minimal interactive TUI for browsing. Building it teaches the full lifecycle of a real Go CLI tool: argument parsing, embedded database access, structured output, and cross-platform packaging.

What you build

  • Add a note from an inline argument or piped stdin with an optional list of tags
  • List notes in reverse-chronological order with tag filters and a count limit
  • Full-text search across note bodies using SQLite FTS5
  • Tag management: add or remove tags on existing notes by ID
  • Delete a note by ID with a confirmation prompt
  • Interactive TUI browser using Bubble Tea to scroll and preview notes
  • Cross-compile to a single static binary installable via go install or a release tarball

What it teaches

  • Structuring a multi-command Go CLI with Cobra including flag inheritance and persistent pre-run hooks
  • Embedding and migrating a SQLite schema at startup using the database/sql standard library and go-sqlite3
  • Using SQLite FTS5 for full-text search without an external search service
  • Building a reactive terminal UI with the Bubble Tea Elm-style update loop
  • Cross-compiling a CGo binary for multiple platforms and distributing it as a single executable
  • Reading from stdin vs positional args to make a CLI tool composable in shell pipelines

How it works

  1. 1

    User runs jot add

    • jot add "Buy milk" --tag errand
  2. 2

    Cobra parses command

    • Matches add subcommand
    • Extracts body and tags flags
  3. 3

    db.Insert()

    • Inserts row into notes table
    • Indexes body in FTS5 virtual table
  4. 4

    Confirmation printed

    • Prints: Added note #42
  5. 5

    jot list or jot tui

    • Queries SQLite
    • Renders table or Bubble Tea TUI
fig. 01 — data flow from a user command to the stored note

Sign in to open the build guide

Free account. Get the step-by-step build and every resource link.

Sign in to continue

Take it further

  • Add encrypted storage by wrapping the SQLite file with SQLCipher or encrypting the body column before insert using a key derived from a passphrase.
  • Sync notes to a remote server or S3-compatible bucket on `jot push` and pull changes on `jot pull`, using last-write-wins conflict resolution.
  • Generate a static HTML export of all notes with `jot export --html`, rendered with Go's `html/template` package and a minimal stylesheet.

More like this

All projects