"The greenest energy is the energy we don't use."
GreenKode is a professional CLI tool that empowers developers to measure, analyze, and optimize the carbon footprint of their code. By bridging the gap between hardware sensors and high-level Python, we make sustainability a core part of the development lifecycle.
| Feature | Description | Tech Stack |
|---|---|---|
| 🔍 Static Scan | Detects inefficient patterns (e.g., O(n²) loops) before execution. | ast, typer |
| ⚡ Live Audit | Measures real-time CPU energy usage and CO2 emissions. | codecarbon, Intel RAPL |
| 📊 Rich Dashboard | Professional terminal UI with "Eco-Grades" (A+ to F). | rich |
| 🌍 Universal CLI | Single command access for any Python script. | pip, poetry |
pip install greenkode(Requires codecarbon, rich, typer)
Option A: Static Analysis (Pre-Flight Check) Instantly find bad code patterns without running the script.
greenkode check my_script.pyOption B: Live Energy Audit (Flight Recorder) Run your script and see the energy cost.
greenkode run my_script.pygreenkode --helpGreenKode leverages Intel RAPL (Running Average Power Limit) sensors to measure the exact energy consumption of the CPU in joules.
- Measurement: We track the power draw of the specific process ID (PID).
- Conversion: Joules are converted to kWh.
- Carbon Intensity: We apply the local grid's carbon intensity factor (gCO2/kWh) to calculate the final carbon footprint.
Created by: Ardellio Satria Anindito
Location: Bandung, Jawa Barat, Indonesia 🇮🇩
Competition: World of 8 Billion (Energy & Climate Change)
We have comprehensive documentation for users, developers, and judges:
- 🚀 Getting Started: Installation, usage, and troubleshooting.
- 📄 Technical Whitepaper (English): Deep dive into the problem, solution, and impact.
- 📄 Kertas Putih Teknis (Bahasa Indonesia): Penjelasan lengkap dalam Bahasa Indonesia.
- 🏗️ Architecture: System design and component interaction.
- 🤝 Contributing: How to build and contribute to GreenKode.