Skip to main content

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

  1. generated/ - Production-ready migrated code files

    • Each component in its own subdirectory
    • Properly formatted TypeScript/HTML/CSS
    • Ready for integration into your Angular project
  2. 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
  3. prompts_log/responses/ - Raw LLM output

    • Unprocessed responses from Azure OpenAI
    • Useful for debugging parsing issues
    • Contains metadata like token usage
  4. 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

code_transformer_platform-1.0.0.tar.gz (35.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

code_transformer_platform-1.0.0-py3-none-any.whl (41.9 kB view details)

Uploaded Python 3

File details

Details for the file code_transformer_platform-1.0.0.tar.gz.

File metadata

File hashes

Hashes for code_transformer_platform-1.0.0.tar.gz
Algorithm Hash digest
SHA256 8680692d323e3c9bfc1a60b827dab649c14a6d0d7e00e6f3e9d20a2fed15eb30
MD5 d324de0b53cff42cc9017d1a73abacf4
BLAKE2b-256 fb5e7007fafcced70700f350f7d9c0b46a3963dab94f61b91fe6105567384990

See more details on using hashes here.

File details

Details for the file code_transformer_platform-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for code_transformer_platform-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8310f7a0968964557b47ebeda716546ebb7fae5c89ce922dad714b733659a5f2
MD5 3aae1131a3dcfa61ec861dfd49abe753
BLAKE2b-256 3813f1fb94f50992b48115447ec693edbec1a05ce2aed1259b1a9be2d5cf7013

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page