Connectivity first
It knows you're offline before it tries to log you in. predev lets you carry on offline; auth stops.
predev
Checks that you're online and logged in to gcloud, aws and az before you work, and logs you in when you're not.

Why
You run bun dev or tofu plan. Halfway through, it dies with invalid_grant, ExpiredToken or AADSTS700082. You look up the right login command, log in, and run it again.
cloudsesame checks everything in a few seconds before you start, and offers the exact fix:
$ bunx cloudsesame infra
✔ online
✖ gcloud user me@acme.dev reauthentication required
→ gcloud auth login --update-adc
✔ gcloud adc
✔ gcloud quota project acme-billing
✔ aws prod arn:aws:sts::222222222222:assumed-role/Admin/me
? gcloud isn't ready.
❯ Log in (l) gcloud auth login --update-adc
Skip (s)
Stop (x)
Install
The npm package runs on Node ≥ 18 or Bun; the interactive UI needs Node ≥ 22 (older versions get plain output). Standalone binaries need no runtime.
bunx cloudsesame # run without installing
npx cloudsesame
npm install -g cloudsesame # or: bun add -g cloudsesamebrew install NexiHealth/tap/cloudsesamescoop bucket add NexiHealth https://github.com/NexiHealth/scoop-bucket
scoop install cloudsesamechoco install cloudsesame# Download the archive for your platform from
# https://github.com/NexiHealth/cloudsesame/releases/latest
# extract it and put `cloudsesame` on your PATH.Configure
cloudsesame init writes a starter config from the CLIs you have installed. It holds no secrets: just what to check and what counts as ready.
No config at all? cloudsesame checks every cloud CLI you have installed, with default settings.
Then hook it into your scripts: predev runs before dev and is lenient, a group like infra makes sure everything a tofu plan needs is logged in.
import type { Config } from "cloudsesame";
export default {
gcloud: { credentials: "adc", project: "acme-dev" },
aws: [
{ profile: "staging", accountId: "111111111111" },
{ profile: "prod", accountId: "222222222222" },
],
groups: { infra: ["gcloud", "aws"] },
} satisfies Config;{
"$schema": "https://unpkg.com/cloudsesame/dist/schema.json",
"gcloud": { "credentials": "adc", "project": "acme-dev" },
"aws": [
{ "profile": "staging", "accountId": "111111111111" },
{ "profile": "prod", "accountId": "222222222222" }
],
"groups": { "infra": ["gcloud", "aws"] }
}{
"scripts": {
"predev": "cloudsesame predev", // before `dev`: lenient, skipping is fine
"auth": "cloudsesame infra", // log in to everything infra needs
"plan": "cloudsesame infra && tofu plan" // never start a plan with expired credentials
}
}Automation
Without a terminal, prompts become failures with the command to run, or skips with --skip. Scripts, CI and agents branch on the exit code.
tofu plan after a login.Set it up once in your repo, and every run starts online and logged in to the right accounts.