Although there is a significant growth of emerging online programming communities, little succeeded in encouraging members to contribute and share their knowledge. The role of leadership to address the under contribution problem is gaining attention among researchers. This study grounded on path-goal theory to Investigates specifically the role of supportive leadership and achievement oriented leadership behaviour toward knowledge sharing in online programming community (OPC). This introduced model is tested empirically using data collected from 20 online programming communities. The findings from the analysis suggests that self-efficacy and outcome expectancy influences knowledge sharing behaviour of members in online programming community. The finding implied that although online communities are informal in nature, the appropriate type of leadership can boost the members’ efficacy and outcome expectancy toward sharing their knowledge, with the suitable level of autonomy and recognition of members contributions can motivate members to continuously contribute to online programming communities and promoting the sustainability in this platform.