cloudburn 0.8.3 → 0.8.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +74 -56
  2. package/dist/cli.js +19 -4
  3. package/package.json +14 -2
package/README.md CHANGED
@@ -1,33 +1,95 @@
1
1
  # cloudburn
2
2
 
3
- Command-line interface for Cloudburn cloud cost optimization.
3
+ CloudBurn CLI for catching cost issues before you deploy with `scan`, then running the same policies against live AWS with `discover`.
4
+
5
+ `scan` checks Terraform and CloudFormation. `discover` uses AWS Resource Explorer as a live service catalog so CloudBurn can find deployed resources and run rules against them.
4
6
 
5
7
  ## Installation
6
8
 
7
- ```sh
8
- npm install -g cloudburn
9
+ CloudBurn requires Node.js 24+.
10
+
11
+ ```bash
12
+ npm install --global cloudburn
13
+ ```
14
+
15
+ If you want to keep it local to a project:
16
+
17
+ ```bash
18
+ npm install cloudburn
19
+ npx cloudburn scan ./main.tf
20
+ ```
21
+
22
+ ## Getting Started
23
+
24
+ ### Config
25
+
26
+ Config is optional. By default, CloudBurn runs all checks for the mode you use.
27
+
28
+ Create a starter config with:
29
+
30
+ ```bash
31
+ cloudburn init config
32
+ ```
33
+
34
+ If you want to inspect the generated YAML first:
35
+
36
+ ```bash
37
+ cloudburn init config --print
38
+ ```
39
+
40
+ `cloudburn init` still prints the starter YAML directly if you want a quick redirect-friendly version.
41
+
42
+ ### Scan
43
+
44
+ Use `scan` to check Terraform and CloudFormation before you deploy.
45
+
46
+ ```bash
47
+ cloudburn scan ./main.tf
48
+ cloudburn scan ./template.yaml
49
+ cloudburn scan ./iac --exit-code
50
+ cloudburn --format json scan ./iac
9
51
  ```
10
52
 
11
- ## Shell completion
53
+ ### Discover
54
+
55
+ Use `discover` to run the same rules against live AWS resources.
56
+
57
+ Run `cloudburn discover init` first. It automatically configures AWS Resource Explorer indexes, which CloudBurn uses as its live service catalog before it evaluates rules.
58
+
59
+ By default, `cloudburn discover` runs against your active AWS region. You can pass `--region <region>` to target another region, or use `--region all` to run against all indexed regions through the AWS Resource Explorer aggregator.
60
+
61
+ ```bash
62
+ cloudburn discover init
63
+ cloudburn discover
64
+ cloudburn discover --region eu-central-1
65
+ cloudburn discover --region all
66
+ cloudburn discover --config .cloudburn.yml --enabled-rules CLDBRN-AWS-EBS-1
67
+ cloudburn discover list-enabled-regions --format text
68
+ cloudburn rules list
69
+ ```
70
+
71
+ `cloudburn discover --region all` needs an AWS Resource Explorer aggregator and an unfiltered default view in the aggregator region.
72
+
73
+ ## Shell Completion
12
74
 
13
75
  Inspect the available completion subcommands:
14
76
 
15
- ```sh
77
+ ```bash
16
78
  cloudburn completion
17
79
  cloudburn completion zsh --help
18
80
  ```
19
81
 
20
82
  Generate a completion script for your shell and source it directly:
21
83
 
22
- ```sh
84
+ ```bash
23
85
  source <(cloudburn completion zsh)
24
86
  source <(cloudburn completion bash)
25
87
  cloudburn completion fish | source
26
88
  ```
27
89
 
28
- To enable completion persistently, add one of the following lines to your shell config:
90
+ To enable completion persistently, add one of these lines to your shell config:
29
91
 
30
- ```sh
92
+ ```bash
31
93
  # ~/.zshrc
32
94
  source <(cloudburn completion zsh)
33
95
 
@@ -38,55 +100,11 @@ source <(cloudburn completion bash)
38
100
  cloudburn completion fish | source
39
101
  ```
40
102
 
41
- ## Usage
42
-
43
- ```sh
44
- cloudburn
45
- ```
46
-
47
- Static scans auto-detect Terraform and CloudFormation from the file or
48
- directory path you pass to `cloudburn scan`.
49
-
50
- ```sh
51
- cloudburn scan ./main.tf
52
- cloudburn scan ./template.yaml
53
- cloudburn scan ./iac
54
- cloudburn discover
55
- cloudburn discover --region all
56
- cloudburn rules
57
- cloudburn completion
58
- cloudburn completion zsh
59
- ```
103
+ ## Docs
60
104
 
