Skip to content

Commit 891043f

Browse files
committed
docs: update the readm
1 parent b33c873 commit 891043f

File tree

1 file changed

+68
-1
lines changed

1 file changed

+68
-1
lines changed

README.md

Lines changed: 68 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,68 @@
1-
# cli
1+
# cli
2+
3+
> :construction: **Work in progress**
4+
>
5+
> This repository is under active development. Things may change quickly, break, or disappear entirely.
6+
7+
## Prerequisites
8+
9+
### GitHub Access
10+
11+
Plugins are hosted as GitHub release assets on this (currently private) repository. The CLI needs a GitHub token to
12+
download them. It checks for a token in the following order:
13+
14+
1. `GH_TOKEN` environment variable
15+
2. `GITHUB_TOKEN` environment variable
16+
3. `gh auth token` (if the [GitHub CLI](https://cli.github.com/) is installed and authenticated)
17+
18+
### Plugins
19+
20+
Plugins are downloaded automatically from the manifest when you run the CLI. No manual setup is required beyond having
21+
GitHub access configured above.
22+
23+
#### Version Pinning
24+
25+
By default, the CLI downloads the latest version of each plugin. You can pin to a specific version using environment
26+
variables:
27+
28+
- `INFRACOST_CLI_PARSER_PLUGIN_VERSION` — pin the parser plugin version
29+
- `INFRACOST_CLI_PROVIDER_PLUGIN_AWS_VERSION` — pin the AWS provider plugin version
30+
- `INFRACOST_CLI_PROVIDER_PLUGIN_AZURE_VERSION` — pin the Azure provider plugin version
31+
- `INFRACOST_CLI_PROVIDER_PLUGIN_GOOGLE_VERSION` — pin the Google provider plugin version
32+
33+
#### Auto-Update
34+
35+
Set `INFRACOST_CLI_PLUGIN_AUTO_UPDATE=false` to disable automatic updates. When disabled, the CLI uses the latest cached
36+
version if one exists, and only downloads from the manifest if no cached version is found.
37+
38+
#### Local Plugin Overrides
39+
40+
If you are developing plugins locally, you can bypass the download mechanism entirely by pointing the CLI at your local
41+
builds:
42+
43+
```bash
44+
# Parser
45+
export INFRACOST_CLI_PARSER_PLUGIN=/path/to/bin/infracost-parser-plugin
46+
47+
# Providers
48+
export INFRACOST_CLI_PROVIDER_PLUGIN_AWS=/path/to/bin/infracost-provider-plugin-aws
49+
export INFRACOST_CLI_PROVIDER_PLUGIN_GOOGLE=/path/to/bin/infracost-provider-plugin-google
50+
export INFRACOST_CLI_PROVIDER_PLUGIN_AZURERM=/path/to/bin/infracost-provider-plugin-azurerm
51+
```
52+
53+
When a plugin path override is set, the CLI uses that binary directly and skips downloading for that plugin.
54+
55+
## Running the CLI
56+
57+
1. `make build`
58+
2. `./bin/infracost help`
59+
60+
### Scan
61+
62+
```bash
63+
./bin/infracost scan /path/to/directory
64+
```
65+
66+
The target must be a directory. If no argument is given, it defaults to the current working directory. The CLI will
67+
auto-detect the IaC type from the directory contents, or you can configure projects explicitly via an `infracost.yml`
68+
config file.

0 commit comments

Comments
 (0)