A simple Go command-line tool to backup all your YNAB (You Need A Budget) budgets by downloading each as JSON files.
- Fetch your complete list of budgets via the YNAB API
- Download each budget's detailed JSON export
- Save each file as
BudgetName_BudgetID_Timestamp.json - Fully configurable via CLI flags or environment variables
- Optional verbose logging for progress feedback
- Go 1.18+
- A YNAB API access token (Bearer token)
-
Clone the repository:
git clone https://github.com/bad33ndj3/ynabvault.git
-
Build and install:
cd ynabvault go install ./... -
Or install directly without cloning:
go install github.com/bad33ndj3/ynabvault@latest
You will need a YNAB API access token. Generate one in your YNAB account as described in the official documentation.
ynabvault [--token <TOKEN>] [--output <DIR>] [--url <API_URL>] [--verbose]--token— YNAB API bearer token. If omitted, falls back to theYNAB_BEARER_TOKENenvironment variable.--output—Directory to save the budget JSON files (default:budgets).--url— Base API URL for the budgets endpoint (default:https://api.youneedabudget.com/v1/budgets).--verbose— Enable verbose logging to stderr.
YNAB_BEARER_TOKEN— Alternative to--tokenflag for providing the API token.
Backup to the default budgets folder:
ynabvault --token YOUR_TOKENBackup with custom folder and verbose output:
ynabvault --token YOUR_TOKEN --output ./my_backups --verboseUse environment variable for token:
export YNAB_BEARER_TOKEN=YOUR_TOKEN
ynabvault --verbose