MCPcopy
hub / github.com/infracost/infracost

github.com/infracost/infracost @v0.10.45 sqlite

repository ↗ · DeepWiki ↗ · release v0.10.45 ↗
5,647 symbols 20,385 edges 1,182 files 1,220 documented · 22%
README

Infracost

Cloud cost intelligence for engineers, AI coding agents, and CI/CD.

Infracost shows cloud cost estimates and FinOps best practices for Terraform, Terragrunt, CloudFormation, and AWS CDK — before changes are deployed. See costs in your terminal, your editor, your AI coding agent, or right in pull requests.

Docs Docker pulls Community Slack channel tweet

The Infracost Dev toolkit

Infracost meets engineers wherever they work with infrastructure code — the terminal, their editor, their AI coding agent, and their CI pipeline. Every entry point talks to the same engine, the same pricing data, and the same FinOps policies, so a check you set up once shows up everywhere.

Get started

1. Install the CLI

macOS (Homebrew):

brew install infracost

Linux:

curl -fsSL https://raw.githubusercontent.com/infracost/cli/master/scripts/install.sh | sh

Windows (Chocolatey):

choco install infracost

Or download the latest release directly from GitHub Releases.

2. Run setup

infracost setup

The interactive setup walks you through authenticating, connecting your editor, configuring AI agent skills, and wiring up CI/CD. It's the fastest way to get every part of the Infracost toolkit working for your team.

Pick the entry points your team needs:

Infracost CLI

infracost/cli is the core of everything. Point it at a Terraform, Terragrunt, CloudFormation, or AWS CDK project to get a full cost breakdown and FinOps recommendations. The interactive setup wires up your editor, AI agent, and CI in one go.

Follow the quick start to install and authenticate, then:

infracost scan

Infracost scan in action

For a deeper dive into a specific scan — full resource-level breakdowns, cost drivers, and policy details — use the infracost inspect commands.

Infracost inspect in action

AI coding agents

infracost/agent-skills plugs Infracost into Claude Code, Cursor, and other AI coding agents so they reason about cloud costs and your FinOps policies as they generate infrastructure code. Three skills ship today:

  • iac-generation — keeps generated IaC compliant with your tagging, region, and budget policies
  • scan — analyzes an existing project for cost and policy violations
  • price-lookup — answers "how much is an m7i.xlarge in us-east-1?" with no existing code needed

Infracost running inside an AI coding agent

IDE extensions

See cost lenses, inline hints, hover breakdowns, and FinOps diagnostics as you edit .tf, .hcl, CloudFormation, and AWS CDK files.

Editor Repo
VS Code, Cursor, Windsurf infracost/vscode-infracost
JetBrains (IntelliJ, GoLand, PyCharm, WebStorm, Rider…) infracost/jetbrains-infracost
Neovim infracost/infracost.nvim
Zed infracost/zed-infracost

All of them are powered by the Infracost Language Server — a standard LSP server, so any editor that speaks LSP can integrate with Infracost.

Infracost in VS Code showing inline FinOps issues, cost details, and a resource panel

CI/CD

Post cost diffs and policy checks directly on pull requests as part of your existing workflow, use the CI/CD integrations to set this up.

Infracost cost diff comment on a pull request

Infracost Cloud

Infracost Cloud is the SaaS dashboard that ties everything together. Team leads, managers, and FinOps practitioners can define tagging policies and guardrails once, and have them enforced consistently across the CLI, the editor extensions, the agent skills, and CI — plus get visibility into how spending is shifting across every project and PR.

Infracost Cloud dashboard

Supported clouds and resources

Infracost supports over 1,100 resources across AWS, Azure, and Google Cloud, and can estimate usage-based resources such as S3 and Lambda.

About this repo

This repository is the front door to the Infracost project and the best place to follow it — star and watch to stay in the loop on releases across the whole ecosystem.

As part of the Infracost 2.0 release, the codebase has been refactored into the focused repositories linked above; some pieces may consolidate back here over time. Issues and discussions for the project as a whole still live here unless a repo-specific tracker is a better fit.

Community

Join our community Slack channel to learn more about cost estimation, Infracost, and to connect with other users and contributors.

If you run into any issues or have feedback, please open a thread in GitHub Discussions.

Thanks to everyone who has contributed — bug reports, code, feedback, and ideas all welcome.

License

Apache License 2.0

Extension points exported contracts — how you extend this code

PlatformHandler (Interface)
PlatformHandler is an interface that represents a platform specific handler. It is used to call the platform-specific AP [8 …
internal/comment/handler.go
CoreResource (Interface)
CoreResource is the new/preferred way to represent provider-agnostic resources that support advanced features such as In [258 …
internal/schema/core_resource.go
S3StorageClass (Interface)
(no doc) [6 implementers]
internal/resources/aws/s3_bucket.go
Vertex (Interface)
(no doc) [9 implementers]
internal/hcl/graph.go
SanitizedError (Interface)
SanitizedError allows errors to be wrapped with a sanitized message for sending upstream [2 implementers]
internal/clierror/error.go
Metric (Interface)
(no doc) [3 implementers]
internal/metrics/metrics.go
Config (Interface)
Config is an interface that fetches Logger configuration details for the Logger. This is used so that the logging packag [1 …
internal/logging/logger.go
WriteWarningFunc (FuncType)
WriteWarningFunc defines an interface that writes the provided msg as a warning to an underlying writer.
internal/ui/print.go

Core symbols most depended-on inside this repo

strPtr
called by 1440
internal/resources/azure/util.go
strPtr
called by 1284
internal/resources/aws/util.go
Get
called by 1264
internal/hcl/modules/loader.go
String
called by 595
internal/providers/terraform/hcl_provider.go
Errorf
called by 426
internal/hcl/parser_test.go
strPtr
called by 406
internal/resources/google/util.go
Debug
called by 401
internal/apiclient/log.go
CalcGoldenFileTestdataDirName
called by 352
internal/testutil/testutil.go

Shape

Function 2,507
Method 2,436
Struct 645
TypeAlias 26
Interface 17
FuncType 16

Languages

Go100%

Modules by API surface

cmd/infracost/breakdown_test.go112 symbols
internal/hcl/block.go78 symbols
internal/hcl/project_locator.go77 symbols
internal/providers/terraform/hcl_provider.go57 symbols
internal/output/output.go56 symbols
internal/providers/terraform/parser.go52 symbols
internal/hcl/parser_test.go51 symbols
internal/providers/terraform/terragrunt_hcl_provider.go49 symbols
internal/vcs/metadata.go47 symbols
internal/hcl/attribute.go43 symbols
internal/comment/bitbucket.go41 symbols
internal/schema/project.go40 symbols

Dependencies from manifests, versioned

cel.dev/exprv0.25.1 · 1×
cloud.google.com/gov0.116.0 · 1×
cloud.google.com/go/auth/oauth2adaptv0.2.6 · 1×
cloud.google.com/go/compute/metadatav0.9.0 · 1×
cloud.google.com/go/monitoringv1.21.2 · 1×
cloud.google.com/go/storagev1.49.0 · 1×
dario.cat/mergov1.0.1 · 1×
filippo.io/agev1.2.1 · 1×
github.com/Azure/azure-sdk-for-gov63.3.0+incompatible · 1×
github.com/Azure/go-autorestv14.2.0+incompatible · 1×

Datastores touched

(mysql)Database · 1 repos
frontDatabase · 1 repos

For agents

$ claude mcp add infracost \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact