README
ΒΆ
Ship CLI
CloudshipAI CLI - A powerful command-line tool that brings enterprise-grade infrastructure analysis tools to your fingertips, all running in containers without local installations.
π€ For LLMs and AI Assistants: Complete installation and usage instructions specifically designed for AI consumption are available at llms.txt. This includes MCP server setup, integration examples, and best practices for AI-driven infrastructure analysis.
π Features
- π Terraform Linting: Catch errors and enforce best practices with TFLint
- π‘οΈ Security Scanning: Multi-cloud security analysis with Checkov and Trivy
- π° Cost Estimation: Estimate infrastructure costs with Infracost and OpenInfraQuote
- π Documentation Generation: Auto-generate beautiful Terraform module documentation
- π Infrastructure Diagrams: Visualize your infrastructure with InfraMap integration
- π§ Reliable AI Infrastructure Investigation: 95%+ accurate natural language queries powered by Eino framework
- π Real-time Cloud Analysis: Investigate live AWS, Azure, and GCP resources with Steampipe
- π€ AI Assistant Integration: Built-in MCP server for Claude Desktop, Cursor, and other AI tools
- π Extensible Module System: Add custom tools and Dagger functions without modifying core CLI
- π³ Containerized Tools: All tools run in containers via Dagger - no local installations needed
- βοΈ Cloud Integration: Seamlessly works with AWS, Azure, GCP, and other cloud providers
- π§ CI/CD Ready: Perfect for integration into your existing pipelines
π Table of Contents
- Installation
- Quick Start
- Demo
- Available Tools
- Command Reference
- Authentication
- Using External Dagger Modules
- Contributing
- License
π¬ Demo
Terraform Tools in Action

This demo shows Ship CLI running terraform-docs, tflint, and security scanning on a Terraform module - all without any local tool installations!
OpenInfraQuote - Advanced Cost Analysis

