infra-cost 0.2.4 โ 0.3.1
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.
- package/README.md +430 -197
- package/dist/demo/test-enhanced-ui.js +5 -9
- package/dist/demo/test-multi-cloud-dashboard.js +42 -53
- package/dist/index.js +24914 -7655
- package/package.json +90 -98
package/README.md
CHANGED
|
@@ -1,15 +1,66 @@
|
|
|
1
|
-
# infra-cost
|
|
1
|
+
# ๐ฐ infra-cost
|
|
2
2
|
|
|
3
|
-
>
|
|
3
|
+
<div align="center">
|
|
4
|
+
|
|
5
|
+
**Multi-cloud FinOps CLI tool for comprehensive cost analysis and infrastructure optimization**
|
|
6
|
+
|
|
7
|
+
[](https://badge.fury.io/js/infra-cost)
|
|
8
|
+
[](https://npmjs.org/package/infra-cost)
|
|
9
|
+
[](https://opensource.org/licenses/MIT)
|
|
10
|
+
[](https://github.com/codecollab-co/infra-cost/issues)
|
|
11
|
+
[](https://github.com/codecollab-co/infra-cost/stargazers)
|
|
12
|
+
|
|
13
|
+
*Take control of your cloud costs across AWS, Google Cloud, Azure, Alibaba Cloud, and Oracle Cloud* ๐
|
|
14
|
+
|
|
15
|
+
[Installation](#-installation) โข [Quick Start](#-quick-start) โข [Features](#-features) โข [Documentation](#-documentation) โข [Contributing](#-contributing)
|
|
16
|
+
|
|
17
|
+
</div>
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## ๐ฏ Why infra-cost?
|
|
22
|
+
|
|
23
|
+
**Save money. Optimize resources. Make informed decisions.**
|
|
24
|
+
|
|
25
|
+
- ๐ธ **Reduce cloud spend** by up to 30% with actionable insights
|
|
26
|
+
- ๐ **Multi-cloud visibility** - see costs across all your providers in one place
|
|
27
|
+
- โก **Real-time analysis** - get instant cost breakdowns and trends
|
|
28
|
+
- ๐ค **AI-powered recommendations** for optimization opportunities
|
|
29
|
+
- ๐ **Executive reports** - beautiful PDF reports for stakeholders
|
|
30
|
+
- ๐ **Smart alerting** - proactive cost anomaly detection
|
|
31
|
+
- ๐ฌ **Team collaboration** - Slack integration for cost awareness
|
|
4
32
|
|
|
5
33
|
## ๐ Features
|
|
6
34
|
|
|
7
|
-
|
|
8
|
-
- **
|
|
9
|
-
- **
|
|
10
|
-
- **
|
|
11
|
-
- **
|
|
12
|
-
- **
|
|
35
|
+
### ๐ **Multi-Cloud Support**
|
|
36
|
+
- **AWS** โ
(Full support with Cost Explorer integration)
|
|
37
|
+
- **Google Cloud** ๐ง (Architecture ready, coming soon)
|
|
38
|
+
- **Microsoft Azure** ๐ง (Architecture ready, coming soon)
|
|
39
|
+
- **Alibaba Cloud** ๐ง (Architecture ready, coming soon)
|
|
40
|
+
- **Oracle Cloud** ๐ง (Architecture ready, coming soon)
|
|
41
|
+
|
|
42
|
+
### ๐ **Comprehensive Analytics**
|
|
43
|
+
- **Cost Forecasting** - AI-powered predictions for future spending
|
|
44
|
+
- **Budget Monitoring** - Track against budgets with smart alerts
|
|
45
|
+
- **Resource Rightsizing** - ML recommendations for optimal instance sizes
|
|
46
|
+
- **Sustainability Analysis** - Carbon footprint tracking and green recommendations
|
|
47
|
+
- **Security Cost Analysis** - Security posture vs. cost optimization
|
|
48
|
+
- **Anomaly Detection** - AI-powered cost spike identification
|
|
49
|
+
|
|
50
|
+
### ๐๏ธ **Advanced Features**
|
|
51
|
+
- **Interactive Dashboards** - Rich terminal UI with real-time data
|
|
52
|
+
- **PDF Report Generation** - Executive summaries and technical deep-dives
|
|
53
|
+
- **Cross-Cloud Optimization** - Find the best provider for each workload
|
|
54
|
+
- **Automated Optimization** - Execute cost-saving actions automatically
|
|
55
|
+
- **Audit Logging** - Comprehensive compliance tracking
|
|
56
|
+
- **Enterprise Multi-tenancy** - Team and organization management
|
|
57
|
+
|
|
58
|
+
### ๐ง **Developer Experience**
|
|
59
|
+
- **Multiple output formats**: Fancy tables, plain text, JSON, CSV, Excel
|
|
60
|
+
- **Flexible authentication**: Environment variables, IAM roles, profiles
|
|
61
|
+
- **CI/CD Integration**: GitHub Actions, Jenkins, GitLab CI
|
|
62
|
+
- **API Server**: REST endpoints for custom integrations
|
|
63
|
+
- **Webhook Support**: Real-time notifications and integrations
|
|
13
64
|
|
|
14
65
|
## ๐ฆ Installation
|
|
15
66
|
|
|
@@ -18,9 +69,10 @@
|
|
|
18
69
|
npm install -g infra-cost
|
|
19
70
|
```
|
|
20
71
|
|
|
21
|
-
### Homebrew
|
|
72
|
+
### Homebrew (macOS/Linux)
|
|
22
73
|
```bash
|
|
23
|
-
brew
|
|
74
|
+
brew tap codecollab-co/tap
|
|
75
|
+
brew install infra-cost
|
|
24
76
|
```
|
|
25
77
|
|
|
26
78
|
### npx (No installation required)
|
|
@@ -28,87 +80,60 @@ brew install codecollab-co/tap/infra-cost
|
|
|
28
80
|
npx infra-cost
|
|
29
81
|
```
|
|
30
82
|
|
|
83
|
+
### Docker
|
|
84
|
+
```bash
|
|
85
|
+
docker run --rm codecollab-co/infra-cost --help
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
### GitHub Action
|
|
89
|
+
```yaml
|
|
90
|
+
- uses: codecollab-co/infra-cost@v0.3.0
|
|
91
|
+
with:
|
|
92
|
+
provider: aws
|
|
93
|
+
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
|
94
|
+
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
|
95
|
+
```
|
|
96
|
+
|
|
31
97
|
## ๐ฏ Quick Start
|
|
32
98
|
|
|
33
|
-
### AWS
|
|
99
|
+
### 1. Basic AWS Cost Analysis
|
|
34
100
|
```bash
|
|
35
101
|
# Using default AWS credentials
|
|
36
102
|
infra-cost
|
|
37
103
|
|
|
38
|
-
#
|
|
39
|
-
infra-cost --
|
|
104
|
+
# Get a 6-month cost trend with forecasting
|
|
105
|
+
infra-cost --trend --forecast 30
|
|
106
|
+
|
|
107
|
+
# Interactive multi-cloud dashboard
|
|
108
|
+
infra-cost --multi-cloud-dashboard
|
|
40
109
|
```
|
|
41
110
|
|
|
42
|
-
###
|
|
111
|
+
### 2. Advanced Analysis
|
|
43
112
|
```bash
|
|
44
|
-
#
|
|
45
|
-
infra-cost --
|
|
113
|
+
# Generate executive PDF report
|
|
114
|
+
infra-cost --executive-summary --pdf-report quarterly-report.pdf
|
|
46
115
|
|
|
47
|
-
#
|
|
48
|
-
infra-cost --
|
|
49
|
-
|
|
50
|
-
# Alibaba Cloud
|
|
51
|
-
infra-cost --provider alicloud --access-key key --secret-key secret --region cn-hangzhou
|
|
116
|
+
# AI-powered anomaly detection
|
|
117
|
+
infra-cost --anomaly-detect --anomaly-realtime
|
|
52
118
|
|
|
53
|
-
#
|
|
54
|
-
infra-cost --
|
|
119
|
+
# Comprehensive sustainability analysis
|
|
120
|
+
infra-cost --sustainability --carbon-footprint --green-recommendations
|
|
55
121
|
```
|
|
56
122
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
### Command Line Options
|
|
60
|
-
|
|
123
|
+
### 3. Team Collaboration
|
|
61
124
|
```bash
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
-r, --region [region] Cloud provider region (default: "us-east-1")
|
|
68
|
-
|
|
69
|
-
AWS/Generic Credentials:
|
|
70
|
-
-k, --access-key [key] Access key (AWS Access Key, etc.)
|
|
71
|
-
-s, --secret-key [key] Secret key (AWS Secret Key, etc.)
|
|
72
|
-
-T, --session-token [key] Session token (AWS Session Token, etc.)
|
|
73
|
-
|
|
74
|
-
Google Cloud Options:
|
|
75
|
-
--project-id [id] GCP Project ID
|
|
76
|
-
--key-file [path] Path to service account JSON file
|
|
77
|
-
|
|
78
|
-
Azure Options:
|
|
79
|
-
--subscription-id [id] Azure Subscription ID
|
|
80
|
-
--tenant-id [id] Azure Tenant ID
|
|
81
|
-
--client-id [id] Azure Client ID
|
|
82
|
-
--client-secret [secret] Azure Client Secret
|
|
83
|
-
|
|
84
|
-
Alibaba Cloud Options:
|
|
85
|
-
(Uses --access-key and --secret-key)
|
|
86
|
-
|
|
87
|
-
Oracle Cloud Options:
|
|
88
|
-
--user-id [id] Oracle User OCID
|
|
89
|
-
--tenancy-id [id] Oracle Tenancy OCID
|
|
90
|
-
--fingerprint [fingerprint] Oracle Public Key Fingerprint
|
|
91
|
-
--key-file [path] Path to private key file
|
|
92
|
-
|
|
93
|
-
Output Options:
|
|
94
|
-
-j, --json Get the output as JSON
|
|
95
|
-
-u, --summary Get only the summary without service breakdown
|
|
96
|
-
-t, --text Get the output as plain text (no colors/tables)
|
|
97
|
-
|
|
98
|
-
Slack Integration:
|
|
99
|
-
-S, --slack-token [token] Token for the slack integration
|
|
100
|
-
-C, --slack-channel [channel] Channel to which the slack integration should post
|
|
101
|
-
|
|
102
|
-
Other Options:
|
|
103
|
-
-V, --version output the version number
|
|
104
|
-
-h, --help display help for command
|
|
125
|
+
# Send daily cost report to Slack
|
|
126
|
+
infra-cost --slack-token YOUR_TOKEN --slack-channel "#finops" --smart-alerts
|
|
127
|
+
|
|
128
|
+
# Start real-time cost monitoring
|
|
129
|
+
infra-cost --monitor --alert-threshold 1000 --alert-channel slack
|
|
105
130
|
```
|
|
106
131
|
|
|
107
132
|
## ๐ Authentication
|
|
108
133
|
|
|
109
|
-
### AWS Authentication (Multiple Methods
|
|
134
|
+
### AWS Authentication (Multiple Methods)
|
|
110
135
|
|
|
111
|
-
#### 1. Environment Variables
|
|
136
|
+
#### 1. Environment Variables (Recommended)
|
|
112
137
|
```bash
|
|
113
138
|
export AWS_ACCESS_KEY_ID=your_access_key
|
|
114
139
|
export AWS_SECRET_ACCESS_KEY=your_secret_key
|
|
@@ -123,12 +148,15 @@ infra-cost
|
|
|
123
148
|
|
|
124
149
|
# Use specific profile
|
|
125
150
|
infra-cost --profile production
|
|
151
|
+
|
|
152
|
+
# Auto-discover profiles
|
|
153
|
+
infra-cost --discover-profiles --auto-profile
|
|
126
154
|
```
|
|
127
155
|
|
|
128
156
|
#### 3. IAM Roles (EC2/Lambda/ECS)
|
|
129
|
-
When running on AWS infrastructure, the CLI automatically uses IAM roles:
|
|
130
157
|
```bash
|
|
131
|
-
|
|
158
|
+
# Automatically uses attached IAM role
|
|
159
|
+
infra-cost
|
|
132
160
|
```
|
|
133
161
|
|
|
134
162
|
#### 4. AWS SSO
|
|
@@ -137,132 +165,258 @@ aws sso login --profile my-sso-profile
|
|
|
137
165
|
infra-cost --profile my-sso-profile
|
|
138
166
|
```
|
|
139
167
|
|
|
140
|
-
|
|
168
|
+
### Multi-Cloud Setup (Coming Soon)
|
|
141
169
|
```bash
|
|
142
|
-
|
|
143
|
-
|
|
170
|
+
# Google Cloud Platform
|
|
171
|
+
infra-cost --provider gcp --project-id my-project --key-file service-account.json
|
|
144
172
|
|
|
145
|
-
|
|
173
|
+
# Microsoft Azure
|
|
174
|
+
infra-cost --provider azure --subscription-id sub-id --tenant-id tenant-id
|
|
146
175
|
|
|
147
|
-
|
|
176
|
+
# Cross-cloud comparison
|
|
177
|
+
infra-cost --compare-clouds aws,gcp,azure --optimization-report
|
|
178
|
+
```
|
|
148
179
|
|
|
149
|
-
## ๐ Output
|
|
180
|
+
## ๐ Output Examples
|
|
150
181
|
|
|
151
|
-
###
|
|
182
|
+
### Default Rich Terminal UI
|
|
152
183
|
```bash
|
|
153
|
-
infra-cost
|
|
184
|
+
infra-cost --smart-alerts --compact
|
|
154
185
|
```
|
|
155
|
-

|
|
186
|
+

|
|
156
187
|
|
|
157
|
-
###
|
|
188
|
+
### Executive Dashboard
|
|
158
189
|
```bash
|
|
159
|
-
infra-cost --summary
|
|
190
|
+
infra-cost --executive-summary
|
|
160
191
|
```
|
|
161
|
-

|
|
162
193
|
|
|
163
|
-
###
|
|
194
|
+
### JSON for Automation
|
|
164
195
|
```bash
|
|
165
|
-
infra-cost --
|
|
196
|
+
infra-cost --json --forecast 30 --analytics-insights
|
|
166
197
|
```
|
|
167
198
|
|
|
168
|
-
###
|
|
199
|
+
### PDF Reports
|
|
169
200
|
```bash
|
|
170
|
-
infra-cost --
|
|
201
|
+
infra-cost --pdf-report monthly-report.pdf --trend --optimization-tips
|
|
171
202
|
```
|
|
172
203
|
|
|
173
204
|
## ๐ฌ Slack Integration
|
|
174
205
|
|
|
175
|
-
### Enhanced
|
|
176
|
-
- **
|
|
177
|
-
- **
|
|
178
|
-
- **
|
|
179
|
-
- **
|
|
206
|
+
### Enhanced Team Collaboration
|
|
207
|
+
- **Rich cost breakdowns** with visual charts
|
|
208
|
+
- **Proactive alerts** for budget overruns and anomalies
|
|
209
|
+
- **Automated workflows** for approval processes
|
|
210
|
+
- **Team cost awareness** with regular updates
|
|
180
211
|
|
|
181
|
-
### Setup
|
|
182
|
-
1. Create a [Slack app](https://api.slack.com/apps?new_app=1)
|
|
183
|
-
2. Add `chat:write` and `chat:write.public` scopes
|
|
184
|
-
3. Get your OAuth token and channel ID
|
|
185
|
-
|
|
186
|
-
### Usage
|
|
212
|
+
### Setup & Usage
|
|
187
213
|
```bash
|
|
188
|
-
|
|
214
|
+
# Create Slack app with chat:write permissions
|
|
215
|
+
# Get OAuth token and channel ID
|
|
216
|
+
|
|
217
|
+
# Send cost report
|
|
218
|
+
infra-cost --slack-token xoxb-your-token --slack-channel "#finops"
|
|
219
|
+
|
|
220
|
+
# Enable smart alerts
|
|
221
|
+
infra-cost --slack-token xoxb-your-token --slack-channel "#alerts" --smart-alerts
|
|
189
222
|
```
|
|
190
223
|
|
|
191
224
|
### Automated Daily Reports
|
|
192
|
-
Set up a GitHub workflow to send daily cost reports:
|
|
193
|
-
|
|
194
225
|
```yaml
|
|
195
|
-
name: Daily
|
|
226
|
+
name: Daily FinOps Report
|
|
196
227
|
on:
|
|
197
228
|
schedule:
|
|
198
|
-
- cron: '0 9 * *
|
|
229
|
+
- cron: '0 9 * * 1-5' # Weekdays 9 AM UTC
|
|
199
230
|
jobs:
|
|
200
|
-
|
|
231
|
+
cost-report:
|
|
201
232
|
runs-on: ubuntu-latest
|
|
202
233
|
steps:
|
|
203
|
-
- uses: actions/checkout@v4
|
|
204
234
|
- run: |
|
|
205
235
|
npx infra-cost \
|
|
236
|
+
--executive-summary \
|
|
206
237
|
--slack-token ${{ secrets.SLACK_TOKEN }} \
|
|
207
|
-
--slack-channel ${{ secrets.SLACK_CHANNEL }}
|
|
238
|
+
--slack-channel ${{ secrets.SLACK_CHANNEL }} \
|
|
239
|
+
--smart-alerts --trends 7
|
|
208
240
|
```
|
|
209
241
|
|
|
210
|
-
##
|
|
242
|
+
## ๐ค GitHub Actions Integration
|
|
211
243
|
|
|
212
|
-
|
|
213
|
-
This project includes automated npm publishing with semantic versioning:
|
|
244
|
+
**infra-cost** is available as a GitHub Action on the [GitHub Marketplace](https://github.com/marketplace/actions/infra-cost-multi-cloud-finops-analysis), making it easy to integrate cost analysis into your CI/CD workflows.
|
|
214
245
|
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
246
|
+
### Basic Usage
|
|
247
|
+
```yaml
|
|
248
|
+
name: Cost Analysis
|
|
249
|
+
on: [push, pull_request]
|
|
218
250
|
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
251
|
+
jobs:
|
|
252
|
+
analyze:
|
|
253
|
+
runs-on: ubuntu-latest
|
|
254
|
+
steps:
|
|
255
|
+
- uses: codecollab-co/infra-cost@v0.3.0
|
|
256
|
+
with:
|
|
257
|
+
provider: aws
|
|
258
|
+
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
|
259
|
+
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
|
260
|
+
analysis-type: summary
|
|
261
|
+
```
|
|
223
262
|
|
|
224
|
-
|
|
225
|
-
|
|
263
|
+
### PR Cost Check with Comments
|
|
264
|
+
```yaml
|
|
265
|
+
name: PR Cost Check
|
|
266
|
+
on:
|
|
267
|
+
pull_request:
|
|
268
|
+
branches: [main]
|
|
226
269
|
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
270
|
+
jobs:
|
|
271
|
+
cost-check:
|
|
272
|
+
runs-on: ubuntu-latest
|
|
273
|
+
permissions:
|
|
274
|
+
pull-requests: write
|
|
275
|
+
steps:
|
|
276
|
+
- uses: codecollab-co/infra-cost@v0.3.0
|
|
277
|
+
with:
|
|
278
|
+
provider: aws
|
|
279
|
+
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
|
280
|
+
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
|
281
|
+
analysis-type: delta
|
|
282
|
+
delta-threshold: '10'
|
|
283
|
+
comment-on-pr: 'true'
|
|
230
284
|
```
|
|
231
285
|
|
|
232
|
-
###
|
|
233
|
-
|
|
286
|
+
### Daily Cost Report to Slack
|
|
287
|
+
```yaml
|
|
288
|
+
name: Daily Cost Report
|
|
289
|
+
on:
|
|
290
|
+
schedule:
|
|
291
|
+
- cron: '0 9 * * *'
|
|
292
|
+
|
|
293
|
+
jobs:
|
|
294
|
+
report:
|
|
295
|
+
runs-on: ubuntu-latest
|
|
296
|
+
steps:
|
|
297
|
+
- uses: codecollab-co/infra-cost@v0.3.0
|
|
298
|
+
with:
|
|
299
|
+
provider: aws
|
|
300
|
+
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
|
301
|
+
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
|
302
|
+
analysis-type: finops
|
|
303
|
+
slack-webhook: ${{ secrets.SLACK_WEBHOOK }}
|
|
304
|
+
```
|
|
234
305
|
|
|
306
|
+
### Action Inputs
|
|
307
|
+
|
|
308
|
+
| Input | Description | Default |
|
|
309
|
+
|-------|-------------|---------|
|
|
310
|
+
| `provider` | Cloud provider (aws, gcp, azure, alicloud, oracle) | `aws` |
|
|
311
|
+
| `profile` | Cloud provider profile | `default` |
|
|
312
|
+
| `region` | Cloud provider region | `us-east-1` |
|
|
313
|
+
| `aws-access-key-id` | AWS Access Key ID | - |
|
|
314
|
+
| `aws-secret-access-key` | AWS Secret Access Key | - |
|
|
315
|
+
| `analysis-type` | Type of analysis (summary, detailed, delta, forecast, anomaly, finops, audit) | `summary` |
|
|
316
|
+
| `forecast-days` | Days for forecast | `30` |
|
|
317
|
+
| `delta-threshold` | Alert threshold for cost changes (%) | `10` |
|
|
318
|
+
| `output-format` | Output format (text, json) | `text` |
|
|
319
|
+
| `slack-webhook` | Slack webhook URL | - |
|
|
320
|
+
| `comment-on-pr` | Post analysis as PR comment | `false` |
|
|
321
|
+
| `fail-on-threshold` | Fail if costs exceed threshold | `false` |
|
|
322
|
+
|
|
323
|
+
### Action Outputs
|
|
324
|
+
|
|
325
|
+
| Output | Description |
|
|
326
|
+
|--------|-------------|
|
|
327
|
+
| `total-cost` | Total cost for the analysis period |
|
|
328
|
+
| `cost-change` | Cost change percentage |
|
|
329
|
+
| `forecast-cost` | Forecasted cost |
|
|
330
|
+
| `anomalies-detected` | Number of anomalies detected |
|
|
331
|
+
| `report-json` | Full report in JSON format |
|
|
332
|
+
|
|
333
|
+
See [example workflows](.github/workflows/examples/) for more use cases.
|
|
334
|
+
|
|
335
|
+
## ๐ง Advanced Usage
|
|
336
|
+
|
|
337
|
+
### Cost Forecasting & Analytics
|
|
235
338
|
```bash
|
|
236
|
-
#
|
|
237
|
-
|
|
339
|
+
# AI-powered forecasting with multiple models
|
|
340
|
+
infra-cost --forecast 90 --forecast-model AUTO --forecast-confidence 95
|
|
238
341
|
|
|
239
|
-
#
|
|
240
|
-
|
|
241
|
-
# 2. Update Homebrew formula
|
|
242
|
-
# 3. Run tests and build
|
|
243
|
-
# 4. Create git tag
|
|
244
|
-
# 5. Trigger release workflow
|
|
245
|
-
```
|
|
342
|
+
# Business intelligence insights
|
|
343
|
+
infra-cost --analytics --analytics-insights --analytics-drivers
|
|
246
344
|
|
|
247
|
-
|
|
345
|
+
# Custom dashboards
|
|
346
|
+
infra-cost --dashboard-create "Monthly Review" --chart-create "line:Cost Trends"
|
|
347
|
+
```
|
|
248
348
|
|
|
249
|
-
###
|
|
349
|
+
### Optimization & Automation
|
|
250
350
|
```bash
|
|
251
|
-
|
|
351
|
+
# Generate optimization recommendations
|
|
352
|
+
infra-cost --finops --optimization-tips --rightsize --sustainability
|
|
353
|
+
|
|
354
|
+
# Automated optimization (dry-run first!)
|
|
355
|
+
infra-cost --optimize-dry-run --optimize-rules resize,schedule,unused
|
|
356
|
+
|
|
357
|
+
# Cross-cloud cost comparison
|
|
358
|
+
infra-cost --compare-clouds aws,gcp --optimization-report
|
|
252
359
|
```
|
|
253
360
|
|
|
254
|
-
###
|
|
361
|
+
### Enterprise Features
|
|
255
362
|
```bash
|
|
256
|
-
|
|
363
|
+
# Multi-tenant management
|
|
364
|
+
infra-cost --enterprise --tenants --platform-metrics
|
|
365
|
+
|
|
366
|
+
# API server for integrations
|
|
367
|
+
infra-cost --api-server --api-port 3000 --webhook-create
|
|
368
|
+
|
|
369
|
+
# Comprehensive audit logging
|
|
370
|
+
infra-cost --audit --compliance-check soc2 --audit-export json
|
|
257
371
|
```
|
|
258
372
|
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
373
|
+
## ๐๏ธ Architecture & Extensibility
|
|
374
|
+
|
|
375
|
+
### Multi-Cloud Provider Pattern
|
|
376
|
+
```
|
|
377
|
+
src/
|
|
378
|
+
โโโ providers/
|
|
379
|
+
โ โโโ factory.ts # Provider factory
|
|
380
|
+
โ โโโ aws.ts # AWS implementation โ
|
|
381
|
+
โ โโโ gcp.ts # Google Cloud ๐ง
|
|
382
|
+
โ โโโ azure.ts # Azure ๐ง
|
|
383
|
+
โ โโโ alicloud.ts # Alibaba Cloud ๐ง
|
|
384
|
+
โ โโโ oracle.ts # Oracle Cloud ๐ง
|
|
385
|
+
โโโ analytics/ # AI/ML cost analysis
|
|
386
|
+
โโโ optimization/ # Cost optimization engines
|
|
387
|
+
โโโ visualization/ # Dashboards & charts
|
|
388
|
+
โโโ integrations/ # Third-party integrations
|
|
389
|
+
โโโ enterprise/ # Multi-tenant features
|
|
264
390
|
```
|
|
265
391
|
|
|
392
|
+
### Key Design Principles
|
|
393
|
+
- **Abstract provider interface** for consistent multi-cloud API
|
|
394
|
+
- **Plugin architecture** for easy extensibility
|
|
395
|
+
- **Type-safe implementation** with comprehensive TypeScript coverage
|
|
396
|
+
- **Modular design** allowing feature composition
|
|
397
|
+
- **Performance optimized** with efficient data processing
|
|
398
|
+
|
|
399
|
+
## ๐ Roadmap
|
|
400
|
+
|
|
401
|
+
### Q4 2024
|
|
402
|
+
- โ
Enhanced terminal UI and visualization
|
|
403
|
+
- โ
AI-powered anomaly detection
|
|
404
|
+
- โ
Comprehensive PDF reporting
|
|
405
|
+
- โ
Advanced Slack integration
|
|
406
|
+
- ๐ง Google Cloud Platform support
|
|
407
|
+
|
|
408
|
+
### Q1 2025
|
|
409
|
+
- ๐ฎ Microsoft Azure integration
|
|
410
|
+
- ๐ฎ Advanced forecasting models
|
|
411
|
+
- ๐ฎ Mobile app companion
|
|
412
|
+
- ๐ฎ Sustainability tracking expansion
|
|
413
|
+
|
|
414
|
+
### Q2 2025
|
|
415
|
+
- ๐ฎ Alibaba Cloud & Oracle Cloud support
|
|
416
|
+
- ๐ฎ Advanced automation engine
|
|
417
|
+
- ๐ฎ Enterprise SSO integration
|
|
418
|
+
- ๐ฎ Custom plugin system
|
|
419
|
+
|
|
266
420
|
## ๐ Requirements & Permissions
|
|
267
421
|
|
|
268
422
|
### AWS Permissions Required
|
|
@@ -271,11 +425,14 @@ npm run version:set # Set specific version
|
|
|
271
425
|
"Version": "2012-10-17",
|
|
272
426
|
"Statement": [
|
|
273
427
|
{
|
|
274
|
-
"Sid": "
|
|
428
|
+
"Sid": "InfraCostMinimalPermissions",
|
|
275
429
|
"Effect": "Allow",
|
|
276
430
|
"Action": [
|
|
277
431
|
"iam:ListAccountAliases",
|
|
278
432
|
"ce:GetCostAndUsage",
|
|
433
|
+
"ce:GetRightsizingRecommendation",
|
|
434
|
+
"ce:GetSavingsUtilization",
|
|
435
|
+
"budgets:ViewBudget",
|
|
279
436
|
"sts:GetCallerIdentity"
|
|
280
437
|
],
|
|
281
438
|
"Resource": "*"
|
|
@@ -284,59 +441,115 @@ npm run version:set # Set specific version
|
|
|
284
441
|
}
|
|
285
442
|
```
|
|
286
443
|
|
|
287
|
-
###
|
|
288
|
-
-
|
|
289
|
-
-
|
|
444
|
+
### System Requirements
|
|
445
|
+
- Node.js 20+ (required)
|
|
446
|
+
- Memory: 512MB+ available
|
|
447
|
+
- Network: Internet access for cloud provider APIs
|
|
448
|
+
- Optional: Docker for containerized deployments
|
|
290
449
|
|
|
291
|
-
##
|
|
450
|
+
## ๐งช Development
|
|
292
451
|
|
|
293
|
-
###
|
|
294
|
-
```
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
452
|
+
### Local Development Setup
|
|
453
|
+
```bash
|
|
454
|
+
# Clone repository
|
|
455
|
+
git clone https://github.com/codecollab-co/infra-cost.git
|
|
456
|
+
cd infra-cost
|
|
457
|
+
|
|
458
|
+
# Install dependencies
|
|
459
|
+
npm install
|
|
460
|
+
|
|
461
|
+
# Build project
|
|
462
|
+
npm run build
|
|
463
|
+
|
|
464
|
+
# Run tests
|
|
465
|
+
npm test
|
|
466
|
+
|
|
467
|
+
# Start development server
|
|
468
|
+
npm run dev
|
|
306
469
|
```
|
|
307
470
|
|
|
308
|
-
###
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
471
|
+
### Testing & Quality Assurance
|
|
472
|
+
```bash
|
|
473
|
+
# Type checking
|
|
474
|
+
npm run typecheck
|
|
475
|
+
|
|
476
|
+
# Linting
|
|
477
|
+
npm run lint
|
|
313
478
|
|
|
314
|
-
|
|
479
|
+
# Security audit
|
|
480
|
+
npm audit
|
|
315
481
|
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
- **Release automation** with GitHub Actions
|
|
320
|
-
- **Multi-platform testing** (Node.js 16, 18, 20)
|
|
482
|
+
# Test coverage
|
|
483
|
+
npm run test:coverage
|
|
484
|
+
```
|
|
321
485
|
|
|
322
|
-
###
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
- **Build verification**
|
|
486
|
+
### Release Management
|
|
487
|
+
```bash
|
|
488
|
+
# Check current version status
|
|
489
|
+
npm run version:check
|
|
327
490
|
|
|
328
|
-
|
|
491
|
+
# Bump version
|
|
492
|
+
npm run version:bump:patch # Bug fixes
|
|
493
|
+
npm run version:bump:minor # New features
|
|
494
|
+
npm run version:bump:major # Breaking changes
|
|
329
495
|
|
|
330
|
-
|
|
331
|
-
|
|
496
|
+
# Prepare release
|
|
497
|
+
npm run prepare-release
|
|
498
|
+
```
|
|
332
499
|
|
|
333
500
|
## ๐ค Contributing
|
|
334
501
|
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
502
|
+
We welcome contributions from the community! Here's how you can help:
|
|
503
|
+
|
|
504
|
+
### ๐ Ways to Contribute
|
|
505
|
+
- **โญ Star this repository** to show your support
|
|
506
|
+
- **๐ Report bugs** and suggest improvements via [issues](https://github.com/codecollab-co/infra-cost/issues)
|
|
507
|
+
- **๐ Improve documentation** - help others understand and use the tool
|
|
508
|
+
- **๐ง Add cloud provider support** - help us expand to more providers
|
|
509
|
+
- **๐งช Write tests** - improve code quality and reliability
|
|
510
|
+
- **๐ก Suggest features** - share your ideas for new capabilities
|
|
511
|
+
|
|
512
|
+
### ๐ Getting Started with Contributing
|
|
513
|
+
1. **Fork** the repository
|
|
514
|
+
2. **Clone** your fork: `git clone https://github.com/YOUR_USERNAME/infra-cost.git`
|
|
515
|
+
3. **Create a branch**: `git checkout -b feature/amazing-feature`
|
|
516
|
+
4. **Make changes** and write tests
|
|
517
|
+
5. **Run quality checks**: `npm run typecheck && npm run lint && npm test`
|
|
518
|
+
6. **Commit**: `git commit -m "Add amazing feature"`
|
|
519
|
+
7. **Push**: `git push origin feature/amazing-feature`
|
|
520
|
+
8. **Create a Pull Request**
|
|
521
|
+
|
|
522
|
+
### ๐ Contribution Guidelines
|
|
523
|
+
- Follow the existing code style and conventions
|
|
524
|
+
- Add tests for new features
|
|
525
|
+
- Update documentation as needed
|
|
526
|
+
- Keep PRs focused on a single feature/fix
|
|
527
|
+
- Be respectful and constructive in discussions
|
|
528
|
+
|
|
529
|
+
### ๐ท๏ธ Good First Issues
|
|
530
|
+
Look for issues labeled `good first issue` or `help wanted` to get started!
|
|
531
|
+
|
|
532
|
+
## ๐ Support & Community
|
|
533
|
+
|
|
534
|
+
### ๐ฌ Get Help
|
|
535
|
+
- **๐ Documentation**: [docs.codecollab.co/infra-cost](https://docs.codecollab.co/infra-cost) *(coming soon)*
|
|
536
|
+
- **๐ Bug Reports**: [GitHub Issues](https://github.com/codecollab-co/infra-cost/issues)
|
|
537
|
+
- **๐ก Feature Requests**: [GitHub Discussions](https://github.com/codecollab-co/infra-cost/discussions)
|
|
538
|
+
- **๐ง Email Support**: support@codecollab.co
|
|
539
|
+
|
|
540
|
+
### ๐ Show Your Support
|
|
541
|
+
If infra-cost helps you save money and optimize costs, please:
|
|
542
|
+
- โญ **Star this repository**
|
|
543
|
+
- ๐ฆ **Share on Twitter** with #InfraCost #FinOps
|
|
544
|
+
- ๐ **Write a review** or blog post about your experience
|
|
545
|
+
- ๐ค **Contribute** code, documentation, or feedback
|
|
546
|
+
|
|
547
|
+
### ๐ข Enterprise Support
|
|
548
|
+
For enterprise deployments, custom integrations, and professional support:
|
|
549
|
+
- ๐ง Contact: enterprise@codecollab.co
|
|
550
|
+
- ๐ SLA-backed support available
|
|
551
|
+
- ๐จ Custom branding and whitelabeling
|
|
552
|
+
- ๐๏ธ Professional services and consulting
|
|
340
553
|
|
|
341
554
|
## ๐ License
|
|
342
555
|
|
|
@@ -344,19 +557,39 @@ MIT ยฉ [Code Collab](https://github.com/codecollab-co)
|
|
|
344
557
|
|
|
345
558
|
---
|
|
346
559
|
|
|
347
|
-
## ๐
|
|
560
|
+
## ๐ Changelog
|
|
348
561
|
|
|
349
|
-
### v0.
|
|
350
|
-
- โ
**
|
|
351
|
-
- โ
**
|
|
352
|
-
- โ
**
|
|
353
|
-
- โ
**
|
|
354
|
-
- โ
**
|
|
355
|
-
|
|
562
|
+
### v0.3.0 - Latest Release
|
|
563
|
+
- โ
**GitHub Marketplace Action** - Integrate cost analysis into CI/CD workflows
|
|
564
|
+
- โ
**Node.js 20+ support** - Updated runtime requirements
|
|
565
|
+
- โ
**Sprint 6 UX improvements** - Enhanced user experience
|
|
566
|
+
- โ
**Configuration improvements** - Better config resolution and file permissions
|
|
567
|
+
- โ
**Date normalization** - Consistent UTC date handling
|
|
568
|
+
|
|
569
|
+
### v0.2.4
|
|
570
|
+
- โ
**Fixed CommonJS compatibility** - Homebrew installation now works perfectly
|
|
571
|
+
- โ
**Enhanced error handling** and user experience improvements
|
|
572
|
+
- โ
**Optimized build process** for better performance
|
|
573
|
+
|
|
574
|
+
### v0.2.0 - Enhanced Features
|
|
575
|
+
- โ
**AI-powered anomaly detection** with real-time monitoring
|
|
576
|
+
- โ
**Advanced visualization engine** with interactive dashboards
|
|
577
|
+
- โ
**PDF report generation** for executives and technical teams
|
|
578
|
+
- โ
**Comprehensive Slack integration** with rich formatting
|
|
579
|
+
- โ
**Multi-cloud architecture** ready for expansion
|
|
580
|
+
- โ
**Enterprise features** including multi-tenancy and API server
|
|
356
581
|
|
|
357
582
|
### Migration from aws-cost-cli
|
|
358
|
-
This tool
|
|
583
|
+
This tool evolved from `aws-cost-cli` with full backward compatibility. Both `infra-cost` and `aws-cost` commands work seamlessly.
|
|
359
584
|
|
|
360
585
|
---
|
|
361
586
|
|
|
362
|
-
|
|
587
|
+
<div align="center">
|
|
588
|
+
|
|
589
|
+
**Made with โค๏ธ by [Code Collab](https://github.com/codecollab-co)**
|
|
590
|
+
|
|
591
|
+
*Empowering teams to optimize cloud costs and build sustainable infrastructure*
|
|
592
|
+
|
|
593
|
+
[โญ Star us on GitHub](https://github.com/codecollab-co/infra-cost) โข [๐ฆ Follow on Twitter](https://twitter.com/codecollabco) โข [๐ผ LinkedIn](https://linkedin.com/company/codecollab-co)
|
|
594
|
+
|
|
595
|
+
</div>
|