Metadata-Version: 2.4
Name: launchkit-cli
Version: 0.1.0
Summary: One config file. Production-ready output. No vendor lock-in.
Project-URL: Homepage, https://github.com/SohamRupaye/launchkit
Project-URL: Documentation, https://github.com/SohamRupaye/launchkit/tree/main/docs
Project-URL: Issues, https://github.com/SohamRupaye/launchkit/issues
License: MIT
License-File: LICENSE
Keywords: ci-cd,deployment,devops,docker,generator,kubernetes
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Software Development :: Build Tools
Classifier: Topic :: System :: Systems Administration
Requires-Python: >=3.10
Requires-Dist: click>=8.1
Requires-Dist: jinja2>=3.1
Requires-Dist: jsonschema>=4.0
Requires-Dist: pydantic>=2.0
Requires-Dist: pyyaml>=6.0
Requires-Dist: rich>=13.0
Provides-Extra: dev
Requires-Dist: mypy>=1.5; extra == 'dev'
Requires-Dist: pytest-cov>=4.1; extra == 'dev'
Requires-Dist: pytest>=7.4; extra == 'dev'
Requires-Dist: ruff>=0.1; extra == 'dev'
Requires-Dist: types-jsonschema; extra == 'dev'
Requires-Dist: types-pyyaml; extra == 'dev'
Provides-Extra: release
Requires-Dist: build>=1.2; extra == 'release'
Requires-Dist: twine>=5.1; extra == 'release'
Description-Content-Type: text/markdown

# LaunchKit

**One config file. Production-ready output. Zero vendor lock-in.**

LaunchKit bridges the gap between _"it works on my machine"_ and _"it runs in production reliably"_ — without locking you into AWS, GCP, or any managed Platform-as-a-Service (PaaS).

Define your services once. LaunchKit intelligently detects your code, then generates highly-optimized Dockerfiles, Kubernetes manifests, CI/CD pipelines, Nginx proxies, and environment configurations.

```bash
pip install launchkit
launchkit init      # Intelligently detects your stack & scaffolds launchkit.yaml
launchkit generate  # Outputs everything you need to deploy
launchkit lint      # Catches deployment & configuration pitfalls proactively
```

PyPI publishing is wired up in this repository, but `pip install launchkit` only works after the first release is pushed to PyPI.

---

## The Problem

Every project hits the same wall:

- Dockerfiles written from scratch every time, missing layer caches and memory limits.
- CI/CD pipelines copy-pasted, taking 20 minutes to run because they lack monorepo caching.
- Kubernetes manifests hand-crafted with no consistency across staging and production.
- Vendor-specific config (ECS task definitions, Cloud Run YAMLs) that traps your infrastructure.
- The dreaded lock-in of platforms like Render, Heroku, or Fly.io that become prohibitively expensive at scale.

LaunchKit gives you the **output files**. You own everything. If you outgrow LaunchKit, you just run `launchkit eject` and keep the pristine files.

---

## How It Works

```text
Your Monorepo / App
    │
    ▼
launchkit.yaml          ← The single source of truth (scaffolded automatically)
    │
    ▼
launchkit generate
    │
    ├── services/                 ← Multi-stage, language-optimized Dockerfiles
    ├── .github/workflows/ci.yml  ← Affected-only monorepo CI/CD pipelines
    ├── nginx/nginx.conf          ← Production-grade reverse proxy with rate limiting
    └── k8s/
        ├── staging/              ← Environment overrides (e.g. 1 replica)
        └── production/
            ├── deployment.yaml   ← Deployments with intelligent resource limits
            ├── hpa.yaml          ← Autoscaling config
            ├── ingress.yaml      ← TLS & DNS setup
            └── secrets-hint.yaml ← Secure guidance for secrets management
```

No magic, no backend services, no runtime dependency. LaunchKit is a **Code Generator + Intelligence layer** — the output is plain files you can read, modify, review, and commit.

---

## Features (Complexity Eraser)

LaunchKit is now fully at **v0.3**, transitioning from a simple templater to a total **Complexity Eraser**.

### Terminal Demo

There is now a reproducible mixed-stack demo flow for asciinema recordings:

```bash
pip install -e ".[dev,release]"
python -m pip install asciinema
bash scripts/record_mixed_stack_demo.sh
```

That script creates a temporary mixed-stack repo, runs `launchkit init`, runs `launchkit generate`, and writes a shareable cast to `demo/launchkit-mixed-stack.cast`.

### 1. Intelligent Auto-Detection (8 Languages Supported)
`launchkit init` scans your repo, dependencies, and build files.

| Language | Recognized Frameworks & Build Tools |
|----------|-------------------------------------|
| **Python** | FastAPI, Flask, Django, Starlette, Celery workers |
| **Node.js**| Next.js, Express, Fastify, Koa, NestJS |
| **Go**     | Gin, Echo, Fiber, Chi |
| **Java**   | Spring Boot, Quarkus, Micronaut (Maven & Gradle caching) |
| **Rust**   | Actix, Axum, Rocket, Warp (Cargo-chef layer caching) |
| **Ruby**   | Rails, Sinatra, Sidekiq workers |
| **PHP**    | Laravel, Symfony, Slim (php-fpm + deep OPcache tuning) |
| **.NET**   | ASP.NET, Worker Services (.csproj detection) |

