Sign in from a terminal or a script

The browser sign-in, a key for scripts and CI, where it is stored, and signing out.

In a terminal: the browser sign-in

hostemi login starts a device sign-in: it opens the Hostemi page in your browser, you sign in and approve this computer, and the CLI stores the key it receives. Nothing to copy, no password typed into the terminal, and no booking platform login is involved.

Without a terminal (a script, an agent) it never waits by default: it prints the sign-in link on stderr and exits with code 3. Add --wait to keep waiting for the approval instead.

Where the key is kept

WhatWhere
Config file~/.config/hostemi/config.json (or $XDG_CONFIG_HOME/hostemi/config.json), readable only by you (mode 600, folder 700)
Sign outhostemi logout removes the stored key
Checkhostemi whoami shows which API the key talks to, and whether it still works

Scripts and CI: a key

Create a key in Hostemi under Settings, AI & apps (an API key starts with hst_). Pass it in HOSTEMI_TOKEN: it wins over a stored key and is never written to disk. Or store it once from stdin, which checks it first:

Environment

export HOSTEMI_TOKEN=hst_your_key
hostemi bookings --json
A key is a password for your workspace. Keep it in a secret store, never in source code; a key follows its owner's current role in the workspace.

Not signed in

Command
hostemi whoami
Output (recorded, exit 3)
Error: Not signed in.
  Run: hostemi login (or set HOSTEMI_TOKEN).

Another API address

--api <url> or HOSTEMI_API_URL point the CLI at another API (the default is https://api.hostemi.com); HOSTEMI_APP_URL changes where approval links point.

Something missing from this page? Write to [email protected], or use the form on the Help page.