cirrux

How do I sign in to the Cirrux CLI on a server without a browser?

Run cirrux login --no-browser on the server. It shows a short code that you enter on your laptop or phone, and the server is signed in. The login keeps itself fresh as long as it's used at least once every 30 days.

On a server, cirrux login can't open a browser. Sign in with a code instead:

cirrux login --no-browser

The CLI prints a link, https://auth.cirrux.co/device, and a short code. Open the link on any device, such as your laptop or phone, sign in, enter the code and pick the workspace. The CLI on the server finishes on its own once you approve. The server needs no open ports for this. Over SSH, the CLI picks this way of signing in by itself.

Then check it worked with cirrux whoami.

Give the server only what it needs

--scopes limits what this one login may do, and the approval screen only offers those:

cirrux login --no-browser --scopes calendar.read,calendar.write,tasks.read,tasks.write,email.read,docs.read

The login on your own computer keeps everything it has. cirrux whoami shows what the current login holds, and the CLI page lists every scope.

How long it stays signed in

Each login refreshes itself as it's used, so a server that runs the CLI at least once every 30 days stays signed in. After 30 days without use, sign in again. Every login appears under Settings → Security → Sessions in Cirrux Mail, where you can revoke the server's login without signing out anywhere else.

Sign in on each machine separately. Copying ~/.cirrux/credentials.json from your laptop to a server breaks both after a while: every refresh hands out a new token and retires the old one, so the copies fall out of step.

What about an API key?

A workspace API key needs no login at all, but it only works with mail: it belongs to the workspace, not to a person. For calendars, tasks, Drive and documents, sign in as above. See letting a script read and send mail.

Still stuck? Email help@cirrux.co and we’ll help you out.