npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

ai-cloud-doctor

v2.0.0

Published

AI powered AWS sanity checks for cost, Terraform diffs, Lambda tuning, and logs, using local stubs (no external dependencies).

Readme

ai-cloud-doctor

AI-powered AWS analysis CLI tool that provides cost optimization, Lambda tuning, log analysis, and Terraform plan reviews using OpenAI.

Features

  • Cost Analysis: AWS Cost Explorer integration with AI-powered optimization recommendations
  • Lambda Optimization: Performance analysis and tuning suggestions for Lambda functions
  • Log Analysis: CloudWatch logs analysis with natural language queries
  • Terraform Review: Security and best practices analysis for Terraform plans
  • IAM Analysis: Users, roles, groups, and policies security assessment
  • Trusted Advisor: AWS optimization recommendations and best practices
  • Security Hub: Security findings and compliance analysis
  • Token Tracking: Complete OpenAI usage tracking with separate input/output/cached token costs
  • Job History: Detailed logs of all analysis jobs with unique IDs

Installation

Option 1: Install from npm (Recommended)

npm install -g ai-cloud-doctor

Option 2: Install from source

git clone https://github.com/your-repo/ai-cloud-doctor
cd ai-cloud-doctor
npm install
npm run build
npm link  # Install globally as 'ai-cloud-doctor'

Configuration

Configure credentials and settings:

ai-cloud-doctor configure

Or manually create ~/.ai-cloud-doctor-configs.json:

{
  "openaiKey": "sk-your-openai-key",
  "model": "gpt-5-nano",
  "serviceTier": "flex",
  "maxTokens": 10000,
  "inputTokenCost": 0.15,
  "outputTokenCost": 0.6,
  "cachedTokenCost": 0.075,
  "reasoningEffort": "low",
  "temperature": 1.0,
  "verbosity": "low",
  "scanPeriod": 30,
  "region": "us-east-1",
  "awsCredentials": {
    "accessKeyId": "AKIA...",
    "secretAccessKey": "...",
    "sessionToken": "..."
  }
}

Usage

Full Analysis

ai-cloud-doctor scan --mode auto

Individual Analyzers

# Cost analysis - AWS Cost Explorer integration
ai-cloud-doctor cost --scanPeriod 7                              # Last 7 days cost analysis
ai-cloud-doctor cost --question "Which services cost the most?"   # Custom cost question
ai-cloud-doctor cost --region us-west-2 --scanPeriod 30          # Specific region, 30 days

# Lambda optimization - Performance and cost tuning
ai-cloud-doctor lambda --question "Find timeout issues"           # Identify timeout problems
ai-cloud-doctor lambda --question "Which functions have high memory usage?" # Memory optimization
ai-cloud-doctor lambda --scanPeriod 7 --question "Show cold start problems" # Cold start analysis

# Log analysis - CloudWatch logs with natural language
ai-cloud-doctor logs --question "Show error patterns"             # General error detection
ai-cloud-doctor logs --question "Find API Gateway 5xx errors"     # Specific service errors
ai-cloud-doctor logs --question "Show database connection issues" # Database troubleshooting

# Terraform review - Security and best practices
ai-cloud-doctor tf --tf-plan ./plan.json                         # Basic plan analysis
ai-cloud-doctor tf --tf-plan ./plan.json --question "Focus on security risks" # Security focus
ai-cloud-doctor tf --tf-plan ./plan.json --question "Check IAM permissions"   # IAM validation
ai-cloud-doctor tf --tf-plan ./plan.json --question "Validate network security" # Network security

# IAM analysis - Users, roles, and permissions audit
ai-cloud-doctor iam --question "Find overprivileged users"        # Permission audit
ai-cloud-doctor iam --question "Check for unused roles"           # Cleanup recommendations
ai-cloud-doctor iam --question "Analyze policy attachments"       # Policy analysis

# Trusted Advisor - AWS optimization recommendations
ai-cloud-doctor advisor --question "Focus on cost optimization"   # Cost savings focus
ai-cloud-doctor advisor --question "Show security recommendations" # Security improvements

# Security Hub - Security findings and compliance
ai-cloud-doctor security --question "Show critical findings"      # High-priority issues
ai-cloud-doctor security --question "Check compliance status"     # Compliance monitoring

Token Usage Tracking

ai-cloud-doctor usage

Shows detailed job history with separate token costs:

Job ID   Name              Model        Date        In     Out    Cached Total   Cost
-------- ----------------- ------------ ----------- ------ ------ ------ ------- --------
a1b2c3d4 cost-analysis     gpt-5-nano   1/15/2024     150     75      0     225  $0.0004

Output Format

All AI analysis uses structured sections:

Cost Analysis:

  • 🔍 ANALYSIS: Key findings and patterns
  • 📊 TOP COSTS: Highest cost services
  • 💡 RECOMMENDATIONS: Optimization suggestions
  • QUICK WINS: Immediate actions

Lambda Analysis:

  • ⚠️ PERFORMANCE ISSUES: Function optimization needs
  • ⚙️ OPTIMIZATIONS: Performance improvements
  • 💰 COST SAVINGS: Resource optimization
  • QUICK FIXES: Immediate improvements

IAM Analysis:

  • 🚨 SECURITY RISKS: Permission vulnerabilities
  • 🔑 ACCESS ISSUES: User/role problems
  • 💡 RECOMMENDATIONS: Security improvements
  • IMMEDIATE ACTIONS: Priority fixes

Security Hub:

  • 🚨 CRITICAL FINDINGS: High-priority security issues
  • 🔒 COMPLIANCE ISSUES: Standards violations
  • 🛡️ SECURITY RECOMMENDATIONS: Remediation steps
  • IMMEDIATE ACTIONS: Urgent security fixes

Files

  • ~/.ai-cloud-doctor-configs.json - Configuration and credentials
  • ~/.ai-cloud-doctor-jobs.json - Job execution logs and token usage

Modes

  • auto: Use AWS credentials if available, offline otherwise
  • live: Force AWS API calls (requires credentials)
  • offline: Skip AWS calls, provide stub analysis

Scan Periods

  • 1, 7, 30, 120, 365 days for cost and performance analysis

Requirements

  • Node.js 18+
  • AWS CLI configured (for live mode)
  • OpenAI API key
  • AWS credentials (for live analysis)

License

MIT License - see LICENSE file for details

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests if applicable
  5. Submit a pull request