### 2. Environment Profiles
Generate dedicated staging AND production manifests from a single base configuration.

```yaml
environments:
  staging:
    namespace: staging
    domain: staging.myapp.com
    scale: { max: 2 }
  production:
    namespace: production
    domain: myapp.com
    tls: true
    replicas: 2
```
`launchkit generate --env staging` creates a distinct folder safely sandboxed from production configurations.

### 3. `launchkit lint` (Proactive Deployment Advisor)
LaunchKit lints your deployment architecture _before_ you even hit `kubectl apply`.
It catches:
- Missing Healthchecks (Silent readiness failure).
- Memory Request Mismatches (OOMKills during bursting).
- Missing Production Replicas.
- `latest` image tags.
- CPU Autoscaling on I/O-bound (async) workers.

### 4. `launchkit eject` (Trust & Zero Lock-in)
The ultimate trust signal. When you want to take over infrastructure customization entirely:
```bash
launchkit eject --yes
```
This strips all `# Generated by LaunchKit` headers and K8s annotations, deletes `launchkit.yaml`, and leaves you with pristine, independent files.

### 5. `launchkit upgrade` (Continuous Intelligence)
Dependencies change, new branches are created, and memory usage shifts.
`launchkit upgrade` rescans your source code, compares it against your `launchkit.yaml`, and suggests interactive dependency changes, new resource boundaries, and CI strategy updates.

### 6. Nginx Reverse Proxy
Generated K8s services need an ingress layer. LaunchKit automatically spins up an optimized containerized Nginx reverse proxy including:
- Upstream load balancing
- Gzip compressions
- Rate limiting (`limit_req_zone`)
- Websocket support (`Upgrade` / `Connection`)
- Security Headers (HSTS, nosniff, X-Frame-Options)

### 7. Monorepo "Affected-Only" CI
Tired of waiting 40 minutes for all 8 microservices to build because you changed a markdown file?
LaunchKit generates GitHub Actions and GitLab CI files that compute Git diffs to **only trigger pipelines for the strictly changed services**.

### 8. Auto Resource Profiling
A Next.js frontend, a Go API, and a Python Machine Learning worker don't scale the same way. LaunchKit analyzes dependencies (like `pytorch`, `pandas`, `sidekiq`) and infers dynamic Kubernetes CPU/RAM requests, limits, and HPA targets depending on process models.

---

## CLI Reference

LaunchKit packs **8 heavily tested commands**:

```bash
launchkit init                    # Detects stack & scaffolds launchkit.yaml
launchkit generate                # Generates all output files
launchkit generate --env staging  # Generates files specific to 'staging'
launchkit generate --only docker  # Only generate Dockerfiles
launchkit diff                    # Dry-run: Show what would change
launchkit lint                    # Catch deployment & configuration issues Early
launchkit check / validate        # Validate launchkit.yaml schema natively
launchkit doctor                  # Check runtime host dependencies safely
launchkit eject                   # Strip markers, leave pristine files, exit LaunchKit
launchkit upgrade                 # Re-run intelligence on codebase & get suggestions
```

---

## Why Not Just Use X?

| Tool | The Trade-off |
|------|--------------|
| **Railway / Render / Fly.io** | Incredible DX, but they own your deployment. You're locked into their platform, bandwidth fees, and lacking deep K8s controls. |
| **AWS CDK / Pulumi** | Extremely powerful, but commits you to a specific cloud vendor and requires learning complete Infrastructure-as-Code paradigms. |
| **Helm** | Kubernetes-only templates. Doesn't write your Dockerfiles or CI. |
| **Copilot (AWS)** | AWS-ECS specific. High friction to migrate out. |
| **Writing it yourself** | Configuration drift across microservices. Hard to maintain. Takes days of raw YAML authoring per application. |

**LaunchKit is a generator, not a runtime.** It writes your files, drops knowledge into your repository, and then gets out of the way.

---

## Project Architecture

```text
launchkit/
├── src/launchkit/
│   ├── cli.py                    # Click-based robust CLI
│   ├── core/                     # Intelligence Engines (diff, lint, eject, upgrade)
│   ├── detectors/                # Base & 8 language ecosystem profilers (deps, frameworks)
│   ├── generators/               # Docker, K8s, CI, Compose, Secrets, Nginx AST writers
│   ├── templates/                # Jinja2 definitions
│   └── utils/                    # Thread-safe CLI Printers
├── tests/
│   ├── unit/                     # 240+ automated tests across detectors, parsing, generators
│   └── integration/
├── docs/
└── examples/
    ├── mixed-stack/              # Python API + Next.js frontend + Go worker repo
    └── monorepo-python/
```

---

## Contributing

Contributions are strongly welcomed. The current test suite collects `248 tests`.

If you want to help harden LaunchKit against real codebases, use the validation loop in [docs/real-world-validation.md](./docs/real-world-validation.md) and file results with the repo's real-world validation issue template.

If establishing robust build strategies for new stacks gets you excited, read [docs/adding-a-language.md](./docs/adding-a-language.md) to build new detectors.

---

## License
MIT
