{"id":27428131,"url":"https://github.com/codecollab-co/infra-cost","last_synced_at":"2026-01-25T23:18:01.905Z","repository":{"id":286556938,"uuid":"953051652","full_name":"codecollab-co/infra-cost","owner":"codecollab-co","description":"CLI tool to perform cost analysis on your infrastructure account with Slack integration.","archived":false,"fork":false,"pushed_at":"2025-04-07T07:00:23.000Z","size":35328,"stargazers_count":0,"open_issues_count":9,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-04-07T07:22:40.259Z","etag":null,"topics":["aws","aws-cost","aws-cost-explorer","azure","azure-cost","gcp","gcp-cost-report","github-actions"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/codecollab-co.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-03-22T13:09:53.000Z","updated_at":"2025-04-07T07:00:27.000Z","dependencies_parsed_at":"2025-04-07T07:33:08.359Z","dependency_job_id":null,"html_url":"https://github.com/codecollab-co/infra-cost","commit_stats":null,"previous_names":["codecollab-co/infra-cost"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codecollab-co%2Finfra-cost","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codecollab-co%2Finfra-cost/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codecollab-co%2Finfra-cost/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codecollab-co%2Finfra-cost/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/codecollab-co","download_url":"https://codeload.github.com/codecollab-co/infra-cost/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248887348,"owners_count":21177857,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aws","aws-cost","aws-cost-explorer","azure","azure-cost","gcp","gcp-cost-report","github-actions"],"created_at":"2025-04-14T13:25:02.560Z","updated_at":"2026-01-25T23:18:01.893Z","avatar_url":"https://github.com/codecollab-co.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 💰 infra-cost\n\n\u003cdiv align=\"center\"\u003e\n\n**Multi-cloud FinOps CLI tool for comprehensive cost analysis and infrastructure optimization**\n\n[![npm version](https://badge.fury.io/js/infra-cost.svg)](https://badge.fury.io/js/infra-cost)\n[![Downloads](https://img.shields.io/npm/dm/infra-cost.svg)](https://npmjs.org/package/infra-cost)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n[![GitHub issues](https://img.shields.io/github/issues/codecollab-co/infra-cost)](https://github.com/codecollab-co/infra-cost/issues)\n[![GitHub stars](https://img.shields.io/github/stars/codecollab-co/infra-cost)](https://github.com/codecollab-co/infra-cost/stargazers)\n\n*Take control of your cloud costs across AWS, Google Cloud, Azure, Alibaba Cloud, and Oracle Cloud* 🚀\n\n[Installation](#-installation) • [Quick Start](#-quick-start) • [Features](#-features) • [Documentation](#-documentation) • [Contributing](#-contributing)\n\n\u003c/div\u003e\n\n---\n\n## 🎯 Why infra-cost?\n\n**Save money. Optimize resources. Make informed decisions.**\n\n- 💸 **Reduce cloud spend** by up to 30% with actionable insights\n- 🔍 **Multi-cloud visibility** - see costs across all your providers in one place\n- ⚡ **Real-time analysis** - get instant cost breakdowns and trends\n- 🤖 **AI-powered recommendations** for optimization opportunities\n- 📊 **Executive reports** - beautiful PDF reports for stakeholders\n- 🔔 **Smart alerting** - proactive cost anomaly detection\n- 💬 **Team collaboration** - Slack integration for cost awareness\n\n## 🚀 Features\n\n### 🌐 **Multi-Cloud Support**\n- **AWS** ✅ (Full support with Cost Explorer integration)\n- **Google Cloud** 🚧 (Architecture ready, coming soon)\n- **Microsoft Azure** 🚧 (Architecture ready, coming soon)\n- **Alibaba Cloud** 🚧 (Architecture ready, coming soon)\n- **Oracle Cloud** 🚧 (Architecture ready, coming soon)\n\n### 📊 **Comprehensive Analytics**\n- **Cost Forecasting** - AI-powered predictions for future spending\n- **Budget Monitoring** - Track against budgets with smart alerts\n- **Resource Rightsizing** - ML recommendations for optimal instance sizes\n- **Sustainability Analysis** - Carbon footprint tracking and green recommendations\n- **Security Cost Analysis** - Security posture vs. cost optimization\n- **Anomaly Detection** - AI-powered cost spike identification\n\n### 🎛️ **Advanced Features**\n- **Interactive Dashboards** - Rich terminal UI with real-time data\n- **PDF Report Generation** - Executive summaries and technical deep-dives\n- **Cross-Cloud Optimization** - Find the best provider for each workload\n- **Automated Optimization** - Execute cost-saving actions automatically\n- **Audit Logging** - Comprehensive compliance tracking\n- **Enterprise Multi-tenancy** - Team and organization management\n\n### 🔧 **Developer Experience**\n- **Multiple output formats**: Fancy tables, plain text, JSON, CSV, Excel\n- **Flexible authentication**: Environment variables, IAM roles, profiles\n- **CI/CD Integration**: GitHub Actions, Jenkins, GitLab CI\n- **API Server**: REST endpoints for custom integrations\n- **Webhook Support**: Real-time notifications and integrations\n\n## 📦 Installation\n\n### npm (Recommended)\n```bash\nnpm install -g infra-cost\n```\n\n### Homebrew (macOS/Linux)\n```bash\nbrew tap codecollab-co/tap\nbrew install infra-cost\n```\n\n### npx (No installation required)\n```bash\nnpx infra-cost\n```\n\n### Docker\n```bash\ndocker run --rm codecollab-co/infra-cost --help\n```\n\n### GitHub Action\n```yaml\n- uses: codecollab-co/infra-cost@v0.3.0\n  with:\n    provider: aws\n    aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}\n    aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}\n```\n\n## 🎯 Quick Start\n\n### 1. Basic AWS Cost Analysis\n```bash\n# Using default AWS credentials\ninfra-cost\n\n# Get a 6-month cost trend with forecasting\ninfra-cost --trend --forecast 30\n\n# Interactive multi-cloud dashboard\ninfra-cost --multi-cloud-dashboard\n```\n\n### 2. Advanced Analysis\n```bash\n# Generate executive PDF report\ninfra-cost --executive-summary --pdf-report quarterly-report.pdf\n\n# AI-powered anomaly detection\ninfra-cost --anomaly-detect --anomaly-realtime\n\n# Comprehensive sustainability analysis\ninfra-cost --sustainability --carbon-footprint --green-recommendations\n```\n\n### 3. Team Collaboration\n```bash\n# Send daily cost report to Slack\ninfra-cost --slack-token YOUR_TOKEN --slack-channel \"#finops\" --smart-alerts\n\n# Start real-time cost monitoring\ninfra-cost --monitor --alert-threshold 1000 --alert-channel slack\n```\n\n## 🔐 Authentication\n\n### AWS Authentication (Multiple Methods)\n\n#### 1. Environment Variables (Recommended)\n```bash\nexport AWS_ACCESS_KEY_ID=your_access_key\nexport AWS_SECRET_ACCESS_KEY=your_secret_key\nexport AWS_REGION=us-east-1\ninfra-cost\n```\n\n#### 2. AWS Profiles\n```bash\n# Use default profile\ninfra-cost\n\n# Use specific profile\ninfra-cost --profile production\n\n# Auto-discover profiles\ninfra-cost --discover-profiles --auto-profile\n```\n\n#### 3. IAM Roles (EC2/Lambda/ECS)\n```bash\n# Automatically uses attached IAM role\ninfra-cost\n```\n\n#### 4. AWS SSO\n```bash\naws sso login --profile my-sso-profile\ninfra-cost --profile my-sso-profile\n```\n\n### Multi-Cloud Setup (Coming Soon)\n```bash\n# Google Cloud Platform\ninfra-cost --provider gcp --project-id my-project --key-file service-account.json\n\n# Microsoft Azure\ninfra-cost --provider azure --subscription-id sub-id --tenant-id tenant-id\n\n# Cross-cloud comparison\ninfra-cost --compare-clouds aws,gcp,azure --optimization-report\n```\n\n## 📊 Output Examples\n\n### Default Rich Terminal UI\n```bash\ninfra-cost --smart-alerts --compact\n```\n![Cost Analysis](./.github/images/aws-cost.png)\n\n### Executive Dashboard\n```bash\ninfra-cost --executive-summary\n```\n![Executive Summary](./.github/images/executive-dashboard.png)\n\n### JSON for Automation\n```bash\ninfra-cost --json --forecast 30 --analytics-insights\n```\n\n### PDF Reports\n```bash\ninfra-cost --pdf-report monthly-report.pdf --trend --optimization-tips\n```\n\n## 💬 Slack Integration\n\n### Enhanced Team Collaboration\n- **Rich cost breakdowns** with visual charts\n- **Proactive alerts** for budget overruns and anomalies\n- **Automated workflows** for approval processes\n- **Team cost awareness** with regular updates\n\n### Setup \u0026 Usage\n```bash\n# Create Slack app with chat:write permissions\n# Get OAuth token and channel ID\n\n# Send cost report\ninfra-cost --slack-token xoxb-your-token --slack-channel \"#finops\"\n\n# Enable smart alerts\ninfra-cost --slack-token xoxb-your-token --slack-channel \"#alerts\" --smart-alerts\n```\n\n### Automated Daily Reports\n```yaml\nname: Daily FinOps Report\non:\n  schedule:\n    - cron: '0 9 * * 1-5'  # Weekdays 9 AM UTC\njobs:\n  cost-report:\n    runs-on: ubuntu-latest\n    steps:\n      - run: |\n          npx infra-cost \\\n            --executive-summary \\\n            --slack-token ${{ secrets.SLACK_TOKEN }} \\\n            --slack-channel ${{ secrets.SLACK_CHANNEL }} \\\n            --smart-alerts --trends 7\n```\n\n## 🤖 GitHub Actions Integration\n\n**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.\n\n### Basic Usage\n```yaml\nname: Cost Analysis\non: [push, pull_request]\n\njobs:\n  analyze:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: codecollab-co/infra-cost@v0.3.0\n        with:\n          provider: aws\n          aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}\n          aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}\n          analysis-type: summary\n```\n\n### PR Cost Check with Comments\n```yaml\nname: PR Cost Check\non:\n  pull_request:\n    branches: [main]\n\njobs:\n  cost-check:\n    runs-on: ubuntu-latest\n    permissions:\n      pull-requests: write\n    steps:\n      - uses: codecollab-co/infra-cost@v0.3.0\n        with:\n          provider: aws\n          aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}\n          aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}\n          analysis-type: delta\n          delta-threshold: '10'\n          comment-on-pr: 'true'\n```\n\n### Daily Cost Report to Slack\n```yaml\nname: Daily Cost Report\non:\n  schedule:\n    - cron: '0 9 * * *'\n\njobs:\n  report:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: codecollab-co/infra-cost@v0.3.0\n        with:\n          provider: aws\n          aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}\n          aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}\n          analysis-type: finops\n          slack-webhook: ${{ secrets.SLACK_WEBHOOK }}\n```\n\n### Action Inputs\n\n| Input | Description | Default |\n|-------|-------------|---------|\n| `provider` | Cloud provider (aws, gcp, azure, alicloud, oracle) | `aws` |\n| `profile` | Cloud provider profile | `default` |\n| `region` | Cloud provider region | `us-east-1` |\n| `aws-access-key-id` | AWS Access Key ID | - |\n| `aws-secret-access-key` | AWS Secret Access Key | - |\n| `analysis-type` | Type of analysis (summary, detailed, delta, forecast, anomaly, finops, audit) | `summary` |\n| `forecast-days` | Days for forecast | `30` |\n| `delta-threshold` | Alert threshold for cost changes (%) | `10` |\n| `output-format` | Output format (text, json) | `text` |\n| `slack-webhook` | Slack webhook URL | - |\n| `comment-on-pr` | Post analysis as PR comment | `false` |\n| `fail-on-threshold` | Fail if costs exceed threshold | `false` |\n\n### Action Outputs\n\n| Output | Description |\n|--------|-------------|\n| `total-cost` | Total cost for the analysis period |\n| `cost-change` | Cost change percentage |\n| `forecast-cost` | Forecasted cost |\n| `anomalies-detected` | Number of anomalies detected |\n| `report-json` | Full report in JSON format |\n\nSee [example workflows](.github/workflows/examples/) for more use cases.\n\n## 🔧 Advanced Usage\n\n### Cost Forecasting \u0026 Analytics\n```bash\n# AI-powered forecasting with multiple models\ninfra-cost --forecast 90 --forecast-model AUTO --forecast-confidence 95\n\n# Business intelligence insights\ninfra-cost --analytics --analytics-insights --analytics-drivers\n\n# Custom dashboards\ninfra-cost --dashboard-create \"Monthly Review\" --chart-create \"line:Cost Trends\"\n```\n\n### Optimization \u0026 Automation\n```bash\n# Generate optimization recommendations\ninfra-cost --finops --optimization-tips --rightsize --sustainability\n\n# Automated optimization (dry-run first!)\ninfra-cost --optimize-dry-run --optimize-rules resize,schedule,unused\n\n# Cross-cloud cost comparison\ninfra-cost --compare-clouds aws,gcp --optimization-report\n```\n\n### Enterprise Features\n```bash\n# Multi-tenant management\ninfra-cost --enterprise --tenants --platform-metrics\n\n# API server for integrations\ninfra-cost --api-server --api-port 3000 --webhook-create\n\n# Comprehensive audit logging\ninfra-cost --audit --compliance-check soc2 --audit-export json\n```\n\n## 🏗️ Architecture \u0026 Extensibility\n\n### Multi-Cloud Provider Pattern\n```\nsrc/\n├── providers/\n│   ├── factory.ts      # Provider factory\n│   ├── aws.ts          # AWS implementation ✅\n│   ├── gcp.ts          # Google Cloud 🚧\n│   ├── azure.ts        # Azure 🚧\n│   ├── alicloud.ts     # Alibaba Cloud 🚧\n│   └── oracle.ts       # Oracle Cloud 🚧\n├── analytics/          # AI/ML cost analysis\n├── optimization/       # Cost optimization engines\n├── visualization/      # Dashboards \u0026 charts\n├── integrations/       # Third-party integrations\n└── enterprise/         # Multi-tenant features\n```\n\n### Key Design Principles\n- **Abstract provider interface** for consistent multi-cloud API\n- **Plugin architecture** for easy extensibility\n- **Type-safe implementation** with comprehensive TypeScript coverage\n- **Modular design** allowing feature composition\n- **Performance optimized** with efficient data processing\n\n## 🚀 Roadmap\n\n### Q4 2024\n- ✅ Enhanced terminal UI and visualization\n- ✅ AI-powered anomaly detection\n- ✅ Comprehensive PDF reporting\n- ✅ Advanced Slack integration\n- 🚧 Google Cloud Platform support\n\n### Q1 2025\n- 🔮 Microsoft Azure integration\n- 🔮 Advanced forecasting models\n- 🔮 Mobile app companion\n- 🔮 Sustainability tracking expansion\n\n### Q2 2025\n- 🔮 Alibaba Cloud \u0026 Oracle Cloud support\n- 🔮 Advanced automation engine\n- 🔮 Enterprise SSO integration\n- 🔮 Custom plugin system\n\n## 📋 Requirements \u0026 Permissions\n\n### AWS Permissions Required\n```json\n{\n  \"Version\": \"2012-10-17\",\n  \"Statement\": [\n    {\n      \"Sid\": \"InfraCostMinimalPermissions\",\n      \"Effect\": \"Allow\",\n      \"Action\": [\n        \"iam:ListAccountAliases\",\n        \"ce:GetCostAndUsage\",\n        \"ce:GetRightsizingRecommendation\",\n        \"ce:GetSavingsUtilization\",\n        \"budgets:ViewBudget\",\n        \"sts:GetCallerIdentity\"\n      ],\n      \"Resource\": \"*\"\n    }\n  ]\n}\n```\n\n### System Requirements\n- Node.js 20+ (required)\n- Memory: 512MB+ available\n- Network: Internet access for cloud provider APIs\n- Optional: Docker for containerized deployments\n\n## 🧪 Development\n\n### Local Development Setup\n```bash\n# Clone repository\ngit clone https://github.com/codecollab-co/infra-cost.git\ncd infra-cost\n\n# Install dependencies\nnpm install\n\n# Build project\nnpm run build\n\n# Run tests\nnpm test\n\n# Start development server\nnpm run dev\n```\n\n### Testing \u0026 Quality Assurance\n```bash\n# Type checking\nnpm run typecheck\n\n# Linting\nnpm run lint\n\n# Security audit\nnpm audit\n\n# Test coverage\nnpm run test:coverage\n```\n\n### Release Management\n```bash\n# Check current version status\nnpm run version:check\n\n# Bump version\nnpm run version:bump:patch   # Bug fixes\nnpm run version:bump:minor   # New features\nnpm run version:bump:major   # Breaking changes\n\n# Prepare release\nnpm run prepare-release\n```\n\n## 🤝 Contributing\n\nWe welcome contributions from the community! Here's how you can help:\n\n### 🌟 Ways to Contribute\n- **⭐ Star this repository** to show your support\n- **🐛 Report bugs** and suggest improvements via [issues](https://github.com/codecollab-co/infra-cost/issues)\n- **📝 Improve documentation** - help others understand and use the tool\n- **🔧 Add cloud provider support** - help us expand to more providers\n- **🧪 Write tests** - improve code quality and reliability\n- **💡 Suggest features** - share your ideas for new capabilities\n\n### 🚀 Getting Started with Contributing\n1. **Fork** the repository\n2. **Clone** your fork: `git clone https://github.com/YOUR_USERNAME/infra-cost.git`\n3. **Create a branch**: `git checkout -b feature/amazing-feature`\n4. **Make changes** and write tests\n5. **Run quality checks**: `npm run typecheck \u0026\u0026 npm run lint \u0026\u0026 npm test`\n6. **Commit**: `git commit -m \"Add amazing feature\"`\n7. **Push**: `git push origin feature/amazing-feature`\n8. **Create a Pull Request**\n\n### 📋 Contribution Guidelines\n- Follow the existing code style and conventions\n- Add tests for new features\n- Update documentation as needed\n- Keep PRs focused on a single feature/fix\n- Be respectful and constructive in discussions\n\n### 🏷️ Good First Issues\nLook for issues labeled `good first issue` or `help wanted` to get started!\n\n## 📞 Support \u0026 Community\n\n### 💬 Get Help\n- **📚 Documentation**: [docs.codecollab.co/infra-cost](https://docs.codecollab.co/infra-cost) *(coming soon)*\n- **🐛 Bug Reports**: [GitHub Issues](https://github.com/codecollab-co/infra-cost/issues)\n- **💡 Feature Requests**: [GitHub Discussions](https://github.com/codecollab-co/infra-cost/discussions)\n- **📧 Email Support**: support@codecollab.co\n\n### 🌟 Show Your Support\nIf infra-cost helps you save money and optimize costs, please:\n- ⭐ **Star this repository**\n- 🐦 **Share on Twitter** with #InfraCost #FinOps\n- 📝 **Write a review** or blog post about your experience\n- 🤝 **Contribute** code, documentation, or feedback\n\n### 🏢 Enterprise Support\nFor enterprise deployments, custom integrations, and professional support:\n- 📧 Contact: enterprise@codecollab.co\n- 🔒 SLA-backed support available\n- 🎨 Custom branding and whitelabeling\n- 🏗️ Professional services and consulting\n\n## 📄 License\n\nMIT © [Code Collab](https://github.com/codecollab-co)\n\n---\n\n## 🔄 Changelog\n\n### v0.3.0 - Latest Release\n- ✅ **GitHub Marketplace Action** - Integrate cost analysis into CI/CD workflows\n- ✅ **Node.js 20+ support** - Updated runtime requirements\n- ✅ **Sprint 6 UX improvements** - Enhanced user experience\n- ✅ **Configuration improvements** - Better config resolution and file permissions\n- ✅ **Date normalization** - Consistent UTC date handling\n\n### v0.2.4\n- ✅ **Fixed CommonJS compatibility** - Homebrew installation now works perfectly\n- ✅ **Enhanced error handling** and user experience improvements\n- ✅ **Optimized build process** for better performance\n\n### v0.2.0 - Enhanced Features\n- ✅ **AI-powered anomaly detection** with real-time monitoring\n- ✅ **Advanced visualization engine** with interactive dashboards\n- ✅ **PDF report generation** for executives and technical teams\n- ✅ **Comprehensive Slack integration** with rich formatting\n- ✅ **Multi-cloud architecture** ready for expansion\n- ✅ **Enterprise features** including multi-tenancy and API server\n\n### Migration from aws-cost-cli\nThis tool evolved from `aws-cost-cli` with full backward compatibility. Both `infra-cost` and `aws-cost` commands work seamlessly.\n\n---\n\n\u003cdiv align=\"center\"\u003e\n\n**Made with ❤️ by [Code Collab](https://github.com/codecollab-co)**\n\n*Empowering teams to optimize cloud costs and build sustainable infrastructure*\n\n[⭐ 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)\n\n\u003c/div\u003e","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodecollab-co%2Finfra-cost","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodecollab-co%2Finfra-cost","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodecollab-co%2Finfra-cost/lists"}