Skip to main content

Cloud Cost Focus

@twonines/cloud-cost-focusv2026.08.04.1· 1mo agoMODELSREPORTS
01README

Read-only Azure cost governance — actual spend, tag allocation, forecast, and budget inspection via the Cost Management API, plus FOCUS cost export consumption for Azure blob storage and AWS S3, with findings reports.

02Release Notes

First release.

Read-only multi-cloud cost governance. Three model types: the Azure Cost Management API for server-aggregated spend, and FOCUS cost exports read in place from Azure Blob Storage and Amazon S3.

FOCUS fixes both column names and the vocabulary of several columns, so one aggregation serves both clouds and cross-cloud comparison is valid rather than merely possible. Parquet is read over HTTP range requests with column projection, so a multi-gigabyte export summarizes while transferring roughly a quarter of it and writing nothing to disk.

Known limitations are recorded in the adversarial review rather than smoothed over: ranged reads have no retry, and peak memory is set by the largest Parquet row group.

03Models3
@twonines/azure-cost-managementv2026.08.04.1azure/cost_management.ts

Global Arguments

ArgumentTypeDescription
subscriptionIdstringAzure subscription ID. Use: ${{ vault.get('azure', 'SUBSCRIPTION_ID') }}
armEndpoint?stringOverride the ARM endpoint. Omit to auto-detect via `az cloud show`
fn actualCost(groupBy: string, from?: string, to?: string, filterDimension?: string, filterValues?: string, groupByTag?: string)
Query actual invoiced spend for a timeframe, grouped by a dimension
ArgumentTypeDescription
groupBystringDimension to group by (ServiceName, ResourceGroup, MeterCategory, …)
from?stringCustom range start (YYYY-MM-DD)
to?stringCustom range end (YYYY-MM-DD)
filterDimension?stringOptional dimension to filter on, e.g. ServiceName. Pair with filterValues
filterValues?stringComma-separated values to keep, e.g. "Foundry Models,Foundry Tools"
groupByTag?stringOptional second grouping on a tag key, e.g. project — cross-tabulates
fn costByTag(tagKey: string, from?: string, to?: string)
Allocate spend across the values of one tag key and quantify
ArgumentTypeDescription
tagKeystringTag key to allocate by (e.g. owner, project, stage)
from?stringCustom range start (YYYY-MM-DD)
to?stringCustom range end (YYYY-MM-DD)
fn forecast(includeFreshPartialCost: boolean, from?: string, to?: string)
Project spend forward using the Cost Management forecast endpoint.
ArgumentTypeDescription
includeFreshPartialCostbooleanInclude not-yet-finalized partial cost in the projection
from?stringWindow start (YYYY-MM-DD). Defaults to the first of this month
to?stringWindow end (YYYY-MM-DD). Defaults to the last day of this month
fn budgets()
List Consumption budgets for the subscription and current burn

Resources

actualCost(infinite)— Actual invoiced spend, grouped by a chosen dimension
tagAllocation(infinite)— Spend split by tag value, including untagged spend
forecast(infinite)— Forward-looking cost projection
budgets(infinite)— Consumption budgets and burn against them
@twonines/azure-focus-costv2026.08.04.1azure/focus_cost.ts

Global Arguments

