See what you've actually spent on GCP — right in your terminal.
Unlike cost estimators that calculate hypothetical costs from YAML files, gspend queries your BigQuery billing export to show real spending data.
- GCP Application Default Credentials (
gcloud auth application-default login) - BigQuery billing export enabled (gspend will guide you through setup)
roles/billing.viewer— Read billing dataroles/bigquery.user— Run BigQuery queriesroles/bigquery.dataViewer— Read billing export datasetroles/resourcemanager.projectViewer— List projects
brew install mulkatz/tap/gspendNo Node.js required — installs a standalone binary.
# 1. Set up credentials
gcloud auth application-default login
# 2. Run the interactive setup wizard
gspend init
# 3. See your spending
gspendShow current spending overview with today's costs, weekly/monthly totals, trend detection, end-of-month forecast, and top services.
--project <id> Filter to a specific GCP project
--json Output as JSON
Interactive setup wizard that discovers your billing accounts, projects, and BigQuery billing export. Creates the config file in your OS-standard config directory ($XDG_CONFIG_HOME/gspend/ on Linux, ~/Library/Preferences/gspend/ on macOS, %APPDATA%\gspend\ on Windows).
Show cost breakdown by service, or drill into a specific service to see SKU-level costs.
--service <name> Show SKU-level breakdown for a service
--month <YYYY-MM> Show breakdown for a specific month
Show daily cost history as a bar chart.
--days <number> Number of days to show (default: 14)
View or set monthly budgets per project.
gspend budget # View current budget configuration
gspend budget set 500 # Set budget to $500/month for all projects
gspend budget set 500 --project my-proj --warn 90
Live-updating cost display that refreshes automatically.
--interval <seconds> Refresh interval (default: 300)
gspend reads cost data from your BigQuery billing export — the same data that powers the GCP Billing Dashboard. Results are cached locally in SQLite for fast subsequent queries and offline access.
Data freshness: GCP billing data has a 4-24+ hour delay. gspend always shows when the data was last updated so you know exactly what you're looking at.
Cost of monitoring: BigQuery billing export tables are tiny. A typical query scans kilobytes and costs fractions of a cent. With caching (15min for status, 1h for breakdowns, 24h for history), gspend costs effectively $0/month to run.
- 100% local — no data leaves your machine
- No telemetry, no analytics
- Credentials handled via ADC, never stored by gspend
- Cost data cached locally in SQLite
- Open source — fully auditable
MIT