Sls login : how to login without browser?

I follow this doc to try the test capability of the serverless framework :
https://github.com/serverless/enterprise/blob/master/docs/testing.md

The framework is installed on an EC2 instance. My environment is the following one :

Your Environment Information ---------------------------
Operating System: linux
Node Version: 12.6.0
Serverless Version: 1.48.3
Enterprise Plugin Version: 1.3.2
Platform SDK Version: 2.0.4

The command “sls test” gives the following output :

Serverless: Run “serverless” to configure your service for testing.

So, I run the “serverless” command, that gives me the following output :

You can monitor, troubleshoot, and test your new service with a free Serverless account.

Serverless: Would you like to enable this? Yes

You are not logged in or you do not have a Serverless account.

Serverless: Do you want to register? No
If you have a Serverless account you can run “serverless login” to
login and then run “serverless” again to finish setup.

I already have a serverless account, so I run the command “sls login”, that gives me the following output :

Serverless: Logging you in via your default browser…

The problem is that I am on a EC2 instance, and there is no browser for opening the login page.
But, on the github link, there are screenshots that suggest that it can be done only using the CLI.

How can I login just using the CLI ?
If it is not possible, how can I login from an EC2 instance ?

Regards.

2 Likes

I am having a similar problem using a Visual Studio Code Remote Dev Container and came to the forums to search for this. Hopefully someone has a solution.

same here… i am evaluating some possibilities for monitoring and it would be nice if someone could provide feedback for this problem…

i used an environment variable of SERVERLESS_ACCESS_KEY with a personal access key (https://dashboard.serverless.com/tenants/TENANT_NAME/accessKeys) and was able to deploy within our azure devops pipeline. i think this would work for you, but not 100% sure