Quick Start
Learn the basics of Astra with these simple examples.
Your First Migration
Let's migrate a simple TypeScript file to Rust. Create a file called utils.ts:
export function add(a: number, b: number): number {
return a + b;
}
export function multiply(a: number, b: number): number {
return a * b;
}Now run the migration command:
astra migrate --from typescript --to rust --input utils.ts --output utils.rsAnalyzing Your Code
Before migrating a large codebase, it's helpful to analyze it first:
astra analyze --input src/ --language typescriptThis will show you statistics about your codebase, including complexity metrics and potential migration challenges.
Validating Output
After migration, validate that the output code is correct:
astra validate --input utils.rs --language rustThis checks for syntax errors, type issues, and other potential problems.
Batch Migration
Migrate an entire directory of files:
astra migrate --from typescript --to rust --input src/ --output target/Tip: Astra preserves directory structure when migrating multiple files.
Next Steps
Now that you know the basics, explore more advanced features: