I've used forest before. Pushing commits feels just as good. I follow a couple pomodoro streamers.. The common denominator is, okay, I'll aim to get this or that done today, but if I can set out to work for x hours and do it, that the time itself can be an accomplishment. That keeps me going until I hit an actual milestone.
But the truth is, if I'm well rested, well fed, well hydrated, working on something I desire, how can I not be productive. The gym and the bed are such powerful places. Strategic keto/fasting too.