Brewless Brewless Docs

Command line

Signing in

How the command line client signs a machine in to your organisation, and where it keeps that sign-in.

On this page

The command line client signs a machine in to one organisation at a time.

brewless login acme

acme is the name of your organisation, as in acme.brewless.eu.

How it works

  1. The client shows a code, like ABCD-2345, and a link, and tries to open the link in your browser.
  2. In the console you type the code your terminal shows. The console then shows which machine asked and when; you approve after checking that.
  3. The client receives a token of its own for this machine.

The link never carries the code, so a link someone sends you approves nothing by itself. Approve only a sign-in you started yourself, in your own terminal.

Use --no-browser when the machine has no browser, and open the link on another device.

A sign-in has to be approved within 10 minutes. Starting one is limited to ten a minute per address, and sixty a minute for the organisation as a whole.

The token

The token acts as you in that organisation. It works for 90 days and can be ended at any time on the Account page of the console.

It is kept on the machine in ~/.config/brewless/credentials.json, readable by you only. Brewless keeps only a hash of it, which does not depend on any key of Brewless's own, so a sign-in keeps working when Brewless changes its keys.

Turning backups off, switching a lock mode and writing over a database from a backup also need a recent confirmation that it is you. Without one the API answers 403 with reauthentication_required. That confirmation is bound to the token: a code entered in the console does not count for the command line, nor the other way round.

In a pipeline

A pipeline does not sign in. It deploys with a pipeline token you make in the console and give it as BREWLESS_API_TOKEN. A pipeline token for one application may only deploy that one; one for all applications has your full rights. See Deploying from a pipeline.

Signing out

brewless logout acme

This forgets the sign-in on this machine.

Settings

Variable Meaning Default
BREWLESS_HOST The domain organisations live under brewless.eu
BREWLESS_HOME Where sign-ins are kept ~/.config/brewless
BREWLESS_API_TOKEN A pipeline token, used instead of the sign-in of the machine none