61
- `cloudburn scan --format json` emits the lean canonical grouped result:
62
-
63
- ```json
64
- {
65
- "providers": [
66
- {
67
- "provider": "aws",
68
- "rules": [
69
- {
70
- "ruleId": "CLDBRN-AWS-EBS-1",
71
- "service": "ebs",
72
- "source": "iac",
73
- "message": "EBS volumes should use current-generation storage.",
74
- "findings": [
75
- {
76
- "resourceId": "aws_ebs_volume.gp2_data",
77
- "location": {
78
- "path": "main.tf",
79
- "line": 4,
80
- "column": 3
81
- }
82
- }
83
- ]
84
- }
85
- ]
86
- }
87
- ]
88
- }
89
- ```
105
+ - Full docs: [cloudburn.io/docs](https://cloudburn.io/docs)
106
+ - Rule reference: [docs/reference/rule-ids.md](https://github.com/towardsthecloud/cloudburn/blob/main/docs/reference/rule-ids.md)
107
+ - Config reference: [docs/reference/config-schema.md](https://github.com/towardsthecloud/cloudburn/blob/main/docs/reference/config-schema.md)
90
108
 
91
109
  ## License
92
110
 
package/dist/cli.js CHANGED
@@ -1,7 +1,9 @@
1
1
  #!/usr/bin/env node
2
2
 
3
3
  // src/cli.ts
4
- import { pathToFileURL } from "url";
4
+ import { realpathSync } from "fs";
5
+ import { resolve as resolve2 } from "path";
6
+ import { fileURLToPath } from "url";
5
7
 
6
8
  // src/completion/engine.ts
7
9
  var buildCompletionTree = (command) => {
@@ -1346,9 +1348,22 @@ var registerScanCommand = (program) => {
1346
1348
  };
1347
1349
 
1348
1350
  // src/cli.ts
1351
+ var resolveEntrypointPath = (entrypointPath) => {
1352
+ try {
1353
+ return realpathSync.native(entrypointPath);
1354
+ } catch {
1355
+ return resolve2(entrypointPath);
1356
+ }
1357
+ };
1358
+ var isCliEntrypoint = (moduleUrl, argvEntry = process.argv[1]) => {
1359
+ if (argvEntry === void 0) {
1360
+ return false;
1361
+ }
1362
+ return resolveEntrypointPath(fileURLToPath(moduleUrl)) === resolveEntrypointPath(argvEntry);
1363
+ };
1349
1364
  var createProgram = () => {
1350
1365
  const program = createCliCommand();
1351
- program.name("cloudburn").usage("[command]").description("Know what you spend. Fix what you waste.").version("0.8.3").option("--format <format>", OUTPUT_FORMAT_OPTION_DESCRIPTION, parseOutputFormat);
1366
+ program.name("cloudburn").usage("[command]").description("Know what you spend. Fix what you waste.").version("0.8.5").option("--format <format>", OUTPUT_FORMAT_OPTION_DESCRIPTION, parseOutputFormat);
1352
1367
  configureCliHelp(program);
1353
1368
  registerCompletionCommand(program);
1354
1369
  registerDiscoverCommand(program);
@@ -1361,11 +1376,11 @@ var createProgram = () => {
1361
1376
  var runCli = async () => {
1362
1377
  await createProgram().parseAsync(process.argv);
1363
1378
  };
1364
- var isMain = process.argv[1] ? import.meta.url === pathToFileURL(process.argv[1]).href : false;
1365
- if (isMain) {
1379
+ if (isCliEntrypoint(import.meta.url)) {
1366
1380
  await runCli();
1367
1381
  }
1368
1382
  export {
1369
1383
  createProgram,
1384
+ isCliEntrypoint,
1370
1385
  runCli
1371
1386
  };
package/package.json CHANGED
@@ -1,7 +1,16 @@
1
1
  {
2
2
  "name": "cloudburn",
3
- "version": "0.8.3",
3
+ "version": "0.8.5",
4
4
  "description": "Cloudburn CLI for cloud cost optimization",
5
+ "homepage": "https://cloudburn.io/docs",
6
+ "bugs": {
7
+ "url": "https://github.com/towardsthecloud/cloudburn/issues"
8
+ },
9
+ "repository": {
10
+ "type": "git",
11
+ "url": "git+https://github.com/towardsthecloud/cloudburn.git",
12
+ "directory": "packages/cloudburn"
13
+ },
5
14
  "type": "module",
6
15
  "bin": {
7
16
  "cloudburn": "./dist/cli.js"
@@ -11,7 +20,7 @@
11
20
  ],
12
21
  "dependencies": {
13
22
  "commander": "^13.1.0",
14
- "@cloudburn/sdk": "0.13.2"
23
+ "@cloudburn/sdk": "0.13.3"
15
24
  },
16
25
  "devDependencies": {
17
26
  "@biomejs/biome": "^2.4.6",
@@ -35,6 +44,9 @@
35
44
  "cli"
36
45
  ],
37
46
  "license": "Apache-2.0",
47
+ "engines": {
48
+ "node": ">=24.0.0"
49
+ },
38
50
  "scripts": {
39
51
  "build": "tsup",
40
52
  "typecheck": "tsc --noEmit",