Wow that's very useful! I have also thought of completion but my idea was more like copilot. The user experience of your script should be better. I'm glad I didn't start to write that.
Regarding history in context, I suggest adding a record mode like ell. This really helps.
Password sanitizer is great. I will also add it as a plugin. Thank you for the idea!