TRAE CLI (Total Rust Analysis Engine) is a command-line tool for analyzing, repairing and optimizing Rust projects with JARVIXSERVER integration.
- 🚀 Fast Analysis: File-system aware analysis with intelligent caching (.trae/cache)
- 🔒 Security First: Detects unsafe blocks, unwrap calls, and panic macros
- 📊 Quality Metrics: Six Sigma analysis with DPMO calculations
- 🔧 Auto Repair: Automatic code improvements and optimizations
- 🌐 JARVIXSERVER Integration: Seamless integration with MCP tools
- ⚡ Zero Warnings: Strict CI policy with clippy -D warnings
- 📈 Performance Optimized: Parallel processing with rayon
# Install globally
cargo install --path .
# Run analysis (programmatic API)
cargo run --bin trae -- repair
# Check code quality
cargo run --bin trae -- clippy --strict
# View available commands
cargo run --bin trae -- --helpLatest project analysis shows:
- 49 total files analyzed
- 31,267 lines of code
- 92 issues detected (security, performance, quality)
- 30 optimization suggestions
- Parallel processing: 4,900 units in optimized chunks
# Development build
cargo build
# Release build
cargo build --release
# Run tests
cargo test
# Code quality (zero warnings policy)
cargo clippy -- -D warnings
cargo fmttrae-cli/
├── src/
│ ├── main.rs # CLI entry point
│ ├── core/
│ │ └── analyzer.rs # Six Sigma analysis engine
│ ├── commands/
│ │ ├── analyze.rs # Analysis command (API)
│ │ └── repair.rs # Auto repair functionality
│ └── bin/
│ └── server_http.rs # HTTP server for JARVIXSERVER
├── tests/
│ ├── analyze_cache.rs # Analysis testing
│ └── integration_jarvix.rs # JARVIXSERVER integration
├── Cargo.toml # Dependencies (pinned versions)
├── CHANGELOG.md # Version history
└── README.md # This file
# JARVIXSERVER integration
export JARVIX_URL=http://localhost:8080
# Debug mode
export RUST_LOG=debug# .cargo/config.toml
[profile.release]
lto = true
codegen-units = 1
panic = "abort"
strip = true- Startup Time: < 2 seconds
- Analysis Speed: ~500ms for 10k lines
- Memory Usage: < 50MB
- Binary Size: ~5MB (release build)
- Cache Hit Rate: Intelligent fingerprint-based caching
TRAE CLI follows strict Rust development practices:
- ✅ No Mocks: Real code analysis only (constitution requirement)
- ✅ Zero Warnings: CI enforces clippy -D warnings
- ✅ Explicit Error Handling: No unwrap() in production code
- ✅ Performance First: Parallel processing with rayon
- ✅ Security Focused: Unsafe block detection and analysis
- ✅ Real Compilation: No false positives in analysis
TRAE CLI integrates seamlessly with JARVIXSERVER for enhanced capabilities:
┌─────────────────┐ ┌─────────────────┐
│ JARVIXSERVER │ │ TRAE CLI │
│ (Port 8080) │◄──►│ (Port 3001) │
│ │ │ │
│ • API Gateway │ │ • Code Analysis │
│ • Proxy Router │ │ • Auto Repair │
│ • Metrics Hub │ │ • Quality Score │
└─────────────────┘ └─────────────────┘
GET /trae/health- Health checkPOST /trae/api/analyze- Code analysisPOST /trae/api/repair- Auto repairGET /trae/api/metrics- System metrics
- Nuclear Crawler: Advanced code analysis
- Memory Performance: Optimization tools
- Web Search: Documentation lookup
- INTEGRATION.md - JARVIXSERVER integration guide
- CARGO_COMMANDS.md - Build optimization guide
- COMMANDS.md - Available commands reference
- CHANGELOG.md - Version history
- CONTRIBUTING.md - Development guidelines
# Clean and rebuild
cargo clean
cargo build --release# Check file permissions
ls -la src/
# Verify Rust toolchain
rustc --version
cargo --version# Check JARVIXSERVER status
curl http://localhost:8080/health
# Test TRAE CLI integration
curl http://localhost:8080/trae/healthLicensed under MIT OR Apache-2.0.
- Fork the repository
- Create a feature branch (
feat/orfix/) - Make your changes
- Run tests:
cargo test - Format code:
cargo fmt - Check quality:
cargo clippy -- -D warnings - Submit a pull request
This repo includes pre-commit hooks that enforce code quality:
# Install hooks
./scripts/install-git-hooks.ps1
# Manual verification
cargo clippy -- -D warningsBuilt with ❤️ for the Rust community - Zero Warnings, No Mocks, Production Ready