Multi-cloud FinOps CLI tool for comprehensive cost analysis and infrastructure optimization
Take control of your cloud costs across AWS, Google Cloud, Azure, Alibaba Cloud, and Oracle Cloud π
Installation β’ Quick Start β’ Features β’ Documentation β’ Contributing
β¨ What's New in v1.11.0
Advanced Cost Analysis & Security Fixes
- π Cost Forecasting: Predict 1-12 months ahead with 4 statistical models (linear, exponential, seasonal, auto)
- π Multi-Cloud Comparison: Compare costs across AWS, GCP, Azure, Oracle, Alibaba with service-level breakdowns
- π Cost Trends: Analyze spending patterns with ASCII visualization and volatility detection
- π Security Hardening: CORS restrictions, API key auth by default, memory leak fixes
- β‘ Performance: Async file operations, automatic cache cleanup, 85% faster responses
See CHANGELOG.md for complete release notes.
Save money. Optimize resources. Make informed decisions.
- πΈ Reduce cloud spend by up to 30% with actionable insights
- π Multi-cloud visibility - see costs across all your providers in one place
- β‘ Real-time analysis - get instant cost breakdowns and trends
- π€ AI-powered recommendations for optimization opportunities
- π Executive reports - beautiful PDF reports for stakeholders
- π Smart alerting - proactive cost anomaly detection
- π¬ Team collaboration - Slack integration for cost awareness
- AWS β Full support with Cost Explorer integration
- Google Cloud β BigQuery billing export, multi-project support
- Microsoft Azure π§ Architecture ready, coming soon
- Alibaba Cloud π§ Architecture ready, coming soon
- Oracle Cloud π§ Architecture ready, coming soon
- Cost Forecasting - 1-12 month predictions with confidence intervals
- Multi-Cloud Comparison - Side-by-side cost analysis across providers
- Cost Trends - Historical analysis with visualization
- Budget Monitoring - Track against budgets with smart alerts
- Resource Rightsizing - ML recommendations for optimal instance sizes
- Anomaly Detection - AI-powered cost spike identification
- Interactive Dashboards - Rich terminal UI with real-time data
- Terraform Cost Preview - Estimate costs before deployment
- Git Cost History - Correlate cost changes with commits
- IaC Annotations - Add cost comments to Terraform/CloudFormation files
- AWS Organizations - Multi-account cost management
- CI/CD Integration - GitHub Actions, Jenkins, GitLab CI
- Multiple output formats: Fancy tables, plain text, JSON, CSV, Excel
- Flexible authentication: Environment variables, IAM roles, profiles
- Zero-config quick commands:
infra-cost nowfor instant cost checks - API Server: REST endpoints for custom integrations
- Webhook Support: Real-time notifications and integrations
npm install -g infra-costbrew tap codecollab-co/tap
brew install infra-costnpx infra-costdocker run --rm codecollab-co/infra-cost --help- uses: codecollab-co/infra-cost@v1.11.0
with:
provider: aws
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}# Zero-config daily cost check
infra-cost now
# Output: Today's Cost: $45.23 (+$3.12 from yesterday)
# Top Services: EC2 $22.10 | RDS $15.30 | S3 $4.20# Analyze costs with default AWS credentials
infra-cost cost analyze
# Show cost trends over time
infra-cost cost trends --period 30d
# Get cost forecast
infra-cost cost forecast --months 3# Analyze GCP costs
infra-cost cost analyze \
--provider gcp \
--project-id my-project \
--key-file /path/to/service-account.json# Compare costs across providers
infra-cost cost compare --providers aws,gcp,azure# Get optimization recommendations
infra-cost optimize recommendations
# Check cost alerts and budgets
infra-cost monitor alerts
infra-cost monitor budgetsEnvironment Variables (Recommended)
export AWS_ACCESS_KEY_ID=your_access_key
export AWS_SECRET_ACCESS_KEY=your_secret_key
export AWS_REGION=us-east-1
infra-cost cost analyzeAWS Profiles
infra-cost cost analyze --profile productionIAM Roles / AWS SSO
# Automatically uses attached IAM role
infra-cost cost analyze
# Or use AWS SSO
aws sso login --profile my-sso-profile
infra-cost cost analyze --profile my-sso-profileService Account (Recommended)
export GOOGLE_PROJECT_ID=your-project-id
export GOOGLE_APPLICATION_CREDENTIALS=/path/to/service-account-key.json
infra-cost cost analyze --provider gcpApplication Default Credentials
gcloud auth application-default login
infra-cost cost analyze --provider gcp --project-id your-project-idGCP Permissions Required:
resourcemanager.projects.getbigquery.jobs.createbigquery.tables.getData
Setup BigQuery Billing Export:
- Go to GCP Billing Console
- Enable "BigQuery export"
- Wait 24 hours for initial data
infra-cost uses a modern subcommand-based architecture. Here's a quick overview:
infra-cost now- Instant daily cost check (zero config)infra-cost free-tier- AWS Free Tier usage trackerinfra-cost annotate- Add cost comments to IaC filesinfra-cost history- Git cost history and blame analysis
Cost Analysis - See detailed docs
cost analyze- Comprehensive cost analysiscost forecast- Predict future costs (1-12 months)cost compare- Multi-cloud cost comparisoncost trends- Historical cost trend analysis
Optimization - See detailed docs
optimize recommendations- AI-powered optimization suggestionsoptimize quickwins- Find immediate savings opportunitiesoptimize rightsizing- Instance rightsizing recommendationsoptimize cross-cloud- Cross-cloud optimization analysis
Monitoring & Alerts - See detailed docs
monitor alerts- Check cost alertsmonitor budgets- Monitor budget statusmonitor watch- Real-time cost monitoringmonitor anomaly- Detect cost anomalies
Export & Reports - See detailed docs
export inventory json|csv|xlsx|pdf- Export resource inventorychargeback report- Generate chargeback reportschargeback slack- Send reports to Slack
AWS Organizations - See detailed docs
organizations list- List all accountsorganizations summary- Organization-wide cost summaryorganizations daily- Daily costs for all accounts
Configuration
config init- Initialize configurationconfig show- Show current configurationconfig validate- Validate configurationconfig migrate- Migrate from v0.x
Interactive Dashboards
dashboard interactive- Launch interactive TUI dashboarddashboard multicloud- Multi-cloud dashboard
Terraform Integration - See detailed docs
terraform --plan <file>- Estimate costs before deployment
Get help for any command:
infra-cost --help
infra-cost cost --help
infra-cost cost analyze --helpinfra-cost v1.0+ uses a clean architecture with:
- Subcommand Architecture - Domain-organized, discoverable commands
- Provider Pattern - Pluggable cloud provider implementations
- Type Safety - Comprehensive TypeScript with Zod validation
- Configuration First - Unified config system with profiles
- Clean Separation - CLI, core logic, and providers are decoupled
See docs/code_flow.md for architecture details.
name: Cost Analysis
on: [pull_request]
jobs:
cost-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: codecollab-co/infra-cost@v1.11.0
with:
provider: aws
command: now
comment-on-pr: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}- name: Terraform Cost Preview
uses: codecollab-co/infra-cost@v1.11.0
with:
command: terraform
additional-args: '--plan tfplan --threshold 20'See docs/commands/CI_CD.md for more examples.
infra-cost cost analyze --output fancyinfra-cost dashboard interactiveReal-time cost monitoring with keyboard navigation, multiple views (Services, Resources, Trends, Alerts), and auto-refresh.
- Installation Guide - Detailed installation instructions
- Quick Start Guide - Get started in 5 minutes
- Command Reference - Detailed command documentation
- Authentication Guide - AWS, GCP, Azure auth setup
- CHANGELOG.md - Version history and release notes
- MIGRATION_GUIDE.md - Migrate from v0.x to v1.0
- Architecture Guide - Codebase structure and design
- Contributing Guide - How to contribute
- Testing Guide - Test results and coverage
- Release Guide - Release procedures
See docs/README.md for complete documentation index.
# Clone and setup
git clone https://github.com/codecollab-co/infra-cost.git
cd infra-cost
npm install
# Build and test
npm run build
npm test
# Type checking and linting
npm run typecheck
npm run lint
# Run locally
npm run devSee docs/DEVELOPMENT.md for detailed development guide.
We welcome contributions! Here's how you can help:
- β Star this repository to show your support
- π Report bugs via GitHub Issues
- π‘ Suggest features via GitHub Discussions
- π Improve documentation - help others understand the tool
- π§ Add cloud provider support - help us expand to more providers
- π§ͺ Write tests - improve code quality
See CONTRIBUTING.md for detailed guidelines.
- π Documentation: docs.codecollab.co/infra-cost (coming soon)
- π Bug Reports: GitHub Issues
- π‘ Feature Requests: GitHub Discussions
- π§ Email: support@codecollab.co
For enterprise deployments, custom integrations, and professional support:
- π§ Contact: enterprise@codecollab.co
- π SLA-backed support available
- π¨ Custom branding and whitelabeling
- ποΈ Professional services and consulting
- β AWS full support with Organizations
- β Google Cloud Platform support
- β Cost forecasting (4 statistical models)
- β Multi-cloud cost comparison
- β Interactive TUI dashboard
- β Terraform cost preview
- β GitHub Actions integration
- β Git cost history & blame
- β IaC file annotations
- π§ Microsoft Azure integration
- π§ Alibaba Cloud support
- π§ Oracle Cloud support
- π VS Code extension
- π Enhanced forecasting models
- π Advanced automation engine
- Carbon footprint tracking
- Multi-tenant SaaS platform
- Mobile app companion
- Natural language queries
- FinOps best practices automation
See full roadmap for detailed timeline.
{
"Version": "2012-10-17",
"Statement": [{
"Effect": "Allow",
"Action": [
"iam:ListAccountAliases",
"ce:GetCostAndUsage",
"ce:GetRightsizingRecommendation",
"budgets:ViewBudget",
"sts:GetCallerIdentity"
],
"Resource": "*"
}]
}- Node.js 20+ (required)
- Memory: 512MB+ available
- Network: Internet access for cloud provider APIs
MIT Β© Code Collab
Made with β€οΈ by Code Collab
Empowering teams to optimize cloud costs and build sustainable infrastructure
β Star us on GitHub β’ π¦ Follow on Twitter β’ πΌ LinkedIn
