Those are both things that a window manager doesnt really do. I havent used i3 much but ill try to point you in the right directions.
For caffeine, depending on your bar, i believe most of them have modules for that.
Then for locking/shutting down, you'd want to look at i3lock, xautolock, xidlehook, and probably many others. Can't guide you to the right commands, but this forum thread seems to have a lot of the info you're looking for: https://bbs.archlinux.org/viewtopic.php?id=208699
Its really just Arch with an installer. No more or less reliable