syncable-cli 0.4.2

A Rust-based CLI that analyzes code repositories and generates Infrastructure as Code configurations
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
# ๐Ÿš€ 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)
![Crates.io Downloads](https://img.shields.io/crates/d/syncable-cli)

## ๐ŸŽฏ **260+ Technologies Supported**
**The most comprehensive project analyzer supporting 5 major languages and their complete ecosystems:**
- โ˜• **Java/JVM**: 98 technologies (13 Spring components + enterprise stack)
- ๐Ÿ **Python**: 76 technologies (Django, FastAPI, ML/Data Science)  
- ๐ŸŸจ **JavaScript/TypeScript**: 46 technologies (React, Next.js, Node.js)
- ๐Ÿน **Go**: 21 technologies (cloud-native & microservices)
- ๐Ÿฆ€ **Rust**: 20 technologies (high-performance web & systems)

## ๐ŸŒŸ Help Other Developers Discover This Tool

**If this tool saves you time, please consider giving it a โญ on GitHub!** 

Stars help other developers find Syncable CLI, and the more builders who discover it early, the better we can make it for everyone. Every star helps us reach developers who could benefit from automated infrastructure analysis and generation.

[โญ **Star on GitHub**](https://github.com/syncable-dev/syncable-cli)


## โœจ Features

### ๐Ÿ” Comprehensive Project Analysis
- **Language Detection**: Automatically detects JavaScript/TypeScript, Python, Rust, Go, Java/Kotlin with precise version detection
- **Framework Recognition**: Identifies **260+ technologies** across all major ecosystems including complete Spring, Django, React, and Express families
- **Dependency Analysis**: Parses all package managers (npm/yarn/pnpm, pip/poetry, cargo, go mod, maven/gradle) 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:

```bash
cargo install syncable-cli
```

Or see below for building from source.

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

# 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](docs/cli-display-modes.md) for visual examples and more details.

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

## ๐Ÿงช Comprehensive Technology Support (260+ Technologies)

### ๐Ÿ“Š Coverage by Language
- **โ˜• Java/JVM**: **98 technologies** - The most comprehensive JVM ecosystem coverage
- **๐Ÿ Python**: **76 technologies** - Complete Python web, data, and ML stack
- **๐ŸŸจ JavaScript/TypeScript**: **46 technologies** - Full-stack web development ecosystem  
- **๐Ÿน Go**: **21 technologies** - Modern cloud-native and microservices tools
- **๐Ÿฆ€ Rust**: **20 technologies** - High-performance systems and web frameworks

### ๐ŸŒŸ Major Ecosystem Coverage

#### โ˜• **Java/JVM Ecosystem** (98 technologies)
**Spring Family** (13 technologies):
- Spring Boot, Spring Framework, Spring Security, Spring Data
- Spring Cloud (Gateway, Config, Netflix), Spring WebFlux, Spring MVC
- Spring Batch, Spring Integration, Spring AOP, and more

**Enterprise & Microservices**: Quarkus, Micronaut, Dropwizard, Jakarta EE  
**Database & ORM**: Hibernate, MyBatis, JPA, JDBI, MongoDB Driver, Redis Jedis  
**Message Brokers**: Apache Kafka, RabbitMQ, ActiveMQ, Apache Pulsar  
**Search & Big Data**: Elasticsearch, Apache Solr, Apache Spark, Apache Flink  
**Security**: Apache Shiro, Keycloak, Bouncy Castle, JWT, OAuth2  
**Build Tools**: Maven, Gradle, Ant  
**Testing**: JUnit, TestNG, Mockito, Selenium, Cucumber, Testcontainers  
**Web Servers**: Tomcat, Jetty, Undertow, Netty  

#### ๐Ÿ **Python Ecosystem** (76 technologies)  
**Web Frameworks**: Django, Flask, FastAPI, Pyramid, CherryPy, Tornado, Falcon  
**Django Family**: Django REST Framework, Django ORM, Django-allauth  
**Data & ML**: NumPy, Pandas, Scikit-learn, TensorFlow, PyTorch, Keras  
**Database & ORM**: SQLAlchemy, Alembic, psycopg2, PyMongo, Redis-py  
**Async & Messaging**: Celery, asyncio, aiohttp, Dramatiq  
**Scientific**: Matplotlib, Seaborn, Jupyter, SciPy  
**WSGI/ASGI Servers**: Gunicorn, Uvicorn, Hypercorn, Daphne, Waitress  
**Testing**: pytest, unittest, nose2, behave, Robot Framework  

#### ๐ŸŸจ **JavaScript/TypeScript Ecosystem** (46 technologies)
**Meta-Frameworks**: Next.js, Nuxt.js, SvelteKit, Astro, SolidStart, Tanstack Start  
**Frontend**: React, Vue.js, Angular, Svelte, SolidJS  
**Mobile**: React Native, Expo  
**Backend**: Express.js, Nest.js, Fastify, Hono, Elysia  
**Database/ORM**: Prisma, Drizzle ORM, TypeORM, Mongoose, Sequelize  
**Build Tools**: Vite, Webpack, Rollup, Parcel  
**Runtimes**: Node.js, Bun, Deno, Cloudflare Workers, Vercel Edge  
**Testing**: Jest, Vitest, Cypress, Playwright  

#### ๐Ÿน **Go Ecosystem** (21 technologies)
**Web Frameworks**: Gin, Echo, Fiber, Chi, Gorilla Mux, Beego  
**Microservices**: gRPC, go-kit, go-micro  
**Database**: GORM, sqlx, pgx  
**Cloud Native**: Kubernetes client, Docker, Consul  
**Testing**: Testify, Ginkgo, GoConvey  

#### ๐Ÿฆ€ **Rust Ecosystem** (20 technologies)  
**Web Frameworks**: Actix-web, Axum, Rocket, Warp, Tide  
**Async Runtimes**: Tokio, async-std  
**Database/ORM**: SeaORM, Diesel, SQLx  
**Serialization**: Serde  
**Testing**: Built-in test framework, criterion (benchmarking)

### ๐Ÿ“ฆ **Package Manager Support**
- **JavaScript**: npm, yarn, pnpm, bun
- **Python**: pip, poetry, pipenv, conda, pdm  
- **Java**: Maven, Gradle
- **Rust**: Cargo
- **Go**: go mod
- **PHP**: Composer
- **Ruby**: Bundler

## ๐Ÿค 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**