yhoard is a small Go CLI for backing up your YNAB data to local JSON files.

Inspired by ghorg.

Features

  • Back up one budget or all accessible budgets
  • Timestamped history/ snapshots on every run
  • Atomically refreshed latest/ snapshot
  • SHA-256 checksum verification
  • One config file, env var overrides, and CLI flags

Install

go install github.com/noaahh/yhoard/cmd/yhoard@latest

Or download a prebuilt binary from GitHub Releases.

Configuration

Copy sample-config.yaml to ~/.config/yhoard/config.yaml and fill in your token.

Configuration precedence:

  1. CLI flags
  2. Environment variables
  3. ~/.config/yhoard/config.yaml
  4. Defaults
Variable Description
YHOARD_TOKEN YNAB personal access token
YHOARD_TOKEN_FILE Path to a file containing the token
YHOARD_OUTPUT_DIR Where backups are written
YHOARD_SELECTED_BUDGETS Comma-separated budget IDs or slugs
YHOARD_CONFIG Path to config file

See sample-config.yaml for a full annotated example.

Usage

# list accessible budgets
yhoard budgets

# back up all budgets
yhoard backup all

# back up one budget by id, slug, or exact name
yhoard backup <budget-id>

# verify checksums under the backup directory
yhoard verify all
# pass a token inline
YHOARD_TOKEN=your-token yhoard budgets

# write backups to a custom directory
yhoard --output-dir ~/backups/ynab backup all

# back up whichever budgets are configured in config.yaml
yhoard backup

Output Layout

~/yhoard/<budget-slug>/
  latest/
    plan.json
    money_movements.json
    money_movement_groups.json
    resources/
  history/
    20260314T120000Z/
      plan.json
      plan.json.sha256
      money_movements.json
      money_movements.json.sha256
      money_movement_groups.json
      money_movement_groups.json.sha256
      manifest.json
  state.json

Scheduling

Use your OS scheduler instead of a built-in daemon.

0 3 * * * yhoard backup all

Build from Source

go build ./cmd/yhoard

Inspiration

Borrows shape from ghorg: simple CLI, explicit configuration precedence, repeatable local backup workflow, clear on-disk structure.