A powerful CLI tool for code migration and analysis between different programming languages.
- 🔄 Code Migration: Migrate code between different programming languages
- 📊 Code Analysis: Analyze code structure and dependencies
- 🔍 Code Comparison: Compare source and target code
- ⚙️ Configuration Management: Manage tool settings
- Python >= 3.13
uv(Python package installer)
pip install uvgit clone <your-repository-url>
cd codepilot-cliuv venv
source .venv/bin/activate
uv pip install -e .uv venv .venv
.venv\Scripts\activate
uv pip install -e .
pip install python-magic
pip install python-magic-bin
uv tool update-shell
The migrate command translates source code files or entire projects from one programming language to another using AI, while preserving your folder structure and skipping unsupported or binary files.
codepilot migrate <source_path> --target-lang <language> [options]Required Arguments:
<source_path>: Path to the source file or directory to migrate.--target-lang,-t: Target language (e.g.,python,java,javascript).
Optional Arguments:
--source-lang,-s: Source language (auto-detected if not specified).--output-dir,-o: Output directory for migrated code. Required unless using--dry-run.--dry-run: Analyze files and show what would be migrated, but do not write any output files.--analysis-report: --analysis-report: Path to an analysis JSON file containing migration configuration such as target framework, version, and custom notes
Examples:
- Migrate a single file from Python to Java:
codepilot migrate src/main.py --target-lang java -o out/- Migrate src from Python to Java:
codepilot migrate ./src -t java -s python -o ./out - Migrate src from Python to Java using custom json file:
codepilot migrate src --analysis-report D:\codepilot-cli\src\codepilot-reports\hi.json --target-lang java --output-dir migrated_codecodepilot analyze <source_path> [options]Options:
-s,--source-lang: Source language (auto-detected if not specified)
codepilot compare <source_path> <target_path>codepilot config --show # Show current configuration
codepilot config --set key=value # Set configuration optionuv venv
source .venv/bin/activate # On Unix/macOSuv tool install -e ".[dev]"Contributions are welcome! Please feel free to submit a Pull Request.