infra-cost 0.3.3 โ†’ 1.2.0

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 CHANGED
@@ -12,12 +12,23 @@
12
12
 
13
13
  *Take control of your cloud costs across AWS, Google Cloud, Azure, Alibaba Cloud, and Oracle Cloud* ๐Ÿš€
14
14
 
15
- [Installation](#-installation) โ€ข [Quick Start](#-quick-start) โ€ข [Features](#-features) โ€ข [Documentation](#-documentation) โ€ข [Contributing](#-contributing)
15
+ [Installation](#-installation) โ€ข [Quick Start](#-quick-start) โ€ข [Features](#-features) โ€ข [Documentation](#-documentation) โ€ข [Development](#-development) โ€ข [Contributing](#-contributing)
16
16
 
17
17
  </div>
18
18
 
19
19
  ---
20
20
 
21
+ > **๐Ÿ“ข Migrating from v0.x?**
22
+ > infra-cost v1.0 introduces a new subcommand-based CLI architecture for better organization and discoverability.
23
+ >
24
+ > - **Quick migration:** Run `infra-cost config migrate` to automatically update your configuration
25
+ > - **Command changes:** Old flags are now organized subcommands (e.g., `--inventory` โ†’ `export inventory json`)
26
+ > - **Full guide:** See [MIGRATION_GUIDE.md](./MIGRATION_GUIDE.md) for complete migration instructions
27
+ >
28
+ > All new features and improvements are built on this solid foundation!
29
+
30
+ ---
31
+
21
32
  ## ๐ŸŽฏ Why infra-cost?
22
33
 
23
34
  **Save money. Optimize resources. Make informed decisions.**
@@ -34,7 +45,7 @@
34
45
 
35
46
  ### ๐ŸŒ **Multi-Cloud Support**
36
47
  - **AWS** โœ… (Full support with Cost Explorer integration)
37
- - **Google Cloud** ๐Ÿšง (Architecture ready, coming soon)
48
+ - **Google Cloud** โœ… (BigQuery billing export, multi-project support)
38
49
  - **Microsoft Azure** ๐Ÿšง (Architecture ready, coming soon)
39
50
  - **Alibaba Cloud** ๐Ÿšง (Architecture ready, coming soon)
40
51
  - **Oracle Cloud** ๐Ÿšง (Architecture ready, coming soon)
@@ -62,6 +73,173 @@
62
73
  - **API Server**: REST endpoints for custom integrations
63
74
  - **Webhook Support**: Real-time notifications and integrations
64
75
 
76
+ ## ๐Ÿ“– CLI Commands Overview
77
+
78
+ infra-cost v1.0 uses a modern subcommand-based architecture for better organization and discoverability.
79
+
80
+ ### โšก Quick Commands
81
+
82
+ #### `infra-cost now` - Instant Cost Check (NEW in v1.2.0)
83
+
84
+ See today's cloud spending in one second - perfect for morning cost checks!
85
+
86
+ ```bash
87
+ # Quick daily cost check (zero config)
88
+ infra-cost now
89
+
90
+ # Output:
91
+ # ๐Ÿ’ฐ Today's Cost: $45.23 (+$3.12 โ†‘ from yesterday)
92
+ # ๐Ÿ“Š Top Services: EC2 $22.10 | RDS $15.30 | S3 $4.20
93
+ # ๐Ÿ“ˆ Month-to-Date: $892.45 / $1,500 (59%)
94
+ # [โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘] 59%
95
+ #
96
+ # Provider: AWS
97
+ # Run `infra-cost cost` for detailed breakdown
98
+ ```
99
+
100
+ **Features:**
101
+ - ๐Ÿš€ **Zero configuration** - auto-detects your default AWS profile
102
+ - ๐Ÿ“Š **Smart summary** - today's cost + delta from yesterday
103
+ - ๐ŸŽฏ **Top 3 services** - see where your money is going at a glance
104
+ - ๐Ÿ’น **Budget progress** - visual progress bar if budgets configured
105
+ - ๐ŸŽจ **Color-coded** - green = under budget, red = over budget
106
+ - โšก **Lightning fast** - get your answer in ~1 second
107
+
108
+ **Options:**
109
+ ```bash
110
+ infra-cost now # Default profile
111
+ infra-cost now --profile prod # Specific profile
112
+ infra-cost now --provider gcp # Google Cloud
113
+ infra-cost now --json # JSON output for scripting
114
+ ```
115
+
116
+ **Perfect for:**
117
+ - Morning stand-ups: "How much did we spend yesterday?"
118
+ - Quick sanity checks before demos
119
+ - Solo developers and indie hackers
120
+ - Anyone who wants instant cost visibility
121
+
122
+ ---
123
+
124
+ #### `infra-cost free-tier` - AWS Free Tier Tracker (NEW in v1.2.0)
125
+
126
+ Track your AWS Free Tier usage and prevent surprise bills - perfect for solo developers and indie hackers!
127
+
128
+ ```bash
129
+ # Check free tier status
130
+ infra-cost free-tier
131
+
132
+ # Output:
133
+ # ๐Ÿ†“ AWS Free Tier Status (Account: 123456789012)
134
+ # โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•
135
+ #
136
+ # EC2 (t2.micro/t3.micro instances)
137
+ # โ”œโ”€โ”€ Used: 620.0 hours / 750 hours (82.7%)
138
+ # โ”œโ”€โ”€ [โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–‘โ–‘โ–‘โ–‘โ–‘โ–‘] 83%
139
+ # โ””โ”€โ”€ โš ๏ธ Warning: 130.0 hours remaining
140
+ #
141
+ # S3 (Standard storage)
142
+ # โ”œโ”€โ”€ Used: 4.2 GB / 5 GB (84.0%)
143
+ # โ”œโ”€โ”€ [โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–‘โ–‘โ–‘โ–‘โ–‘โ–‘] 84%
144
+ # โ””โ”€โ”€ โš ๏ธ Warning: 0.8 GB remaining
145
+ #
146
+ # Lambda (1M requests, 400K GB-sec)
147
+ # โ”œโ”€โ”€ Used: 0.0 cost / 0 cost (0.0%)
148
+ # โ”œโ”€โ”€ [โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘] 0%
149
+ # โ””โ”€โ”€ โœ… On track
150
+ #
151
+ # โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
152
+ # ๐Ÿ’ก Tip: You have 8 days until month end
153
+ ```
154
+
155
+ **Features:**
156
+ - ๐Ÿ†“ **Tracks popular free tier services**: EC2, S3, Lambda, RDS
157
+ - ๐Ÿ“Š **Visual progress bars** - see usage at a glance
158
+ - โšก **Smart alerts** - warns when approaching limits (default: 80%)
159
+ - ๐Ÿ’ฐ **Cost projection** - estimate month-end overages
160
+ - ๐ŸŽฏ **Perfect for beginners** - avoid surprise AWS bills
161
+ - ๐Ÿšจ **Status indicators** - green=safe, yellow=warning, red=critical
162
+
163
+ **Options:**
164
+ ```bash
165
+ infra-cost free-tier # Check current status
166
+ infra-cost free-tier --alert-threshold 90 # Custom threshold
167
+ infra-cost free-tier --show-projection # Show projected overages
168
+ infra-cost free-tier --json # JSON output
169
+ ```
170
+
171
+ **Tracked Services:**
172
+ - **EC2**: 750 hours/month (t2.micro/t3.micro)
173
+ - **S3**: 5 GB storage
174
+ - **Lambda**: Cost-based tracking (free tier = $0 cost)
175
+
176
+ **Perfect for:**
177
+ - Solo developers and indie hackers
178
+ - Students learning AWS
179
+ - New AWS users avoiding surprise bills
180
+ - Monthly free tier checkups
181
+
182
+ ---
183
+
184
+ ### Command Migration Table
185
+
186
+ | Command Usage | Old Command (v0.x) | New Command (v1.0) |
187
+ |--------------|-------------------|-------------------|
188
+ | **Cost Analysis** |
189
+ | Default cost analysis | `infra-cost` | `infra-cost cost analyze` |
190
+ | Show cost deltas | `infra-cost --delta` | `infra-cost cost analyze --show-delta` |
191
+ | Cost trends | `infra-cost --trends 30` | `infra-cost cost trends --period 30d` |
192
+ | Compare clouds | `infra-cost --compare-clouds aws,gcp` | `infra-cost cost compare --providers aws,gcp` |
193
+ | Forecast costs | `infra-cost --forecast 30` | `infra-cost cost forecast --days 30` |
194
+ | **Optimization** |
195
+ | Optimization recommendations | `infra-cost --finops` | `infra-cost optimize recommendations` |
196
+ | Quick wins | `infra-cost --quick-wins` | `infra-cost optimize quickwins` |
197
+ | Rightsizing | `infra-cost --rightsize` | `infra-cost optimize rightsizing` |
198
+ | Cross-cloud optimization | `infra-cost --optimization-report` | `infra-cost optimize cross-cloud` |
199
+ | **Monitoring & Alerts** |
200
+ | Cost alerts | `infra-cost --alerts` | `infra-cost monitor alerts` |
201
+ | Budget monitoring | `infra-cost --budgets` | `infra-cost monitor budgets` |
202
+ | Real-time monitoring | `infra-cost --monitor` | `infra-cost monitor watch` |
203
+ | Anomaly detection | `infra-cost --anomaly-detect` | `infra-cost monitor anomaly` |
204
+ | **Export & Reports** |
205
+ | Export inventory (JSON) | `infra-cost --inventory` | `infra-cost export inventory json` |
206
+ | Export inventory (CSV) | `infra-cost --inventory-export csv` | `infra-cost export inventory csv` |
207
+ | Export inventory (Excel) | `infra-cost --inventory-export xlsx` | `infra-cost export inventory xlsx` |
208
+ | Export inventory (PDF) | `infra-cost --inventory-export pdf` | `infra-cost export inventory pdf` |
209
+ | **AWS Organizations** |
210
+ | List accounts | `infra-cost --organizations` | `infra-cost organizations list` |
211
+ | Organization summary | `infra-cost --organizations-summary` | `infra-cost organizations summary` |
212
+ | Daily costs | `infra-cost --organizations-daily` | `infra-cost organizations daily` |
213
+ | **Chargeback** |
214
+ | Chargeback report | `infra-cost --chargeback` | `infra-cost chargeback report` |
215
+ | Send to Slack | `infra-cost --chargeback-slack` | `infra-cost chargeback slack` |
216
+ | **Dashboards** |
217
+ | Interactive dashboard | `infra-cost --dashboard` | `infra-cost dashboard interactive` |
218
+ | Multi-cloud dashboard | `infra-cost --dashboard-multicloud` | `infra-cost dashboard multicloud` |
219
+ | **Configuration** |
220
+ | Show configuration | `infra-cost --config-status` | `infra-cost config show` |
221
+ | Generate configuration | `infra-cost --config-generate` | `infra-cost config init` |
222
+ | Validate configuration | `infra-cost --config-validate` | `infra-cost config validate` |
223
+ | Migrate configuration | N/A (new in v1.0) | `infra-cost config migrate` |
224
+
225
+ ### Available Command Groups
226
+
227
+ - **`cost`** - Cost analysis, trends, comparisons, and forecasting
228
+ - **`optimize`** - Optimization recommendations and analysis
229
+ - **`monitor`** - Alerts, budgets, and anomaly detection
230
+ - **`export`** - Export data in multiple formats
231
+ - **`organizations`** - AWS Organizations multi-account support
232
+ - **`chargeback`** - Cost allocation and reporting
233
+ - **`config`** - Configuration management
234
+ - **`dashboard`** - Interactive dashboards
235
+
236
+ **Get help for any command:**
237
+ ```bash
238
+ infra-cost --help
239
+ infra-cost cost --help
240
+ infra-cost cost analyze --help
241
+ ```
242
+
65
243
  ## ๐Ÿ“ฆ Installation
66
244
 
67
245
  ### npm (Recommended)
@@ -98,35 +276,77 @@ docker run --rm codecollab-co/infra-cost --help
98
276
 
99
277
  ### 1. Basic AWS Cost Analysis
100
278
  ```bash
101
- # Using default AWS credentials
102
- infra-cost
279
+ # Analyze costs with default AWS credentials
280
+ infra-cost cost analyze
103
281
 
104
- # Get a 6-month cost trend with forecasting
105
- infra-cost --trend --forecast 30
282
+ # Show cost trends over time
283
+ infra-cost cost trends --period 30d
106
284
 
107
- # Interactive multi-cloud dashboard
108
- infra-cost --multi-cloud-dashboard
285
+ # Compare costs across multiple providers
286
+ infra-cost cost compare --providers aws,gcp
109
287
  ```
110
288
 
111
- ### 2. Advanced Analysis
289
+ ### 2. Google Cloud Platform Cost Analysis
112
290
  ```bash
113
- # Generate executive PDF report
114
- infra-cost --executive-summary --pdf-report quarterly-report.pdf
291
+ # Analyze GCP costs with service account
292
+ infra-cost cost analyze \
293
+ --provider gcp \
294
+ --project-id my-project \
295
+ --key-file /path/to/service-account.json
296
+
297
+ # List all accessible GCP projects
298
+ infra-cost cost analyze \
299
+ --provider gcp \
300
+ --project-id my-project \
301
+ --list-projects
302
+
303
+ # Analyze costs with custom billing dataset
304
+ infra-cost cost analyze \
305
+ --provider gcp \
306
+ --project-id my-project \
307
+ --billing-dataset custom_billing \
308
+ --billing-table custom_table
309
+
310
+ # Compare costs across multiple GCP projects
311
+ infra-cost cost compare \
312
+ --provider gcp \
313
+ --projects project-1,project-2,project-3
314
+ ```
315
+
316
+ ### 3. Optimization & Recommendations
317
+ ```bash
318
+ # Get AI-powered optimization recommendations
319
+ infra-cost optimize recommendations
115
320
 
116
- # AI-powered anomaly detection
117
- infra-cost --anomaly-detect --anomaly-realtime
321
+ # Find quick wins for immediate savings
322
+ infra-cost optimize quickwins
118
323
 
119
- # Comprehensive sustainability analysis
120
- infra-cost --sustainability --carbon-footprint --green-recommendations
324
+ # Get rightsizing recommendations
325
+ infra-cost optimize rightsizing
121
326
  ```
122
327
 
123
- ### 3. Team Collaboration
328
+ ### 4. Monitoring & Alerts
124
329
  ```bash
125
- # Send daily cost report to Slack
126
- infra-cost --slack-token YOUR_TOKEN --slack-channel "#finops" --smart-alerts
330
+ # Check cost alerts and budget status
331
+ infra-cost monitor alerts
332
+
333
+ # Monitor budgets
334
+ infra-cost monitor budgets
127
335
 
128
- # Start real-time cost monitoring
129
- infra-cost --monitor --alert-threshold 1000 --alert-channel slack
336
+ # Detect cost anomalies
337
+ infra-cost monitor anomaly
338
+ ```
339
+
340
+ ### 5. Team Collaboration
341
+ ```bash
342
+ # Send cost report to Slack
343
+ infra-cost chargeback slack
344
+
345
+ # Generate chargeback report
346
+ infra-cost chargeback report
347
+
348
+ # Interactive dashboard
349
+ infra-cost dashboard interactive
130
350
  ```
131
351
 
132
352
  ## ๐Ÿ” Authentication
@@ -138,67 +358,166 @@ infra-cost --monitor --alert-threshold 1000 --alert-channel slack
138
358
  export AWS_ACCESS_KEY_ID=your_access_key
139
359
  export AWS_SECRET_ACCESS_KEY=your_secret_key
140
360
  export AWS_REGION=us-east-1
141
- infra-cost
361
+ infra-cost cost analyze
142
362
  ```
143
363
 
144
364
  #### 2. AWS Profiles
145
365
  ```bash
146
366
  # Use default profile
147
- infra-cost
367
+ infra-cost cost analyze
148
368
 
149
369
  # Use specific profile
150
- infra-cost --profile production
370
+ infra-cost cost analyze --profile production
151
371
 
152
- # Auto-discover profiles
153
- infra-cost --discover-profiles --auto-profile
372
+ # Discover available profiles
373
+ infra-cost config show --discover-profiles
154
374
  ```
155
375
 
156
376
  #### 3. IAM Roles (EC2/Lambda/ECS)
157
377
  ```bash
158
378
  # Automatically uses attached IAM role
159
- infra-cost
379
+ infra-cost cost analyze
160
380
  ```
161
381
 
162
382
  #### 4. AWS SSO
163
383
  ```bash
164
384
  aws sso login --profile my-sso-profile
165
- infra-cost --profile my-sso-profile
385
+ infra-cost cost analyze --profile my-sso-profile
386
+ ```
387
+
388
+ #### 5. Configuration File
389
+ ```bash
390
+ # Initialize configuration
391
+ infra-cost config init
392
+
393
+ # Validate configuration
394
+ infra-cost config validate
395
+
396
+ # Show current configuration
397
+ infra-cost config show
398
+ ```
399
+
400
+ ### Google Cloud Platform Authentication
401
+
402
+ #### 1. Service Account Key File (Recommended)
403
+ ```bash
404
+ # Download service account key from GCP Console
405
+ # IAM & Admin > Service Accounts > Create Key (JSON)
406
+
407
+ export GOOGLE_PROJECT_ID=your-project-id
408
+ export GOOGLE_APPLICATION_CREDENTIALS=/path/to/service-account-key.json
409
+ infra-cost cost analyze --provider gcp
410
+ ```
411
+
412
+ #### 2. Application Default Credentials (ADC)
413
+ ```bash
414
+ # Authenticate with gcloud CLI
415
+ gcloud auth application-default login
416
+
417
+ # Set default project
418
+ gcloud config set project your-project-id
419
+
420
+ # Run infra-cost
421
+ infra-cost cost analyze --provider gcp --project-id your-project-id
422
+ ```
423
+
424
+ #### 3. Command-Line Arguments
425
+ ```bash
426
+ infra-cost cost analyze \
427
+ --provider gcp \
428
+ --project-id my-project \
429
+ --key-file /path/to/service-account.json
166
430
  ```
167
431
 
168
- ### Multi-Cloud Setup (Coming Soon)
432
+ #### 4. Configuration File
433
+ ```bash
434
+ # Initialize configuration with GCP
435
+ infra-cost config init
436
+
437
+ # Edit ~/.infra-cost/config.json
438
+ {
439
+ "provider": "gcp",
440
+ "credentials": {
441
+ "projectId": "my-project",
442
+ "keyFilePath": "/path/to/service-account.json",
443
+ "billingDatasetId": "billing_export",
444
+ "billingTableId": "gcp_billing_export"
445
+ }
446
+ }
447
+ ```
448
+
449
+ #### GCP Permissions Required
450
+ Your service account needs the following IAM permissions:
451
+ - `resourcemanager.projects.get` - Read project information
452
+ - `bigquery.jobs.create` - Query billing data
453
+ - `bigquery.tables.getData` - Read billing tables
454
+
455
+ **Recommended IAM Role:** `roles/bigquery.user` + custom role for project access
456
+
457
+ #### Enable BigQuery Billing Export
458
+ infra-cost requires BigQuery billing export to be enabled:
459
+
460
+ 1. Go to [GCP Billing Console](https://console.cloud.google.com/billing)
461
+ 2. Select your billing account
462
+ 3. Navigate to "Billing export"
463
+ 4. Enable "BigQuery export"
464
+ 5. Configure dataset (default: `billing_export`)
465
+ 6. Wait 24 hours for initial data
466
+
467
+ ### Multi-Cloud Setup
468
+
169
469
  ```bash
170
470
  # Google Cloud Platform
171
- infra-cost --provider gcp --project-id my-project --key-file service-account.json
471
+ infra-cost cost analyze --provider gcp --project-id my-project --key-file service-account.json
172
472
 
173
- # Microsoft Azure
174
- infra-cost --provider azure --subscription-id sub-id --tenant-id tenant-id
473
+ # Microsoft Azure (Coming Soon)
474
+ infra-cost cost analyze --provider azure --subscription-id sub-id --tenant-id tenant-id
475
+
476
+ # Oracle Cloud (Coming Soon)
477
+ infra-cost cost analyze --provider oracle --user-id user-ocid --tenancy-id tenancy-ocid
175
478
 
176
479
  # Cross-cloud comparison
177
- infra-cost --compare-clouds aws,gcp,azure --optimization-report
480
+ infra-cost cost compare --providers aws,gcp
481
+
482
+ # Cross-cloud optimization report (Coming Soon)
483
+ infra-cost optimize cross-cloud
178
484
  ```
179
485
 
180
486
  ## ๐Ÿ“Š Output Examples
181
487
 
182
488
  ### Default Rich Terminal UI
183
489
  ```bash
184
- infra-cost --smart-alerts --compact
490
+ infra-cost cost analyze --output fancy
185
491
  ```
186
492
  ![Cost Analysis](./.github/images/aws-cost.png)
187
493
 
188
- ### Executive Dashboard
494
+ ### Export Options
189
495
  ```bash
190
- infra-cost --executive-summary
496
+ # Export inventory to JSON
497
+ infra-cost export inventory json
498
+
499
+ # Export to CSV
500
+ infra-cost export inventory csv
501
+
502
+ # Export to Excel
503
+ infra-cost export inventory xlsx
504
+
505
+ # Export to PDF
506
+ infra-cost export inventory pdf
191
507
  ```
192
- ![Executive Summary](./.github/images/executive-dashboard.png)
193
508
 
194
509
  ### JSON for Automation
195
510
  ```bash
196
- infra-cost --json --forecast 30 --analytics-insights
511
+ infra-cost cost analyze --output json
197
512
  ```
198
513
 
199
- ### PDF Reports
514
+ ### Interactive Dashboard
200
515
  ```bash
201
- infra-cost --pdf-report monthly-report.pdf --trend --optimization-tips
516
+ # Launch interactive terminal dashboard
517
+ infra-cost dashboard interactive
518
+
519
+ # Multi-cloud dashboard
520
+ infra-cost dashboard multicloud
202
521
  ```
203
522
 
204
523
  ## ๐Ÿ’ฌ Slack Integration
@@ -211,14 +530,15 @@ infra-cost --pdf-report monthly-report.pdf --trend --optimization-tips
211
530
 
212
531
  ### Setup & Usage
213
532
  ```bash
214
- # Create Slack app with chat:write permissions
215
- # Get OAuth token and channel ID
533
+ # Configure Slack credentials (one-time setup)
534
+ export SLACK_TOKEN=xoxb-your-token
535
+ export SLACK_CHANNEL="#finops"
216
536
 
217
- # Send cost report
218
- infra-cost --slack-token xoxb-your-token --slack-channel "#finops"
537
+ # Send chargeback report to Slack
538
+ infra-cost chargeback slack
219
539
 
220
- # Enable smart alerts
221
- infra-cost --slack-token xoxb-your-token --slack-channel "#alerts" --smart-alerts
540
+ # Or provide inline
541
+ infra-cost chargeback slack --slack-token xoxb-your-token --slack-channel "#finops"
222
542
  ```
223
543
 
224
544
  ### Automated Daily Reports
@@ -232,11 +552,9 @@ jobs:
232
552
  runs-on: ubuntu-latest
233
553
  steps:
234
554
  - run: |
235
- npx infra-cost \
236
- --executive-summary \
555
+ npx infra-cost chargeback slack \
237
556
  --slack-token ${{ secrets.SLACK_TOKEN }} \
238
- --slack-channel ${{ secrets.SLACK_CHANNEL }} \
239
- --smart-alerts --trends 7
557
+ --slack-channel ${{ secrets.SLACK_CHANNEL }}
240
558
  ```
241
559
 
242
560
  ## ๐Ÿค– GitHub Actions Integration
@@ -334,88 +652,284 @@ See [example workflows](.github/workflows/examples/) for more use cases.
334
652
 
335
653
  ## ๐Ÿ”ง Advanced Usage
336
654
 
337
- ### Cost Forecasting & Analytics
655
+ ### AWS Organizations Support
656
+
657
+ #### Multi-Account Management
658
+ ```bash
659
+ # List all accounts in organization
660
+ infra-cost organizations list
661
+
662
+ # Get organization-wide cost summary
663
+ infra-cost organizations summary
664
+ ```
665
+
666
+ #### Daily Cost Reports with Slack Integration
667
+ ```bash
668
+ # Get daily costs for all accounts
669
+ infra-cost organizations daily
670
+
671
+ # Send daily report to Slack
672
+ infra-cost organizations daily --slack-webhook https://hooks.slack.com/services/YOUR/WEBHOOK/URL
673
+
674
+ # View 30-day history
675
+ infra-cost organizations daily --days 30
676
+
677
+ # Get scheduling instructions for automated daily reports
678
+ infra-cost organizations daily --schedule-daily --schedule-time 09:00
679
+
680
+ # Export to JSON for automation
681
+ infra-cost organizations daily --json
682
+ ```
683
+
684
+ **Features:**
685
+ - ๐Ÿ“Š Multi-account cost breakdown
686
+ - ๐Ÿ“ˆ Day-over-day cost trends with visual indicators
687
+ - ๐Ÿ”ฅ Top 5 spender accounts
688
+ - ๐Ÿ“Š Weekly averages and projections
689
+ - ๐Ÿ’ฌ Slack webhook integration for team notifications
690
+ - โฐ Scheduling instructions (cron, Lambda, GitHub Actions)
691
+
692
+ **Perfect for:**
693
+ - Large organizations with multiple AWS accounts
694
+ - FinOps teams managing cross-account costs
695
+ - Daily cost visibility and team accountability
696
+ - Automated cost reporting workflows
697
+
698
+ ### Cost Analysis & Forecasting
338
699
  ```bash
339
- # AI-powered forecasting with multiple models
340
- infra-cost --forecast 90 --forecast-model AUTO --forecast-confidence 95
700
+ # Analyze costs with delta comparison
701
+ infra-cost cost analyze --show-delta --delta-threshold 10
341
702
 
342
- # Business intelligence insights
343
- infra-cost --analytics --analytics-insights --analytics-drivers
703
+ # Get cost trends
704
+ infra-cost cost trends --period 90d
344
705
 
345
- # Custom dashboards
346
- infra-cost --dashboard-create "Monthly Review" --chart-create "line:Cost Trends"
706
+ # Compare costs across providers
707
+ infra-cost cost compare --providers aws,gcp,azure
708
+
709
+ # Forecast future costs
710
+ infra-cost cost forecast --days 30
347
711
  ```
348
712
 
349
- ### Optimization & Automation
713
+ ### Optimization Commands
350
714
  ```bash
351
- # Generate optimization recommendations
352
- infra-cost --finops --optimization-tips --rightsize --sustainability
715
+ # Get all optimization recommendations
716
+ infra-cost optimize recommendations
717
+
718
+ # Find quick wins for immediate savings
719
+ infra-cost optimize quickwins
353
720
 
354
- # Automated optimization (dry-run first!)
355
- infra-cost --optimize-dry-run --optimize-rules resize,schedule,unused
721
+ # Get rightsizing recommendations
722
+ infra-cost optimize rightsizing
356
723
 
357
- # Cross-cloud cost comparison
358
- infra-cost --compare-clouds aws,gcp --optimization-report
724
+ # Cross-cloud optimization analysis
725
+ infra-cost optimize cross-cloud
359
726
  ```
360
727
 
361
- ### Enterprise Features
728
+ ### Monitoring & Alerts
362
729
  ```bash
363
- # Multi-tenant management
364
- infra-cost --enterprise --tenants --platform-metrics
730
+ # Check cost alerts
731
+ infra-cost monitor alerts
365
732
 
366
- # API server for integrations
367
- infra-cost --api-server --api-port 3000 --webhook-create
733
+ # Monitor budgets
734
+ infra-cost monitor budgets
368
735
 
369
- # Comprehensive audit logging
370
- infra-cost --audit --compliance-check soc2 --audit-export json
736
+ # Watch for cost changes in real-time
737
+ infra-cost monitor watch
738
+
739
+ # Detect anomalies
740
+ infra-cost monitor anomaly
741
+ ```
742
+
743
+ ### Configuration Management
744
+ ```bash
745
+ # Initialize new configuration
746
+ infra-cost config init
747
+
748
+ # Show current configuration
749
+ infra-cost config show
750
+
751
+ # Validate configuration
752
+ infra-cost config validate
753
+
754
+ # Migrate from old version
755
+ infra-cost config migrate
371
756
  ```
372
757
 
373
758
  ## ๐Ÿ—๏ธ Architecture & Extensibility
374
759
 
375
- ### Multi-Cloud Provider Pattern
760
+ ### Clean Architecture Structure (v1.0)
376
761
  ```
377
762
  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
763
+ โ”œโ”€โ”€ cli/ # CLI layer
764
+ โ”‚ โ”œโ”€โ”€ commands/ # Subcommand structure
765
+ โ”‚ โ”‚ โ”œโ”€โ”€ cost/ # Cost analysis commands
766
+ โ”‚ โ”‚ โ”œโ”€โ”€ optimize/ # Optimization commands
767
+ โ”‚ โ”‚ โ”œโ”€โ”€ monitor/ # Monitoring commands
768
+ โ”‚ โ”‚ โ”œโ”€โ”€ export/ # Export commands
769
+ โ”‚ โ”‚ โ”œโ”€โ”€ organizations/ # AWS Organizations commands
770
+ โ”‚ โ”‚ โ”œโ”€โ”€ chargeback/ # Chargeback commands
771
+ โ”‚ โ”‚ โ”œโ”€โ”€ config/ # Configuration commands
772
+ โ”‚ โ”‚ โ””โ”€โ”€ dashboard/ # Dashboard commands
773
+ โ”‚ โ”œโ”€โ”€ middleware/ # Auth, validation, error handling
774
+ โ”‚ โ””โ”€โ”€ index.ts # CLI entry point
775
+ โ”œโ”€โ”€ core/ # Core business logic
776
+ โ”‚ โ”œโ”€โ”€ config/ # Configuration system
777
+ โ”‚ โ”‚ โ”œโ”€โ”€ schema.ts # Zod validation schemas
778
+ โ”‚ โ”‚ โ”œโ”€โ”€ loader.ts # Config file loading
779
+ โ”‚ โ”‚ โ”œโ”€โ”€ discovery.ts # Profile discovery
780
+ โ”‚ โ”‚ โ””โ”€โ”€ profiles.ts # Profile management
781
+ โ”‚ โ”œโ”€โ”€ logging/ # Structured logging
782
+ โ”‚ โ”œโ”€โ”€ analytics/ # Cost analytics engines
783
+ โ”‚ โ”œโ”€โ”€ optimization/ # Optimization engines
784
+ โ”‚ โ””โ”€โ”€ monitoring/ # Monitoring systems
785
+ โ”œโ”€โ”€ providers/ # Cloud provider implementations
786
+ โ”‚ โ”œโ”€โ”€ factory.ts # Provider factory
787
+ โ”‚ โ””โ”€โ”€ aws/ # AWS implementation โœ…
788
+ โ”‚ โ”œโ”€โ”€ provider.ts # Main provider class
789
+ โ”‚ โ”œโ”€โ”€ cost.ts # Cost Explorer integration
790
+ โ”‚ โ”œโ”€โ”€ account.ts # Account/Organizations
791
+ โ”‚ โ””โ”€โ”€ config.ts # AWS-specific config
792
+ โ”œโ”€โ”€ exporters/ # Output formatters
793
+ โ”‚ โ””โ”€โ”€ formats/
794
+ โ”‚ โ”œโ”€โ”€ fancy.ts # Rich terminal output
795
+ โ”‚ โ”œโ”€โ”€ json.ts # JSON output
796
+ โ”‚ โ”œโ”€โ”€ text.ts # Plain text
797
+ โ”‚ โ””โ”€โ”€ slack.ts # Slack formatting
798
+ โ””โ”€โ”€ enterprise/ # Enterprise features
799
+ โ”œโ”€โ”€ multi-tenant/ # Multi-tenancy support
800
+ โ””โ”€โ”€ audit/ # Audit logging
390
801
  ```
391
802
 
392
803
  ### 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
804
+ - **Subcommand Architecture** - Domain-organized, discoverable commands
805
+ - **Clean Separation** - CLI, core logic, and providers are decoupled
806
+ - **Type Safety** - Comprehensive TypeScript with Zod validation
807
+ - **Testability** - Dependency injection and mocking support
808
+ - **Extensibility** - Plugin architecture for new providers
809
+ - **Configuration First** - Unified config system with profiles
398
810
 
399
811
  ## ๐Ÿš€ Roadmap
400
812
 
401
- ### Q4 2024
813
+ ### โœ… Completed (2024-2025)
814
+
815
+ **Core Platform & Architecture:**
402
816
  - โœ… Enhanced terminal UI and visualization
403
817
  - โœ… AI-powered anomaly detection
404
818
  - โœ… Comprehensive PDF reporting
405
819
  - โœ… 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
820
+ - โœ… GitHub Actions integration
821
+ - โœ… npm and Homebrew distribution
822
+ - โœ… **Phase 1: Clean Architecture Restructuring (v1.0)**
823
+ - Subcommand-based CLI architecture
824
+ - Unified configuration system with profiles
825
+ - Automatic cloud profile discovery
826
+ - Structured logging with audit trails
827
+ - AWS Organizations support (Issue #10 โœ…)
828
+ - Cost allocation and chargeback reporting (Issue #30 โœ…)
829
+ - Configuration file support (Issue #29 โœ…)
830
+ - Caching layer for performance (Issue #28 โœ…)
831
+ - IAM Roles and environment variables auth (Issues #12, #13 โœ…)
832
+ - AWS SSO login support (Issue #9 โœ…)
833
+
834
+ **Multi-Cloud Foundation:**
835
+ - โœ… Multi-cloud provider architecture (Issue #20 - foundation)
836
+ - AWS provider fully implemented
837
+ - GCP, Azure, Alibaba Cloud, Oracle Cloud - architecture ready
838
+
839
+ ### Q1 2026 (Current - In Progress)
840
+
841
+ **Priority: Multi-Cloud Expansion**
842
+ - โœ… **Google Cloud Platform support - COMPLETE** (Issue #66)
843
+ - โœ… Provider implementation with BigQuery billing export
844
+ - โœ… GCP authentication (service account, ADC)
845
+ - โœ… Multi-project support with parallel retrieval
846
+ - โœ… Multi-currency cost aggregation
847
+ - โœ… Cost breakdown by service and time period
848
+ - โœ… Resource inventory (GCE, Storage, SQL, GKE)
849
+ - โœ… Budget tracking and alerts
850
+ - โœ… Organization-level cost aggregation
851
+ - โœ… Comprehensive documentation and examples
852
+ - โœ… 65 unit tests passing (100% coverage)
853
+ - ๐Ÿ“‹ **Advanced forecasting models** (No GitHub issue)
854
+ - ML-based cost predictions
855
+ - Seasonal trend analysis
856
+ - Budget recommendations
857
+ - ๐Ÿ“‹ **Enhanced analytics** (No GitHub issue)
858
+ - Advanced cost attribution
859
+ - Custom tagging strategies
860
+ - Cost optimization scoring
861
+
862
+ ### Q2 2026 (Planned)
863
+
864
+ **Priority: Complete Multi-Cloud & Automation**
865
+ - ๐Ÿ”ฎ **Microsoft Azure integration** (Issue #20 - partial)
866
+ - Azure Cost Management API
867
+ - Subscription and resource group support
868
+ - Azure-specific recommendations
869
+ - ๐Ÿ”ฎ **Alibaba Cloud support** (Issue #20 - partial)
870
+ - Alibaba Cloud Cost API integration
871
+ - Multi-region support
872
+ - ๐Ÿ”ฎ **Oracle Cloud support** (Issue #20 - partial)
873
+ - OCI Cost Management integration
874
+ - Compartment-based analysis
875
+ - ๐Ÿ“‹ **Advanced automation engine** (No GitHub issue)
876
+ - Automated cost optimization actions
877
+ - Policy-based automation
878
+ - Approval workflows
879
+ - Related: Issue #42 (Scheduled Reports), Issue #49 (API Server)
880
+
881
+ ### Q3 2026 (Planned)
882
+
883
+ **Priority: Enterprise Features**
884
+ - โœ…/๐Ÿšง **Enterprise SSO integration**
885
+ - AWS SSO: โœ… Completed (Issue #9)
886
+ - SAML/OAuth support: ๐Ÿ”ฒ Planned (Issue #52)
887
+ - Azure AD, Okta, Auth0 integration: ๐Ÿ”ฒ Planned
888
+ - Role-based access control (RBAC): ๐Ÿ”ฒ Planned (Issue #50)
889
+ - ๐Ÿ“‹ **Custom plugin system** (No GitHub issue)
890
+ - Plugin SDK
891
+ - Custom provider support
892
+ - Third-party integrations
893
+ - ๐Ÿ“‹ **Mobile app companion** (No GitHub issue)
894
+ - iOS and Android apps
895
+ - Real-time cost alerts
896
+ - Executive dashboards on mobile
897
+
898
+ ### Future Vision
899
+
900
+ **FinOps & Intelligence:**
901
+ - ๐Ÿ“‹ **Sustainability tracking expansion** (No GitHub issue)
902
+ - Carbon footprint tracking
903
+ - Green cloud recommendations
904
+ - Renewable energy usage analytics
905
+ - ๐Ÿ”ฒ **FinOps best practices automation** (Issue #59 - partial)
906
+ - FinOps Scorecards implementation
907
+ - Automated best practices enforcement
908
+ - Team performance metrics
909
+ - ๐Ÿ”ฒ **AI-powered cost conversations** (Issue #44 - partial)
910
+ - Natural language cost queries
911
+ - ChatOps integration
912
+ - AI cost assistant
913
+
914
+ **Platform & Scale:**
915
+ - ๐Ÿ“‹ **Multi-tenant SaaS platform** (No GitHub issue)
916
+ - Organization management
917
+ - Team collaboration features
918
+ - Centralized cost governance
919
+ - ๐Ÿ”ฒ **Additional integrations** (Various open issues)
920
+ - Microsoft Teams (Issue #45)
921
+ - PagerDuty/OpsGenie (Issue #48)
922
+ - Terraform cost preview (Issue #47)
923
+ - API Server mode (Issue #49)
924
+ - Multi-cloud dashboard (Issue #62)
925
+ - Web-based dashboards (Issue #60)
926
+
927
+ **Legend:**
928
+ - โœ… Completed
929
+ - ๐Ÿšง In Progress
930
+ - ๐Ÿ”ฎ Planned (this quarter)
931
+ - ๐Ÿ”ฒ Open GitHub Issue
932
+ - ๐Ÿ“‹ Not yet tracked in GitHub issues
419
933
 
420
934
  ## ๐Ÿ“‹ Requirements & Permissions
421
935
 
@@ -449,6 +963,8 @@ src/
449
963
 
450
964
  ## ๐Ÿงช Development
451
965
 
966
+ > ๐Ÿ“š **Developer Resources**: See the [`docs/`](./docs) folder for comprehensive technical documentation including architecture guides, testing reports, and release procedures.
967
+
452
968
  ### Local Development Setup
453
969
  ```bash
454
970
  # Clone repository
@@ -551,6 +1067,28 @@ For enterprise deployments, custom integrations, and professional support:
551
1067
  - ๐ŸŽจ Custom branding and whitelabeling
552
1068
  - ๐Ÿ—๏ธ Professional services and consulting
553
1069
 
1070
+ ## ๐Ÿ“š Documentation
1071
+
1072
+ ### ๐Ÿ“– User Documentation
1073
+ - **[README.md](./README.md)** - Main project documentation (you are here)
1074
+ - **[CHANGELOG.md](./CHANGELOG.md)** - Version history and release notes
1075
+ - **[CONTRIBUTING.md](./CONTRIBUTING.md)** - Contribution guidelines
1076
+
1077
+ ### ๐Ÿ”ง Developer Documentation
1078
+ Comprehensive technical documentation is available in the [`docs/`](./docs) folder:
1079
+
1080
+ - **[docs/RELEASE_SUMMARY.md](./docs/RELEASE_SUMMARY.md)** - Complete release guide for GitHub, npm, and Homebrew
1081
+ - **[docs/PRODUCTION_READINESS.md](./docs/PRODUCTION_READINESS.md)** - Production readiness assessment and checklist
1082
+ - **[docs/TEST_RESULTS.md](./docs/TEST_RESULTS.md)** - Comprehensive test results and analysis
1083
+ - **[docs/NPM_PUBLISHING.md](./docs/NPM_PUBLISHING.md)** - npm publishing workflow and best practices
1084
+ - **[docs/HOMEBREW_SETUP.md](./docs/HOMEBREW_SETUP.md)** - Homebrew formula creation guide
1085
+ - **[docs/code_flow.md](./docs/code_flow.md)** - Codebase architecture and flow
1086
+ - **[docs/infra_cost_cli.md](./docs/infra_cost_cli.md)** - CLI implementation details
1087
+ - **[docs/MULTI-CLOUD-INVENTORY.md](./docs/MULTI-CLOUD-INVENTORY.md)** - Multi-cloud features
1088
+ - **[docs/ENHANCED-FEATURES.md](./docs/ENHANCED-FEATURES.md)** - Advanced capabilities
1089
+
1090
+ See [docs/README.md](./docs/README.md) for the complete documentation index.
1091
+
554
1092
  ## ๐Ÿ“„ License
555
1093
 
556
1094
  MIT ยฉ [Code Collab](https://github.com/codecollab-co)
@@ -559,7 +1097,27 @@ MIT ยฉ [Code Collab](https://github.com/codecollab-co)
559
1097
 
560
1098
  ## ๐Ÿ”„ Changelog
561
1099
 
562
- ### v0.3.0 - Latest Release
1100
+ ### v1.0.0 - Major Release (Phase 1: Clean Architecture) ๐ŸŽ‰
1101
+ - โœ… **Subcommand-Based CLI** - New organized command structure
1102
+ - `cost` - Cost analysis and trends
1103
+ - `optimize` - Optimization recommendations
1104
+ - `monitor` - Alerts and monitoring
1105
+ - `export` - Data export in multiple formats
1106
+ - `organizations` - AWS Organizations support
1107
+ - `chargeback` - Cost allocation and reporting
1108
+ - `config` - Configuration management
1109
+ - `dashboard` - Interactive dashboards
1110
+ - โœ… **Unified Configuration System** - Single config file with profiles
1111
+ - โœ… **Profile Discovery** - Auto-detect cloud provider profiles
1112
+ - โœ… **Clean Architecture** - Separation of CLI, core, and providers
1113
+ - โœ… **Enhanced Logging** - Structured logging with multiple outputs
1114
+ - โœ… **Migration Tool** - Automated migration from v0.x (`infra-cost config migrate`)
1115
+ - โœ… **Improved Error Handling** - Better error messages and validation
1116
+ - โœ… **TypeScript Improvements** - Full type safety with Zod schemas
1117
+
1118
+ **Breaking Changes:** See [MIGRATION_GUIDE.md](./MIGRATION_GUIDE.md) for upgrading from v0.x
1119
+
1120
+ ### v0.3.0
563
1121
  - โœ… **GitHub Marketplace Action** - Integrate cost analysis into CI/CD workflows
564
1122
  - โœ… **Node.js 20+ support** - Updated runtime requirements
565
1123
  - โœ… **Sprint 6 UX improvements** - Enhanced user experience
@@ -579,8 +1137,8 @@ MIT ยฉ [Code Collab](https://github.com/codecollab-co)
579
1137
  - โœ… **Multi-cloud architecture** ready for expansion
580
1138
  - โœ… **Enterprise features** including multi-tenancy and API server
581
1139
 
582
- ### Migration from aws-cost-cli
583
- This tool evolved from `aws-cost-cli` with full backward compatibility. Both `infra-cost` and `aws-cost` commands work seamlessly.
1140
+ ### Migration from v0.x
1141
+ See the comprehensive [MIGRATION_GUIDE.md](./MIGRATION_GUIDE.md) for step-by-step instructions on migrating from v0.x to v1.0.
584
1142
 
585
1143
  ---
586
1144