Skip to main content

Get started

Infracost shifts cloud costs leftβ€”into your engineering workflow. Get cost estimates for Terraform, CloudFormation, and AWS CDK before deployment, catch FinOps issues aligned with Well-Architected Frameworks, and auto-fix problems with a single merge. Supports AWS, Azure, and Google Cloud.

If you run into any issues, join our community Slack and we'll help you quickly πŸ˜„


1. Install the CLI​

Get the latest Infracost CLI release:

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

infracost --version # Should show 2.0.0

2. Get API key​

This is the fastest way to get the full Infracost experience. It walks you through getting a free API key, installing the right IDE extension, registering AI agent skills, and wiring up CI/CD β€” all from one command.

infracost setup
note
  • No cloud credentials or secrets are sent to the API.
  • Infracost does not make any changes to your IaC state or cloud resources.

3. See your first cost estimate​

Infracost parses the project locally to determine resource types and quantities needed to calculate costs.

# You can also: git clone https://github.com/infracost/example-iac
cd my-terraform-project

Open any Terraform, CloudFormation, or CDK project (or clone our example) and try one of the following:

AI Agent​

Give your AI coding agent real-time access to cloud pricing and your organization's FinOps policies. Instead of generating infrastructure that needs a separate review cycle, an agent equipped with Infracost skills can scan existing IaC for cost and tagging violations, optimize resources to fit a budget, and generate compliant infrastructure on the first attempt.

Installing the Infracost Agent Skills for Claude​

Ensure you have the Claude Code CLI installed. Then from your terminal, run the following two commands to add the Infracost marketplace and install the plugin:

claude plugin marketplace add infracost/agent-skills
claude plugin install infracost@infracost

Then quit and restart Claude Code for the changes to take effect.

On your next IaC task, the skill will prompt you to install any required dependencies (including the Infracost CLI) and authenticate with your Infracost account if needed. Your API key is configured automatically during that flow.

Once installed, skills are available as /infracost:<skill> slash commands, and are also invoked automatically when you ask relevant questions about your infrastructure.

Using the skill​

Use natural prompts to get cost estimates:

Give me a full cost breakdown of this project and highlight the most expensive resources.

After you've set up your tagging policy, you can ask the agent to fix violations:

Scan this project and fix all tagging violations.

You can also generate new IaC that is automatically compliant with any selected FinOps policies (e.g. preferred regions and instance types), tagging policies, and budget constraints:

Create a 3-tier web app on AWS using ECS and Postgres that costs less than $400/month and is compliant with all of my organization's FinOps policies.

See the AI Agent Skills page for the full list of available skills and detailed usage examples.

IDE​

See inline cloud cost estimates, FinOps policy violations, and tagging issues directly in your editor as you write Terraform or CloudFormation β€” before anything reaches a pull request.

Once installed, log in to Infracost from the extension sidebar. The language server will start scanning your workspace, and cost estimates will appear as code lenses above each resource block. Click any code lens to see the full cost breakdown, policy violations, and tagging issues for that resource.

Inline code lens cost estimates in VS Code

See the IDE Extensions page for login instructions, editor commands, and more details.

CLI​

Run a scan from the project root:

infracost scan

You'll get a full cost breakdown of every resource, flagged FinOps policy violations, and tagging issues β€” right in your terminal.

Infracost scan command output

CI/CD​

Add Infracost to your pull requests to give your team a safety net β€” every PR gets an automatic comment showing the cost diff, FinOps policy violations, and tagging issues introduced by the change, so cost impact gets discussed alongside the code review. It only takes 15 minutes! See our demo video to learn more.

Infracost pull request comment

Manual setup (fallback)​

If you'd rather configure things yourself, or infracost setup doesn't cover your editor or agent, you can install each piece manually below.

AI Agent Skills​

Choose your AI agent to see installation instructions:

Ensure you have the Claude Code CLI installed. Then from your terminal, run the following two commands to add the Infracost marketplace and install the plugin:

claude plugin marketplace add infracost/agent-skills
claude plugin install infracost@infracost

Then quit and restart Claude Code for the changes to take effect.

On your next IaC task, the skill will prompt you to install any required dependencies (including the Infracost CLI) and authenticate with your Infracost account if needed. Your API key is configured automatically during that flow.

Once installed, skills are available as /infracost:<skill> slash commands, and are also invoked automatically when you ask relevant questions about your infrastructure.

IDE Extensions​

Choose your editor to see installation instructions:

Requires VS Code v1.75.0 or above.

Open VS Code and go to the Extensions view (Ctrl+Shift+X / Cmd+Shift+X). Search for Infracost, select the extension published by Infracost, and click Install.

Alternatively, use the Quick Open command:

ext install Infracost.infracost

The extension is also listed in the Visual Studio Marketplace and on Open VSX.

Installing a pre-release version​

Pre-release builds are published as .vsix files on the vscode-infracost releases page. Download the build for your platform, then install it either from the command line:

code --install-extension infracost-<version>-<platform>.vsix

…or from inside VS Code: open the Command Palette (Cmd+Shift+P / Ctrl+Shift+P), run Extensions: Install from VSIX…, and select the downloaded file.

CI/CD​

See our CI/CD integration guides for step-by-step instructions for GitHub Actions, GitLab CI, Azure DevOps, and more.