ArgumentTypeDescription
subscriptionIdstringAzure subscription ID owning the export.
scope?stringOverride the Cost Management scope path, e.g.
armEndpoint?stringOverride the ARM endpoint. Omit to auto-detect via `az cloud show`
fn inspectExport(exportName: string, apiVersion: string)
Read a FOCUS cost export's definition and run history, and store a
ArgumentTypeDescription
exportNamestringExport name as shown by `az rest` on the exports collection,
apiVersionstringCost Management exports API version. The preview version is
fn probeParquet(filePath: string, provider: string)
Inspect one export Parquet file on the local filesystem: column
ArgumentTypeDescription
filePathstringPath to a Parquet file, e.g. a blob downloaded with
providerstringWhich provider's vendor-column expectations to check against
fn summarize(path: string, costColumn: string, tagKey: string, extraAiPatterns?: string, groupColumn: string, groupLabel: string, foldCase: stringbool, provider: string)
Aggregate FOCUS export rows into a total plus breakdowns by service,
ArgumentTypeDescription
pathstringParquet file, or a directory containing a run's `.parquet` files
costColumnstringFOCUS cost column to sum. EffectiveCost is amortized spend;
tagKeystringTag key to allocate cost by, e.g. project or owner
extraAiPatterns?stringExtra comma-separated regexes identifying AI services among rows the
groupColumnstringSecondary grouping column. Azure: x_ResourceGroupName. AWS has no
groupLabelstringDisplay label for groupColumn
foldCasestringboolTreat differently-cased values of groupColumn as one group. True
providerstringCloud that produced the rows, for cross-provider rendering
fn summarizeBlob(exportName: string, apiVersion: string, storageAccount?: string, container?: string, prefix?: string, period?: string, costColumn: string, tagKey: string, groupColumn: string, groupLabel: string, foldCase: stringbool, extraAiPatterns?: string, whereColumn?: string, whereValue?: string)
Summarize a FOCUS export run for one period, reading Parquet directly
ArgumentTypeDescription
exportNamestringExport name. Its destination and current dataVersion come out of
apiVersionstringCost Management exports API version
storageAccount?stringOverride the destination account. Omit to take it from the export
container?stringOverride the destination container. Omit to take it from the export
prefix?stringOverride the blob prefix entirely. Omit to derive
period?stringBilling period directory, e.g. 20260701-20260731. Omit to take the
costColumnstringFOCUS cost column to sum
tagKeystringTag key to allocate cost by, e.g. project or owner
groupColumnstringSecondary grouping column
groupLabelstringDisplay label for groupColumn
foldCasestringboolTreat differently-cased values of groupColumn as one group
extraAiPatterns?stringExtra comma-separated regexes identifying AI services among rows the
whereColumn?stringRestrict to rows where this column equals whereValue, e.g.
whereValue?stringValue whereColumn must equal, e.g. 'AI and Machine Learning'
fn probeManifest(manifestPath: string, dataDir?: string)
Parse an export run's manifest.json and reconcile it against the
ArgumentTypeDescription
manifestPathstringPath to a downloaded manifest.json from an export run directory
dataDir?stringDirectory holding the run's data files, named exactly as the

Resources

exportConfig(infinite)— FOCUS export definition, delivery destination, and run health
parquetProbe(infinite)— Column inventory, row-group layout, and row sample from one export
exportRun(infinite)— One export run's manifest, with ingest reconciliation against the
costSummary(infinite)— Total cost plus breakdowns by service, resource group, day, and tag
@twonines/aws-focus-costv2026.08.04.1aws/focus_s3.ts

Global Arguments

ArgumentTypeDescription
bucketstringS3 bucket holding the export, e.g. my-org-data-exports
exportPrefixstringKey prefix above the data/ and metadata/ directories, e.g.
profile?stringNamed AWS CLI profile to read with. Set this rather than relying on
fn summarizeS3(billingPeriod: string, costColumn: string, tagKey: string, groupColumn: string, groupLabel: string, extraAiPatterns?: string, whereColumn?: string, whereValue?: string)
Summarize an AWS FOCUS export for one billing period, reading Parquet
ArgumentTypeDescription
billingPeriodstringBilling period partition, e.g. 2026-07
costColumnstringFOCUS cost column to sum. EffectiveCost is amortized spend;
tagKeystringTag key to allocate cost by. AWS keys are prefixed, e.g.
groupColumnstringSecondary grouping column. AWS has no resource group; linked
groupLabelstringDisplay label for groupColumn
extraAiPatterns?stringExtra comma-separated regexes identifying AI services among rows the
whereColumn?stringRestrict to rows where this column equals whereValue, e.g.
whereValue?stringValue whereColumn must equal, e.g. Other

Resources

costSummary(infinite)— Total cost plus breakdowns by service, service category, linked
04Reports2
@twonines/azure-cost-reportmethod
azure_cost_report.ts

Formats Azure cost data into a governance briefing with tagging,

costfinopsgovernanceazure
@twonines/focus-reportmethod
azure_focus_report.ts

Formats Azure FOCUS cost export data into a governance briefing with

costfinopsgovernanceazurefocus
05Stats
B
85 / 100
Downloads
6
Archive size
331.0 KB
  • Has README or module doc2/2earned
  • README has a code example1/1earned
  • README is substantive1/1earned
  • Most symbols documented1/1earned
  • No slow types (deprecated)1/1earned
  • Dependencies pass trust audit2/2earned
  • Has description1/1earned
  • Platform support declared (or universal)2/2earned
  • License declared1/1earned
  • Verified public repository0/2missing
06Platforms