Skip to main content

vulkro-sf costreport

Reports the cost drivers hiding in your metadata: the fields and objects that consume storage, the automation that consumes API calls, and the components that consume licenses or limits. Salesforce cost is rarely a single line item; it accrues across thousands of small decisions. costreport rolls those decisions up so a team can see where the platform spend actually goes and which components drive it.

Runs over the local project. No org connection is required.

Synopsis

vulkro-sf costreport [PATH] [flags]

PATH defaults to the current directory and should contain an SFDX project or a retrieved metadata folder.

Flags

FlagTypeDefaultDescription
--format <fmt>enumtableOutput format: table (human-readable ranked cost summary) or json (machine-readable cost records, for ingestion into a FinOps or platform-budget tool).
--top <n>integer0When set, limit the report to the highest n cost drivers in each category. 0 reports all.

Exit codes

  • 0 - the report was generated and no cost driver crossed a flagged threshold.
  • 1 - the report was generated and at least one cost driver crossed a flagged threshold.
  • 2 - error: bad arguments, no parseable metadata under PATH, IO failure, or internal error. The message names the cause and the next step.

What it does

costreport walks the metadata and groups cost drivers into categories:

  • Storage-heavy components - objects with large field counts, long text and rich-text fields, and history-tracking that multiplies row storage.
  • API-heavy automation - flows and Apex that issue callouts or high-volume DML, the components most likely to push API consumption.
  • License and limit consumers - components tied to a paid feature, a platform limit, or a per-user entitlement, surfaced so the team can weigh the value against the cost.

Each driver carries the component name, the category, and a relative cost weight so the report ranks them. The cost weights are heuristic indicators of relative magnitude, not a billing statement: use them to prioritize a cost review, not to predict an invoice.

Example

# Full cost report, ranked.
vulkro-sf costreport .

# Top 20 cost drivers per category, as JSON for a FinOps tool.
vulkro-sf costreport . --top 20 --format json > costreport.json