# 使用 Homebrew, chocolatey, MacPorts, Nix, scoop, winget 安装 infracost

查看 infracost 的安装路径、可执行文件、元数据以及面向 AI 代理工作流的安全说明。

## 安装

```sh
sudo av install brew:infracost
```

其他安装命令:

### macOS

- Homebrew (100%):

```sh
brew install infracost
```

  证据: local Homebrew formula metadata

- MacPorts (94%):

```sh
sudo port install infracost
```

  证据: MacPorts ports tree: sysutils/infracost/Portfile from https://api.github.com/repos/macports/macports-ports/git/trees/master?recursive=1

### Linux

- Nix (92%):

```sh
nix profile install nixpkgs#infracost
```

  证据: nixpkgs package indexes: pkgs/by-name/in/infracost/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1

### Windows

- Chocolatey (92%):

```sh
choco install infracost
```

  证据: Chocolatey community package catalog: infracost from http://community.chocolatey.org/api/v2/Packages?$filter=IsLatestVersion&$select=Id&$top=1000&$skiptoken='9.151999','cports'

- Scoop (92%):

```sh
scoop install main/infracost
```

  证据: Scoop official bucket manifest trees: bucket/infracost.json from https://api.github.com/repos/ScoopInstaller/Main/git/trees/master?recursive=1

- winget (92%):

```sh
winget install --id Infracost.Infracost -e
```

  证据: Windows Package Manager source index: Infracost.Infracost from https://cdn.winget.microsoft.com/cache/source.msix

## 软件包事实

- **软件包键:** brew:infracost
- **软件包管理器:** Homebrew
- **版本:** 2.14.2
- **来源摘要:** Cost estimates for Terraform, Terragrunt, and CloudFormation
- **主页:** <https://www.infracost.io/docs/>
- **仓库:** <https://github.com/infracost/cli>
- **最后更新:** 2026-08-03T15:05:17Z
- **已生成:** 2026-08-03T19:37:03+00:00

## 可执行文件

- infracost (别名)

## 安装行为

- Bottle: 不可用

## 版本和新鲜度

- 页面生成时间: 2026-08-03
- 管理器版本: 2.14.2
## 项目历史与用法

Infracost is a cloud-cost estimation CLI for infrastructure as code, built to show engineers cost impact before infrastructure changes are deployed.

### 项目历史

Infracost's early public explanation framed the project as a response to cloud-pricing complexity and tools that surfaced cost too late in the delivery process. The August 2020 launch post described a CLI for bringing cost visibility into development and operations workflows, initially around AWS and Terraform.

The project expanded from a standalone open source CLI into a broader FinOps workflow around pull requests, CI/CD, editor integrations, and Infracost Cloud. Its README describes the CLI as the core engine for Terraform, Terragrunt, and CloudFormation cost analysis.

### 采用历史

Infracost adoption followed infrastructure-as-code review habits: developers run it locally, CI systems post cost changes to pull requests, and teams discuss cost before merging. In 2023, Infracost made its GitHub App integration free, emphasizing broad PR coverage and simpler setup across many repositories.

Package-manager availability matters because the tool is usually installed on developer laptops, CI runners, and automation images rather than deployed as a long-lived server.

### 使用方式

Users run the `infracost` CLI against IaC directories to estimate cost, compare diffs, or scan projects. The tool pairs naturally with Terraform and Terragrunt workflows, where cost feedback in a pull request can change a resource choice before it reaches production.

The CLI has authentication flows and SaaS integrations, but the package itself is best understood as a developer and CI executable. The input data is infrastructure code; the output is a cost breakdown, policy signal, or PR comment.

### 为什么软件包爱好者会关心

Infracost is significant in package-manager culture because it turns cloud billing into a local lint-like developer concern. Installing it with Homebrew puts a FinOps check beside formatters, linters, Terraform, and cloud CLIs.

It also marks a shift in infrastructure tooling from deployment-only commands to pre-merge economic analysis, a small executable sitting in the path between IaC authors and cloud invoices.

### 时间线

- 2020: Infracost was introduced publicly as a CLI for cloud cost estimates from infrastructure as code.
- 2020: Initial support focused on AWS and Terraform, with Google Cloud support added later that year.
- 2023: Infracost made its GitHub App integration free and tied the update to CLI v0.10.18.
- 2026: The GitHub release stream for the CLI included 2.x releases, reflecting continued packaging of the standalone executable.

### Related projects

- Related projects and surfaces include Terraform, Terragrunt, CloudFormation, Infracost Cloud, Infracost GitHub App, Infracost GitHub Actions, editor extensions, and cloud-pricing APIs.

### 来源

- <https://github.com/infracost/cli>
- <https://github.com/infracost/cli/releases>
- <https://www.infracost.io/docs>
- <https://www.infracost.io/resources/blog/infracost-cloud-costs-for-devs>
- <https://www.infracost.io/resources/blog/mar-2023-update>


## 安全说明

infrastructure mutation or orchestration signal.

- **Geiger 风险:** orange / 中
- infrastructure mutation or orchestration signal

## 其他软件包管理器记录

- Nix - infracost: normalized package name match | nixpkgs package indexes: pkgs/by-name/in/infracost/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1
- MacPorts - infracost: normalized package name match | MacPorts ports tree: sysutils/infracost/Portfile from https://api.github.com/repos/macports/macports-ports/git/trees/master?recursive=1
- Chocolatey - infracost: normalized package name match | Chocolatey community package catalog: infracost from http://community.chocolatey.org/api/v2/Packages?$filter=IsLatestVersion&$select=Id&$top=1000&$skiptoken='9.151999','cports'
- Scoop - main/infracost: normalized package name match | Scoop official bucket manifest trees: bucket/infracost.json from https://api.github.com/repos/ScoopInstaller/Main/git/trees/master?recursive=1
- winget - Infracost.Infracost: normalized package name match | Windows Package Manager source index: Infracost.Infracost from https://cdn.winget.microsoft.com/cache/source.msix


## Combined YAML source

View the package source record on GitHub. [combined/infracost.yml](https://github.com/mxcl/pkgdb/blob/main/combined/infracost.yml)


## 来源

- pkg.so package database
- Geiger risk classifier
- curated package history
- pkgdb category and tag curation
- external package-manager database matches
- cross-ecosystem install command graph
