Skip to content

subtrack follows a zero-configuration philosophy. It works out of the box with sensible defaults.

Environment variables

VariableDescriptionDefault
SUBSC_CLI_DB_DIROverride the database directory~/.config/subtrack
SUBSC_CLI_DB_PASSPHRASEDerive encryption key from a passphrase instead of a key filenone (uses .key file)

Example usage

bash
# Use a custom directory for the database
export SUBSC_CLI_DB_DIR=~/project/subtrack-data
subtrack list

# Or set it per-command
SUBSC_CLI_DB_DIR=/tmp/test-db subtrack add \
  --name Spotify \
  --price 980 \
  --currency JPY \
  --cycle monthly

# Use a passphrase instead of a key file
export SUBSC_CLI_DB_PASSPHRASE="my-secure-passphrase"
subtrack list
💡 Tip: Changing SUBSC_CLI_DB_DIR lets you maintain separate databases — useful for testing or multi-profile setups.
⚠️ Important: If you use SUBSC_CLI_DB_PASSPHRASE or the auto-generated encryption key, back up the key file (~/.config/subtrack/.key) or remember your passphrase. Without it, encrypted backups and the database itself cannot be recovered.

Database encryption

subtrack automatically encrypts the SQLite database file on disk using AES-256-GCM. On first run, a random 256-bit key is generated and stored in:

text
~/.config/subtrack/.key

Alternatively, you can set SUBSC_CLI_DB_PASSPHRASE to derive the encryption key from a passphrase (using scrypt key derivation). This is useful for CI environments or when you want to avoid storing a key file.

Backups can also be encrypted with subtrack backup --encrypt.

Configuration management (subtrack config)

subtrack provides a config command to manage runtime settings stored in ~/.config/subtrack/config.json:

bash
# List all config values
subtrack config list

# Get a specific value
subtrack config get defaultCurrency

# Set a value
subtrack config set monthlyBudget 500

# Reset all config to defaults
subtrack config reset

See the Commands reference for full details.

Config keys

KeyDescriptionDefault
defaultCurrencyDefault currency for display and analyticsUSD
monthlyBudgetMonthly spending budget in USD (0 = disabled)0
themeDisplay theme preset (default, light, high-contrast, none)default
notifyDaysDefault look-ahead days for subtrack notify7
notifyChannelsNotification channels (comma-separated: os, slack, webhook)os
slackWebhookSlack webhook URL for Slack notifications
webhookUrlGeneric webhook URL for notifications
yearlyBudgetYearly budget target in USD
profilesSaved filter profiles (stored as JSON object){}
activeProfileCurrently active filter profile name
budgetsMultiple named budgets for budget-vs-actual tracking
tableBorderColorTable border color override (color name)theme default
tableHeaderColorTable header color override (color name)theme default
tableZebraColorZebra stripe background color override (color name)theme default
accentColorAccent color override for headings (color name)theme default
tableZebraEnable/disable zebra striping (on/off)on
tableMinWidthMinimum table width in columns (20–200)40
dateFormatDate display format (iso or short)iso
listShowNotesShow notes column in subtrack list by default (on/off)off
listShowMethodShow payment method column in subtrack list by default (on/off)off

Set values with:

bash
subtrack config set notifyDays 3
subtrack config set defaultCurrency JPY

The config set command validates input (e.g., currency codes must be ISO 4217, budget must be non-negative).

Display themes

The theme key switches between color presets:

PresetBest for
defaultDark terminal backgrounds (default)
lightLight terminal backgrounds
high-contrastAccessibility / high ambient light
nonePlain monochrome output (piping, screen readers)

Individual color keys (tableBorderColor, tableHeaderColor, tableZebraColor, accentColor) override the preset. Valid color names: black, red, green, yellow, blue, magenta, cyan, white, gray, and the bright* variants.

bash
# Switch to the light theme
subtrack config set theme light

# Or fine-tune a preset
subtrack config set theme high-contrast
subtrack config set accentColor yellow

# Disable zebra striping
subtrack config set tableZebra off

No config file

subtrack does not use configuration files (.subtrackrc, subtrack.json, etc.). All settings are controlled via the config command, environment variables, or CLI flags. This keeps the tool simple and predictable.

Currency & cycle choices

Supported currencies (36)

The interactive prompt provides a curated list of 36 currencies. The --currency flag accepts any valid ISO 4217 3-letter code supported by open.er-api.com.

AED  ARS  AUD  BRL  CAD  CHF  CLP  CNY  COP  CZK
DKK  EGP  EUR  GBP  HKD  HUF  IDR  ILS  INR  JPY
KRW  MXN  MYR  NGN  NOK  NZD  PHP  PLN  SAR  SEK
SGD  THB  TRY  TWD  USD  VND  ZAR

View the full list with descriptions using:

bash
subtrack currency

Supported billing cycles (6)

weekly  bi-weekly  monthly  quarterly  semi-annual  yearly

MIT