How to Implement Automatic CLI Login

I’ve recently had the chance to work on an “automatic CLI login” feature for a CLI tool at my day job. What I mean by automatic CLI login here is when a CLI tool automatically logs in a user, so it can perform actions on behalf of the user. It usually works like this. When you type a command like cli login in your terminal, a login page will open in your web browser. After you log in, the page…