ReviewOS

stacks/ts-cloud

Implement `cost` command — current MTD spend + naive linear projection

#108
Closed glennmichael123 opened this 2 months ago ·
2 months ago

Implementation issue split out from #107.

Replace the mock-data body in packages/ts-cloud/bin/commands/cost.ts (cost command) with real implementation:

  • Query Cost Explorer for current month-to-date spend (use CostExplorerClient.getCostByService with start = first of current month, end = today + 1 day).
  • Compute naive linear projection: total / days_elapsed * days_in_month.
  • Optionally compare to last month for the Change column.

Acceptance

  • cloud cost returns real numbers from the connected AWS account.
  • --profile flag honored (same plumbing as cost:analyze).
  • Caches via the same Cost Explorer cache (#106).
  • Replaces the cli.warn('not implemented') guard introduced by #107.
  • #107 — tactical guard
  • #104 — original cost CLI scope
8 days ago

Roadmap relationship: tracked by #135 under master roadmap #132.

8 days ago

Implemented on main in b24dc74 and beb8162. cloud cost now queries real month-to-date Cost Explorer service spend, honors --profile and --no-cache, projects MTD / elapsed days × days in month, and compares the projection with the previous full month. Covered by Cost Explorer aggregation/cache and deterministic date/projection tests; documented in docs/features/cost.md. Strict Pickier checks and the production declaration/UI build pass.

Sign in to comment on this issue.