syncable-cli 0.1.2

A Rust-based CLI that analyzes code repositories and generates Infrastructure as Code configurations
Documentation
# ๐Ÿš€ Syncable IaC CLI

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

[![Rust](https://img.shields.io/badge/rust-%23000000.svg?style=for-the-badge&logo=rust&logoColor=white)](https://www.rust-lang.org/)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

## โœจ 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

## ๐Ÿ“ฆ Installation

### From Source (Recommended)

```bash
# 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](https://github.com/syncable-dev/syncable-cli/releases).

## ๐Ÿš€ Quick Start

### Analyze a Project

```bash
# 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
```

### Check for Vulnerabilities

```bash
# 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

```bash
# 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

```bash
$ 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

```bash
$ sync-ctl analyze ./fastapi-service --json
```

```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

```bash
$ 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:

```toml
[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](CONTRIBUTING.md) for details.

```bash
# 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 โœ…
- [x] Language Detection
- [x] Framework Detection  
- [x] Dependency Parsing
- [x] Vulnerability Checking
- [x] **Basic Security Analysis** (secret detection, env vars)
- [x] Project Context Analysis

### Phase 2: AI Integration ๐Ÿšง
- [ ] AI Provider Integration
- [ ] Smart Dockerfile Generation
- [ ] Intelligent Docker Compose
- [ ] Cloud-Ready Terraform

See [ROADMAP.md](ROADMAP.md) for detailed progress.

## ๐Ÿ“„ License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

## ๐Ÿ™ Acknowledgments

- Built with [Rust]https://www.rust-lang.org/ ๐Ÿฆ€
- Uses [clap]https://github.com/clap-rs/clap for CLI parsing
- Integrates with various security databases

---

**Built with โค๏ธ by the Syncable team**