UNPKG

code-transmute

Version:

Convert any codebase into any language โ€” without changing its brain.

106 lines (79 loc) โ€ข 2.35 kB
# ๐Ÿง  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