Skip to content

syncable-dev/syncable-cli

Repository files navigation

πŸš€ Syncable IaC CLI

AI-powered Infrastructure-as-Code generator that analyzes your codebase and automatically creates optimized Docker, Docker Compose, and Terraform configurations.

Rust License: MIT Crates.io Downloads

✨ Features

πŸ” Comprehensive Project Analysis

  • Language Detection: Automatically detects JavaScript/TypeScript, Python, Rust, Go, Java/Kotlin
  • Framework Recognition: Identifies 70+ frameworks including Express, React, Django, FastAPI, Spring Boot
  • Dependency Analysis: Parses all package managers and extracts version constraints
  • Vulnerability Scanning: Integrates with security databases for each language ecosystem
  • Security Analysis: Basic secret detection and environment variable security checks
  • Context Extraction: Discovers entry points, ports, environment variables, and build scripts

🎯 Current Capabilities (Phase 1 Complete βœ…)

  • βœ… Multi-language project analysis
  • βœ… Framework and library detection with confidence scoring
  • βœ… Comprehensive dependency parsing
  • βœ… Security vulnerability checking
  • βœ… Basic security analysis with secret detection
  • βœ… Project context analysis (ports, env vars, build scripts)
  • βœ… Project type classification

🚧 Coming Soon (Phase 2+)

  • πŸ€– AI-powered Dockerfile generation
  • 🐳 Intelligent Docker Compose creation
  • ☁️ Cloud-ready Terraform configurations
  • πŸ”’ Advanced security analysis (infrastructure, framework-specific, compliance)
  • πŸ“Š Performance optimization suggestions

🐳 Docker Infrastructure Analysis

NEW: Comprehensive Docker infrastructure analysis and understanding:

  • Dockerfile Analysis:

    • Supports all Dockerfile variants (Dockerfile, dockerfile.dev, dockerfile.prod, etc.)
    • Extracts base images, exposed ports, environment variables, and build stages
    • Detects multi-stage builds and complexity metrics
    • Environment-specific configuration detection
  • Docker Compose Analysis:

    • Supports all compose file variants (docker-compose.yml, docker-compose.dev.yaml, etc.)
    • Service dependency mapping and network topology analysis
    • Port mapping analysis (external/internal, host/container)
    • Volume mount analysis and data persistence patterns
  • Service Discovery & Networking:

    • Internal DNS and service communication patterns
    • Custom network analysis and service isolation
    • Load balancer detection (nginx, traefik, haproxy, kong)
    • API gateway identification and ingress patterns
  • Orchestration Pattern Detection:

    • Single Container applications
    • Docker Compose multi-service setups
    • Microservices architecture patterns
    • Event-driven architecture (with message queues)
    • Service mesh detection (Istio, Linkerd, Envoy)
  • Monorepo Docker Support:

    • Analyzes Docker configurations across multiple projects
    • Maps services to their respective project contexts
    • Handles compose files at repository root with project-specific Dockerfiles

πŸ“¦ Installation

⚑ Quick Install

The fastest way to get started:

cargo install syncable-cli

Or see below for building from source.

From Source (Recommended)

# Prerequisites: Rust 1.70+ and Git

# Clone the repository
git clone https://github.com/syncable-dev/syncable-cli.git
cd syncable-cli

# Build and install
cargo install --path .

# Verify installation
sync-ctl --version

Pre-built Binaries

Coming soon! Check the releases page.

πŸš€ Quick Start

Analyze a Project

# Analyze current directory
sync-ctl analyze

# Analyze specific project
sync-ctl analyze /path/to/your/project

# Get JSON output
sync-ctl analyze --json > analysis.json

# Use different display modes (NEW!)
sync-ctl analyze --display matrix    # Modern dashboard view (default)
sync-ctl analyze --display summary   # Brief summary only
sync-ctl analyze --display detailed  # Legacy verbose output
sync-ctl analyze -d                   # Shorthand for detailed

πŸ“Š Display Modes (NEW!)

The analyze command now offers multiple display formats:

  • Matrix View (default): A modern, compact dashboard with side-by-side project comparison
  • Summary View: Brief overview perfect for CI/CD pipelines
  • Detailed View: Traditional verbose output with all project details
  • JSON: Machine-readable format for integration with other tools

See the Display Modes Documentation for visual examples and more details.

Check for Vulnerabilities

# Run vulnerability scan
sync-ctl vulnerabilities /path/to/project

# Check only high severity and above
sync-ctl vulnerabilities --severity high

# Export vulnerability report
sync-ctl vulnerabilities --format json --output vuln-report.json

Security Analysis

# Basic security analysis with secret detection
sync-ctl security /path/to/project

# Include low severity findings
sync-ctl security --include-low

# Skip specific analysis types
sync-ctl security --no-secrets --no-code-patterns

# Generate security report
sync-ctl security --format json --output security-report.json

# Fail CI/CD pipeline on security findings
sync-ctl security --fail-on-findings