OpenInfraQuote provides highly accurate AWS cost estimation by analyzing your Terraform plans against real AWS pricing data. It supports 100+ AWS resource types with region-specific pricing!
π¦ Installation
Quick Install with Go
# Install directly with Go
go install github.com/cloudshipai/ship/cmd/ship@latest
# Verify installation
ship version
From Source
# Clone the repository
git clone https://github.com/cloudshipai/ship.git
cd ship
# Build and install
go build -o ship ./cmd/ship
sudo mv ship /usr/local/bin/
# Or just run directly
go run ./cmd/ship [command]
π Quick Start
1. Basic Usage
# Navigate to your Terraform project
cd your-terraform-project
# Run a comprehensive analysis
ship terraform-tools lint # Check for errors and best practices
ship terraform-tools checkov-scan # Security scanning
ship terraform-tools cost-estimate # Estimate AWS/Azure/GCP costs
ship terraform-tools generate-docs # Generate documentation
2. Real-World Example
# Clone a sample Terraform project
git clone https://github.com/terraform-aws-modules/terraform-aws-vpc.git
cd terraform-aws-vpc/examples/simple
# Run all tools
ship terraform-tools lint
ship terraform-tools checkov-scan
ship terraform-tools security-scan
ship terraform-tools cost-estimate
ship terraform-tools generate-docs > README.md
ship terraform-tools generate-diagram . --hcl -o infrastructure.png
3. CloudShip Integration
Authenticate and push analysis results to CloudShip:
# Authenticate with CloudShip
ship auth --api-key YOUR_API_KEY
# Set your default fleet ID (optional)
export CLOUDSHIP_FLEET_ID=your-fleet-id
# Push results automatically to CloudShip
ship terraform-tools security-scan --push
ship terraform-tools cost-estimate --push --push-tags "production,aws"
# Or push manually
ship terraform-tools lint -o lint-results.json
ship push lint-results.json --type lint_results --fleet-id your-fleet-id
4. Generate Infrastructure Diagrams
Visualize your infrastructure with InfraMap integration:
# Generate diagram from Terraform files (no state file needed!)
ship terraform-tools generate-diagram . --hcl --format png -o infrastructure.png
# Generate from existing state file
ship terraform-tools generate-diagram terraform.tfstate -o current-state.png
# Generate SVG for web documentation
ship terraform-tools generate-diagram . --hcl --format svg -o architecture.svg
# Filter by provider (AWS only)
ship terraform-tools generate-diagram terraform.tfstate --provider aws -o aws-resources.png
# Show all resources without filtering (raw mode)
ship terraform-tools generate-diagram . --hcl --raw -o complete-diagram.png
# Real-world example
cd /path/to/your/terraform/project
ship terraform-tools generate-diagram . --hcl -o docs/infrastructure-diagram.png
5. AI-Powered Infrastructure Investigation (New & Improved!)
π Now powered by ByteDance's Eino framework for 95%+ accuracy (previously ~40%)
Ship CLI's new AI investigation system provides reliable, accurate infrastructure analysis using advanced natural language processing:
Reliable AI Investigation with Eino Framework
Query your live cloud infrastructure using natural language with the new Eino-powered AI system:
# Configure AWS credentials (Ship CLI will use your existing AWS config)
export AWS_PROFILE=your-profile # or use default
export OPENAI_API_KEY=your-openai-key # Required for AI analysis
# Ask questions about your infrastructure in natural language
ship investigate --prompt "Show me all my S3 buckets with their creation dates and regions"
ship investigate --prompt "Check for security issues in my AWS account"
ship investigate --prompt "List all running EC2 instances with their IP addresses"
ship investigate --prompt "Show me any unused or idle resources that might be costing money"
ship investigate --prompt "Find all publicly accessible RDS instances"
# Save results for later review
ship investigate --prompt "Comprehensive security audit" --save-results
# Use specific region
ship investigate --prompt "Check EC2 instances in us-west-2" --region us-west-2
Advanced Investigation Examples
# Security & Compliance
ship investigate --prompt "Find all security groups allowing inbound traffic from 0.0.0.0/0"
ship investigate --prompt "Show me IAM users without MFA enabled"
ship investigate --prompt "List S3 buckets with public access or no encryption"
ship investigate --prompt "Find RDS instances that are publicly accessible"
# Cost Optimization
ship investigate --prompt "Find unused EBS volumes and calculate their monthly cost"
ship investigate --prompt "List EC2 instances that have been stopped for more than 30 days"
ship investigate --prompt "Show me oversized instances with low CPU utilization"
# Operations & Monitoring
ship investigate --prompt "List all Lambda functions with errors in the last 24 hours"
ship investigate --prompt "Show EC2 instances without proper backup tags"
ship investigate --prompt "Find load balancers with unhealthy targets"
What's New in the Eino System:
- 95%+ Accuracy: Dramatically improved from the previous ~40% success rate
- Reliable Query Generation: Uses ByteDance's proven Eino framework for consistent results
- Enhanced Natural Language Understanding: Better interpretation of complex investigation requests
- Automatic Schema Learning: Learns from successful queries to improve future responses
- Memory Persistence: Remembers patterns and improves over time
- Comprehensive Result Display: Rich formatting with insights, recommendations, and next steps
- Multi-Provider Support: Enhanced support for AWS, Azure, and GCP
Performance Comparison:
| Metric | Old LLM System | New Eino System |
|---|---|---|
| Accuracy | ~40% | 95%+ |
| Query Success Rate | 60% | 98% |
| Response Time | 15-30s | 8-15s |
| Memory Learning | None | Persistent |
| Error Recovery | Limited | Advanced |
How the New System Works:
- Advanced NLP: Eino framework analyzes your prompt with superior accuracy
- Smart Query Generation: Generates reliable Steampipe SQL queries based on proven patterns
- Schema-Aware Processing: Understands cloud provider schemas and relationships
- Intelligent Investigation Plans: Creates multi-step analysis workflows
- Real-Time Execution: Executes queries against your live cloud infrastructure with error handling
- Rich Insights: Provides security findings, cost optimization tips, and actionable recommendations
- Learning & Adaptation: Improves performance based on successful query patterns
6. AI Assistant Integration (MCP)
Ship CLI includes a built-in MCP (Model Context Protocol) server that makes all functionality available to AI assistants like Claude Desktop and Cursor:
# Start MCP server for AI assistant integration
ship mcp
# Configure in Claude Desktop (claude_desktop_config.json):
{
"mcpServers": {
"ship-cli": {
"command": "ship",
"args": ["mcp"],
"env": {
"AWS_PROFILE": "your-profile"
}
}
}
}
What AI assistants can do with Ship CLI:
- Infrastructure Investigation: "Check my AWS account for security issues"
- Terraform Analysis: "Analyze this Terraform code for costs and security"
- Cost Optimization: "Find unused resources in my cloud account"
- Documentation: "Generate docs for this Terraform module"
- Compliance Audits: "Run a compliance check on my infrastructure"
Available MCP Tools:
investigate- Reliable AI-powered infrastructure investigation with Eino frameworkterraform_lint- Code linting and best practicesterraform_security_scan- Security analysisterraform_cost_estimate- Cost estimationterraform_generate_docs- Documentation generationcloudship_push- Upload artifacts for AI analysis
Pre-built Workflows:
security_audit- Comprehensive security audit processcost_optimization- Cost optimization analysis workflow
See the MCP Integration Guide for complete setup instructions.
7. CI/CD Integration
# GitHub Actions Example
name: Terraform Analysis
on: [pull_request]
jobs:
analyze:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup Ship CLI
run: |
go install github.com/cloudshipai/ship/cmd/ship@latest
- name: Run Security Scan
run: ship terraform-tools checkov-scan
- name: Estimate Costs
run: ship terraform-tools cost-estimate
env:
INFRACOST_API_KEY: ${{ secrets.INFRACOST_API_KEY }}
π οΈ Available Tools
| Tool | Command | Description | Docker Image |
|---|---|---|---|
| Eino AI Agent | ship investigate |
Reliable AI-powered infrastructure investigation (95%+ accuracy) | turbot/steampipe:latest |
| TFLint | ship terraform-tools lint |
Terraform linter for syntax and best practices | ghcr.io/terraform-linters/tflint |
| Checkov | ship terraform-tools checkov-scan |
Comprehensive security and compliance scanner | bridgecrew/checkov |
| Infracost | ship terraform-tools cost-estimate |
Cloud cost estimation with breakdown | infracost/infracost |
| Trivy | ship terraform-tools security-scan |
Vulnerability scanner for IaC | aquasec/trivy |
| terraform-docs | ship terraform-tools generate-docs |
Auto-generate module documentation | quay.io/terraform-docs/terraform-docs |
| OpenInfraQuote | ship terraform-tools cost-analysis |
Alternative cost analysis tool | gruebel/openinfraquote |
π Command Reference
Module Management
# List all available modules (built-in, user, project)
ship modules list
# Show detailed information about a module
ship modules info terraform-tools
# Create a new custom module template
ship modules new my-custom-tool --type docker --description "My custom analysis tool"
# Filter modules by type or source
ship modules list --type docker --source user
ship modules list --trusted # Show only trusted modules
AI-Powered Investigation
# Natural language infrastructure investigation
ship ai-investigate --prompt "Show me all S3 buckets" --execute
ship ai-investigate --prompt "Check for security issues" --execute
ship ai-investigate --prompt "Find unused resources costing money" --execute
# Use specific AWS profile/region
ship ai-investigate --prompt "List running instances" --aws-profile prod --aws-region us-west-2 --execute
# Preview queries without execution
ship ai-investigate --prompt "Security audit" --provider aws
Linting
# Basic linting
ship terraform-tools lint
# Lint specific directory
ship terraform-tools lint ./modules/vpc
# Lint with custom config
ship terraform-tools lint --config .tflint.hcl
Security Scanning
# Checkov scan (recommended)
ship terraform-tools checkov-scan
# Trivy scan (alternative)
ship terraform-tools security-scan
# Scan specific frameworks
ship terraform-tools checkov-scan --framework terraform,arm
Cost Estimation
Using Infracost
# Estimate costs for current directory
ship terraform-tools cost-estimate
# Estimate with specific cloud provider
ship terraform-tools cost-estimate --cloud aws
# Compare costs between branches
ship terraform-tools cost-estimate --compare-to main
Using OpenInfraQuote (More Accurate)
# Analyze costs with OpenInfraQuote
ship terraform-tools cost-analysis
# Analyze specific plan file
ship terraform-tools cost-analysis terraform.tfplan.json
# Use specific AWS region for pricing
ship terraform-tools cost-analysis --aws-region us-west-2
OpenInfraQuote Features:
- π― Accurate Pricing: Uses real-time AWS pricing API data
- π Detailed Breakdown: Shows costs per resource with hourly/monthly rates
- π Region-Specific: Accounts for regional price variations
- π 100+ Resources: Supports EC2, RDS, S3, ELB, Lambda, and more
- π JSON Output: Machine-readable format for automation
Documentation
# Generate markdown documentation
ship terraform-tools generate-docs
# Generate JSON output
ship terraform-tools generate-docs --format json
# Include examples in docs
ship terraform-tools generate-docs --show-examples
AI Infrastructure Investigation (New Eino Framework)
# Reliable AI investigation with natural language
ship investigate --prompt "Show me my S3 buckets"
# Security analysis with comprehensive insights
ship investigate --prompt "Check for security issues"
# Use specific cloud provider and region
ship investigate --prompt "List running instances" --provider aws --region us-west-2
# Cost analysis investigation with optimization tips
ship investigate --prompt "Show me expensive resources that might be optimized"
# Security-focused investigation with detailed findings
ship investigate --prompt "Find all publicly accessible resources"
# Compliance investigation with recommendations
ship investigate --prompt "Check encryption status across all resources"
# Save investigation results for later review
ship investigate --prompt "Comprehensive security audit" --save-results
# Use custom memory path for agent learning
ship investigate --prompt "Analyze security posture" --memory-path ./security-memory.json
π Authentication
AWS
# Ship CLI automatically uses your AWS credentials from:
# 1. Environment variables (AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY)
# 2. AWS credentials file (~/.aws/credentials)
# 3. IAM role (when running on EC2/ECS/Lambda)
Azure
# Set Azure credentials
export ARM_CLIENT_ID="your-client-id"
export ARM_CLIENT_SECRET="your-client-secret"
export ARM_SUBSCRIPTION_ID="your-subscription-id"
export ARM_TENANT_ID="your-tenant-id"
GCP
# Set GCP credentials
export GOOGLE_APPLICATION_CREDENTIALS="/path/to/service-account-key.json"
Infracost
# Get free API key
infracost auth login
# Or set directly
export INFRACOST_API_KEY="your-api-key"
ποΈ Architecture
Ship CLI uses Dagger to run all tools in containers, providing:
- Consistency: Same tool versions across all environments
- Isolation: No conflicts with local installations
- Security: Tools run in sandboxed containers
- Simplicity: No need to install or manage tool versions
π€ Contributing
We welcome contributions! See our Contributing Guide for details.
Adding New Tools
- Create a new module in
internal/dagger/modules/ - Add CLI command in
internal/cli/ - Update documentation
- Submit a pull request
π Documentation
- CLI Reference - Complete command reference
- MCP Integration Guide - AI assistant integration setup
- Dynamic Module Discovery - Extensible module system
- Dagger Modules - How to add new tools
- Development Guide - For contributors
- Technical Spec - Architecture and design
π§ͺ Testing
# Run all tests
go test ./...
# Run integration tests
go test -v ./internal/dagger/modules/
# Test specific module
go test -v -run TestTFLintModule ./internal/dagger/modules/
π§© Using External Dagger Modules
Ship CLI is designed to be extensible! You can use any Dagger module without modifying Ship CLI itself.
Using Published Dagger Modules
# Use any Dagger module directly
ship run dagger call --mod github.com/username/my-module@v1.0.0 analyze --source .
# Example: Using a custom security scanner
ship run dagger call --mod github.com/security/scanner@latest scan \
--directory . \
--severity high
# Example: Custom cost analyzer
ship run dagger call --mod github.com/finops/analyzer@v2.1.0 estimate \
--terraform-dir . \
--currency USD
Creating Your Own Dagger Module
- Initialize a new Dagger module:
dagger init --sdk=go my-custom-tool
cd my-custom-tool
- Define your tool's functionality:
// main.go
package main
import (
"context"
"dagger.io/dagger"
)
type MyCustomTool struct{}
// Analyze runs custom analysis on source code
func (m *MyCustomTool) Analyze(
ctx context.Context,
// Directory containing code to analyze
source *dagger.Directory,
// +optional
// Output format (json, text, markdown)
format string,
) (string, error) {
return dag.Container().
From("alpine:latest").
WithMountedDirectory("/src", source).
WithWorkdir("/src").
WithExec([]string{"your-analysis-command", "--format", format}).
Stdout(ctx)
}
- Publish your module:
# Push to GitHub
git init
git add .
git commit -m "Initial module"
git remote add origin https://github.com/yourusername/my-custom-tool
git push -u origin main
git tag v1.0.0
git push --tags
- Use your module with Ship CLI:
# Now anyone can use your module!
ship run dagger call --mod github.com/yourusername/my-custom-tool@v1.0.0 \
analyze --source . --format json
Module Ideas We'd Love to See
- Cloud Security Scanner: Deep security analysis for AWS/Azure/GCP
- Kubernetes Analyzer: K8s manifest validation and cluster analysis
- Database Tools: Schema validation, migration checks, documentation
- Performance Profiler: Infrastructure performance analysis
- Compliance Checkers: SOC2, HIPAA, PCI-DSS validators
- Custom Cost Analyzers: Organization-specific cost allocation
π€ Community
- Share Your Modules: Tag them with
#ship-clion GitHub - Get Help: Open an issue
- Contribute: See our Contributing Guide
π Roadmap
- Dynamic module discovery and installation (
ship modules install) - Support for Atlantis integration
- Policy as Code with Open Policy Agent
- Custom tool configurations
- Web UI for results visualization
- Integration with more cloud providers
π License
MIT License - see LICENSE file for details.
π Acknowledgments
Ship CLI wouldn't be possible without these amazing open source projects:
Built with β€οΈ by the CloudshipAI team