CostPilot is an offline CLI that estimates infrastructure cost deltas from Terraform pull requests. It consumes terraform show -json output and evaluates cost-impacting changes locally to surface regressions before merge.
The design prioritizes determinism: no cloud APIs, no IAM, no runtime access, and advisory-by-default output so reviews focus only on changes that affect cost.
CostPilot is a local command-line interface (CLI) for deterministic cost governance in Terraform pull requests. It integrates directly into code review to surface infrastructure cost regressions before changes are merged, when decisions are still reversible.
Key Features
-
Pre-Merge Cost Analysis
Analyzes Terraform plan changes in pull requests and highlights cost-impacting deltas prior to deployment. -
Deterministic Risk Prediction
Uses static heuristics and embedded pricing data to estimate monthly cost changes with reproducible results. -
Clear Causal Explanations
Each estimate explains which resources contribute to the change and why. -
Configurable Safety Mechanisms
Can enforce policy or Service Level Objective (SLO) based blocking when explicitly configured. -
Advisory by Default
Non-material changes remain silent to avoid unnecessary review noise.
Operational Principles
-
Pull Request Focused
All analysis is scoped to pull requests, not post-deploy billing data. -
Reproducible Outputs
Same input plan produces the same output every time. -
Local Execution
Runs fully offline with no cloud credentials, IAM access, or external API calls. -
Explicit Governance
Blocking is opt-in and policy-driven; advisory output is the default.
Non-Features
CostPilot intentionally does not attempt to solve:
- Unexpected bills from existing infrastructure
- Historical billing analysis or dashboards
- Runtime optimization, autoscaling, or traffic modeling
- Tagging, chargeback, or attribution workflows
- Any workflow requiring live cloud access
Getting Started
CostPilot is distributed as a single native binary and accepts Terraform plan JSON as input.
Example scan:
costpilot scan plan.json
With policy enforcement:
costpilot scan plan.json --policy policy.yaml
Exit codes:
- 0 - no risk
- 1 - advisory
- 2 - blocking
For a deterministic walkthrough of typical cost regression scenarios, see the CostPilot Demo repository: https://github.com/Dee66/costpilotdemo
Live demo UI: https://dee66.github.io/costpilotdemo
CostPilot is designed to make infrastructure cost changes visible during code review, without relying on post-deploy billing analysis or cloud access.
No comments yet.
Sign in to be the first to comment.