Current Security Features:

  • βœ… Secret detection (API keys, tokens, passwords)
  • βœ… Environment variable security analysis
  • βœ… Basic code pattern analysis (limited rules)
  • βœ… Security scoring and risk assessment
  • 🚧 Infrastructure security analysis (coming soon)
  • 🚧 Framework-specific security checks (coming soon)
  • 🚧 Compliance framework validation (coming soon)

πŸ“– Usage Examples

Example: Node.js Express Application

$ sync-ctl analyze ./my-express-app

πŸ” Analyzing project at: ./my-express-app
============================================================

πŸ“Š PROJECT ANALYSIS RESULTS
============================================================

🎯 Languages: JavaScript (Node.js 18)
πŸ”§ Frameworks: Express, React
πŸ“¦ Dependencies: 23 production, 15 development

πŸ”Œ Exposed Ports:
   - 3000 (Express server)
   - 9090 (Metrics endpoint)

πŸ” Environment Variables:
   Required: DATABASE_URL, SECRET_KEY
   Optional: PORT, NODE_ENV, LOG_LEVEL

πŸ”¨ Build Scripts:
   - npm start
   - npm run dev
   - npm test
   - npm run build

βœ… Project Type: Web Application

Example: Python FastAPI Service

$ sync-ctl analyze ./fastapi-service --json
{
  "project_type": "ApiService",
  "languages": [{
    "name": "Python",
    "version": "3.11",
    "confidence": 0.95
  }],
  "frameworks": [{
    "name": "FastAPI",
    "category": "Web",
    "confidence": 0.92
  }],
  "ports": [{ "number": 8000, "protocol": "Http" }],
  "environment_variables": [
    { "name": "DATABASE_URL", "required": true },
    { "name": "REDIS_URL", "required": false }
  ]
}

Example: Security Analysis

$ sync-ctl security ./my-project

πŸ›‘οΈ  Finalizing analysis... [00:00:01] β–°β–°β–°β–°β–°β–°β–°β–°β–°β–°β–°β–°β–°β–°β–°β–°β–°β–°β–°β–° 100/100 100%

πŸ›‘οΈ  Security Analysis Results
============================================================

πŸ“Š SECURITY SUMMARY
βœ… Security Score: 100.0/100

πŸ” ANALYSIS SCOPE
βœ… Secret Detection         (5 files analyzed)
βœ… Environment Variables    (3 variables checked)
ℹ️  Code Security Patterns   (no applicable files found)
🚧 Infrastructure Security  (coming soon)
🚧 Compliance Frameworks    (coming soon)

🎯 FINDINGS BY CATEGORY
πŸ” Secret Detection: 0 findings
πŸ”’ Code Security: 0 findings
πŸ—οΈ Infrastructure: 0 findings
πŸ“‹ Compliance: 0 findings

πŸ’‘ RECOMMENDATIONS
β€’ Enable dependency vulnerability scanning in CI/CD
β€’ Consider implementing rate limiting for API endpoints
β€’ Review environment variable security practices

πŸ› οΈ Advanced Configuration

Create a .syncable.toml in your project:

[analysis]
include_dev_dependencies = true
deep_analysis = true
ignore_patterns = ["vendor", "node_modules", "target"]
max_file_size = 2097152  # 2MB

[output]
format = "json"  # or "yaml", "toml"

πŸ§ͺ Supported Technologies

Languages & Runtimes

  • JavaScript/TypeScript (Node.js)
  • Python (3.7+)
  • Rust
  • Go
  • Java/Kotlin

Frameworks (70+ supported)

  • JavaScript: Express, Next.js, React, Vue, Angular, Nest.js
  • Python: Django, Flask, FastAPI, Pyramid
  • Rust: Actix-web, Rocket, Axum, Warp
  • Go: Gin, Echo, Fiber, Chi
  • Java: Spring Boot, Micronaut, Quarkus

Package Managers

  • npm, yarn, pnpm
  • pip, poetry, pipenv
  • cargo
  • go mod
  • maven, gradle

🀝 Contributing

We welcome contributions! Please see our Contributing Guide for details.

# Run tests
cargo test

# Run with debug logging
RUST_LOG=debug cargo run -- analyze ./test-project

# Format code
cargo fmt

# Run linter
cargo clippy

πŸ“Š Project Status

Phase 1: Core Analysis Engine βœ…

  • Language Detection
  • Framework Detection
  • Dependency Parsing
  • Vulnerability Checking
  • Basic Security Analysis (secret detection, env vars)
  • Project Context Analysis

Phase 2: AI Integration 🚧

  • AI Provider Integration
  • Smart Dockerfile Generation
  • Intelligent Docker Compose
  • Cloud-Ready Terraform

See ROADMAP.md for detailed progress.

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ™ Acknowledgments

  • Built with Rust πŸ¦€
  • Uses clap for CLI parsing
  • Integrates with various security databases

Built with ❀️ by the Syncable team

About

Syncable CLI is an intelligent Infrastructure as Code generator that analyzes codebases to automatically detect languages, frameworks, and dependencies across 70+ frameworks in 5 languages (Rust, JS/TS, Python, Go, Java). It generates optimized Docker, Compose, and Terraform configs with built-in security analysis and vulnerability scanning.

Resources

License

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Contributors