It is possible to log in to Ansible Galaxy from the command line; you can do this by using the following:
$ ansible-galaxy login
This will ask for your GitHub username and password; if you have two-factor authentication enabled on your GitHub account, which you really should do, then this method will not work. Instead, you will need to provide a personal access token. You can generate a personal access token at the following URL: https://github.com/settings/tokens/. Once you have a token, you can use the following command, replacing the token with your own:
$ ansible-galaxy login --github-token 0aa7c253044609b98425865wbf6z679a94613bae89
The following screenshot shows the output for the preceding command:
Personal access tokens will give anyone who has one full access to your GitHub account; please store them securely and, if possible, rotate them regularly.