# 🧠 code-transmute

**Convert any codebase into any language — without changing its brain.**

[![npm version](https://badge.fury.io/js/code-transmute.svg)](https://badge.fury.io/js/code-transmute)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

## 🧰 Core Idea

code-transmute is a CLI tool and npm package that:

- Uses the OpenAI API to review, plan, and translate codebases into a target language
- Ensures logic parity — the converted code behaves identically
- Automatically generates review reports, migration plans, executable conversions, tests, and API collections
- Guides the user entirely via interactive CLI prompts

## 🚀 Quick Start

```bash
# Install globally
npm install -g code-transmute

# Or use with npx
npx code-transmute init
```

## ⚙️ CLI Commands

### 🔧 Initialization
```bash
npx code-transmute init
```
Prompts for OpenAI API key, project path, target language, and test options.

### 🧠 Code Review
```bash
npx code-transmute review
```
Generates comprehensive code analysis and architecture mapping.

### 🪄 Migration Planning
```bash
npx code-transmute plan
```
Creates AI-generated step-by-step migration strategy.

### 🔁 Code Conversion
```bash
npx code-transmute convert [--dry-run] [--with-tests]
```
Executes the migration plan with optional dry-run mode.

### 🧪 Testing & Reports
```bash
npx code-transmute test
```
Runs generated tests and creates QA documentation.

### 📦 Export
```bash
npx code-transmute export
```
Packages final converted project with all documentation.

## 🔮 Example Use Cases

- **Express.js → FastAPI**: Convert REST APIs to Python with identical endpoints
- **React → Svelte**: Convert components with no logic change
- **Flask → NestJS**: Translate Python backend into TypeScript
- **Monolith → Microservices**: Split modules intelligently

## 📁 Output Structure

```
/converted-project
├─ src/
├─ tests/
├─ docs/
│   ├─ review.md
│   ├─ migration_plan.md
│   ├─ manual_testing.md
├─ api_collection/
├─ test_report.json
└─ conversion_log.json
```

## 🛠️ Development

```bash
# Install dependencies
npm install

# Development mode
npm run dev

# Build
npm run build

# Test
npm test
```

## 📄 License

MIT © Parallaxis Innovations
