AI-powered code migration platform for transforming legacy codebases to modern frameworks
Project description
Code Transformer Platform
Prerequisites
Environment Variables
Before running the platform, set the following environment variables for Azure OpenAI:
$env:AZURE_OPENAI_API_KEY = "your-api-key-here"
$env:AZURE_OPENAI_ENDPOINT = "https://your-endpoint.openai.azure.com/"
Or in bash:
export AZURE_OPENAI_API_KEY="your-api-key-here"
export AZURE_OPENAI_ENDPOINT="https://your-endpoint.openai.azure.com/"
Features
- Multi-Agent Pipeline: Orchestrates 8 specialized agents for code transformation
- Automated Documentation: Every agent logs its analysis to
migration_analysis.md - Dependency Analysis: Detects cycles, entry points, and external dependencies
- Risk Assessment: Categorizes components by migration risk level
- LLM-Powered Generation: Uses Azure OpenAI for intelligent code generation
- Separate File Output: Each component generates its own file
Usage
Basic Command
python -m cli.main --input-path ./legacy --output-path ./output --target-config config/targets/angular18.yaml --source-stack extjs+xhtml --target-stack angular18 --llm-config config/llm/azure_openai.yaml --policy-config config/llm/generation_policy.yaml
With Custom Output Directory
python -m cli.main --input-path ./legacy --output-path ./migrated-code --target-config config/targets/angular18.yaml --llm-config config/llm/azure_openai.yaml --policy-config config/llm/generation_policy.yaml
Alternative Command
python -m cli.main ./legacy --target-config config/target/angular18.yaml --llm-config config/llm/azure_openai.yaml --policy-config config/llm/generation_policy.yaml
Output Files
After running the pipeline, you'll find in your output directory:
Directory Structure
output/
├── generated/ # Clean, formatted generated code
│ ├── ComponentName1/
│ │ ├── component.component.ts
│ │ ├── component.component.html
│ │ ├── component.component.css
│ │ └── component.service.ts
│ └── ComponentName2/
│ └── ...
├── prompts_log/ # LLM interaction logs
│ ├── prompt_Component1_*.txt # Prompts sent to LLM
│ ├── prompt_Component2_*.txt
│ └── responses/ # Raw LLM responses
│ ├── response_Component1_*.txt
│ └── response_Component2_*.txt
└── migration_analysis.md # Comprehensive migration report
Files Explained
-
generated/ - Production-ready migrated code files
- Each component in its own subdirectory
- Properly formatted TypeScript/HTML/CSS
- Ready for integration into your Angular project
-
prompts_log/ - Debugging and analysis
- Shows exactly what was sent to the LLM
- Contains original source code, dependencies, and instructions
- Helps understand and improve the migration process
-
prompts_log/responses/ - Raw LLM output
- Unprocessed responses from Azure OpenAI
- Useful for debugging parsing issues
- Contains metadata like token usage
-
migration_analysis.md - Complete audit trail documenting:
- Files scanned and components discovered
- Dependency resolution and cycles detected
- AST parsing results
- IR transformation details
- Migration plan with risk assessment
- Code generation metadata
This comprehensive output provides full traceability and easy access to both the migrated code and the migration process details.
Note: If --output-path is not specified, the default output directory is ./output
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file code_transformer_platform-1.0.0.tar.gz.
File metadata
- Download URL: code_transformer_platform-1.0.0.tar.gz
- Upload date:
- Size: 35.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8680692d323e3c9bfc1a60b827dab649c14a6d0d7e00e6f3e9d20a2fed15eb30
|
|
| MD5 |
d324de0b53cff42cc9017d1a73abacf4
|
|
| BLAKE2b-256 |
fb5e7007fafcced70700f350f7d9c0b46a3963dab94f61b91fe6105567384990
|
File details
Details for the file code_transformer_platform-1.0.0-py3-none-any.whl.
File metadata
- Download URL: code_transformer_platform-1.0.0-py3-none-any.whl
- Upload date:
- Size: 41.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8310f7a0968964557b47ebeda716546ebb7fae5c89ce922dad714b733659a5f2
|
|
| MD5 |
3aae1131a3dcfa61ec861dfd49abe753
|
|
| BLAKE2b-256 |
3813f1fb94f50992b48115447ec693edbec1a05ce2aed1259b1a9be2d5cf7013
|