CLICommands

l4 costs

l4 costs reads cloud spend from the terminal.

Subcommands

CommandPurpose
summaryKPI overview: monthly spend, forecast, total potential savings
breakdownPer-service breakdown with filters, multi-dimensional grouping, pagination
dailyDaily costs aggregated per day for a date range
monthlyMonthly costs aggregated per month
filtersDistinct values for every filter dimension

summary

l4 costs summary [--provider <id>]

Prints the top-line KPIs: monthly spend, forecast and total potential savings. Pass --provider to scope to one cloud (aws, gcp, azure, k8s).

l4 costs summary
l4 costs summary --provider aws
l4 costs summary --json

breakdown

l4 costs breakdown [flags]

--tui opens the same rows in an interactive split-pane viewer, where you drill into a row and pivot grouping live. Filtering and sorting lists its keys and shows how flags passed on the command line seed its starting state.

Flags

FlagDescription
--provider <id>aws, gcp, azure, k8s (auto-detected if omitted)
--start <date> / --end <date>Date range, ISO 8601
--preset <preset>30D, 6M, 12M (overrides --start/--end)
--granularity <g>daily or monthly
--group-by <dim>Repeatable: service, account_id, region, tag
--service <s>Repeatable filter
--region <r>Repeatable filter
--account <a>Repeatable filter
--environment <e>Repeatable filter
--tag-key <k> / --tag-value <v>Required when --group-by includes tag
--page / --page-sizePagination (max 100 per page)
--sort-by <field>cost, previous_cost, change_percentage, service, region, account_id
--sort-by-date <date>Sort by a specific date column (overrides --sort-by)
--sort-orderasc or desc
--formattable, csv, raw (default table)
--tuiOpen the interactive split-pane viewer
--page and --page-size apply to --format table. --format csv and --format raw return the whole filtered set in one response.

Examples

l4 costs breakdown
l4 costs breakdown --preset 30D
l4 costs breakdown --start 2026-01-01 --end 2026-01-31
l4 costs breakdown --group-by service --group-by region
l4 costs breakdown --service EC2 --service RDS
l4 costs breakdown --group-by tag --tag-key Environment --tag-value production
l4 costs breakdown --granularity monthly --preset 6M
l4 costs breakdown --sort-by-date 2026-01-15 --sort-order desc
l4 costs breakdown --format csv > costs.csv
Filter options cross-constrain each other, matching AWS Cost Explorer behavior: selecting a service narrows the regions and accounts you can subsequently filter on. l4 costs filters prints the current option list at any point.

daily

l4 costs daily [--start <date>] [--end <date>] [--provider <id>]

Without --start and --end, the range is the trailing 30 days.

l4 costs daily
l4 costs daily --start 2026-01-01 --end 2026-01-31
l4 costs daily --json | jq '.data.data_points[]'

monthly

l4 costs monthly [--provider <id>]

One row per month, covering all available history.

l4 costs monthly
l4 costs monthly --json | jq '.data.data_points[]'

filters

l4 costs filters [dimension] [--start <date>] [--end <date>] [--provider <id>]

The dimensions are services, regions, accounts, tag keys and tag values. Without an argument, filters prints every one. Pass a dimension name to print just that one.

l4 costs filters
l4 costs filters service
l4 costs filters region --start 2026-01-01 --end 2026-01-31
l4 costs filters --json | jq '.data.services[]'