DocsGetting StartedAuthentication

Authentication

How to authenticate with ServerMe.

There are three ways to authenticate with the CLI:

Opens your browser to sign in with Google:

bash
serverme login

This saves a JWT token to ~/.serverme/authtoken automatically. You only need to do this once.

2. API key

Get an API key from your dashboard, then:

bash
serverme authtoken sm_live_your_key_here
  • API keys are useful for:
  • CI/CD pipelines
  • Shared machines
  • Programmatic access via SDKs

3. Email + password

bash
serverme login:email --email you@example.com --password yourpassword

How it works

  • serverme login saves a JWT token (expires in 24 hours, auto-refreshes)
  • serverme authtoken saves an API key (never expires unless revoked)
  • Both are stored at ~/.serverme/authtoken
  • The CLI reads this file automatically on every command

For SDKs

Pass your API key directly:

typescript
import { ServerMe } from '@serverme/sdk';
const client = new ServerMe({ authtoken: 'sm_live_...' });
python
from serverme import ServerMe
client = ServerMe(authtoken="sm_live_...")