← Releases

paulund/goldcli v1.1.0 - Caching layer keeps you under the API free tier

goldcli v1.1.0 adds local caching for gold price API responses, cutting redundant requests and keeping you safely inside the 100-request-per-month free ...

goldcli is a CLI tool that fetches live and historical gold spot prices from an API. The free tier allows 100 requests per month, which gets tight if you're querying multiple dates regularly. v1.1.0 adds a local caching layer to cut redundant calls.

What changed

Responses are now stored in ~/.cache/goldcli/. There are two caching strategies:

  • Latest spot prices are cached for 24 hours. You can adjust this with the CACHE_MAX_AGE_HOURS environment variable.
  • Historical prices are cached forever. Since historical data never changes, goldcli only fetches the dates it hasnt seen before.

A new --refresh (-f) flag skips the cache entirely and forces a fresh API call. The result is still written to cache afterwards, so subsequent runs stay fast.

The release also adds a CONTEXT.md file that documents key project terminology.

Why it matters

The 100-request-per-month free tier is the main constraint when using goldcli. Without caching, every run hits the API even if you queried the same date yesterday. With this change, daily spot price checks cost one request per day instead of one per invocation. Historical backfills only fetch missing dates rather than the whole range each time.

How to upgrade

npm update -g goldcli

No breaking changes. The cache directory is created automatically on first run. If you ever need to clear it, delete ~/.cache/goldcli/.


Newsletter

A weekly newsletter on React, Next.js, AI-assisted development, and engineering. No spam, unsubscribe any time.