Skip to content

Configuration ​

A config file says which clouds a project needs and what counts as ready. It holds no secrets, so commit it.

Where it lives ​

cloudsesame uses the nearest config file, looking from the current directory up to the git root:

sesame.config.ts · sesame.config.mts · sesame.config.js · sesame.config.mjs · sesame.config.json

Use --config <file> (-c) to point at one explicitly, or cloudsesame init to generate one from your installed CLIs (--json for JSON, --force to overwrite).

No config?

With no providers configured, every provider whose CLI is installed is checked with default settings.

TypeScript ​

ts
// sesame.config.ts
import type { Config } from "cloudsesame";

export default {
  gcloud: { credentials: "both", project: "my-project" },
  aws: [{ profile: "dev" }, { profile: "prod", accountId: "123456789012" }],
  groups: { infra: ["gcloud", "aws"] },
} satisfies Config;

The import type is erased at runtime, so cloudsesame doesn't need to be installed in the project (install it as a dev dependency for editor autocompletion). TypeScript configs load in Bun, the standalone binaries, and Node 22.18+. On older Node, use JSON.

JSON ​

json
{
  "$schema": "https://unpkg.com/cloudsesame/dist/schema.json",
  "gcloud": { "credentials": "adc" },
  "aws": { "profile": "dev" }
}

The $schema gives you validation and autocompletion in editors that support JSON Schema.

Providers ​

Each provider takes one target or a list of targets. Every target is checked separately: two AWS profiles are two checks, each with its own login.

ProviderOptions
gcloudcredentials, account, project, quotaProject, permissions
awsprofile, accountId
aztenant, subscription, actions, dataActions, permissionScope
wrangleraccount
cloudflaretokenEnv, accountId, zones
sentrytokenEnv, url, organization, scopes

Each provider's page lists what its options do, what's checked, and its quirks.

Groups ​

Name the sets of providers your workflows need, then pass the group name as an argument:

ts
export default {
  gcloud: { credentials: "adc" },
  aws: { profile: "prod" },
  az: {},
  groups: { infra: ["gcloud", "aws"] },
} satisfies Config;
sh
cloudsesame infra          # auth for gcloud and aws only
cloudsesame check infra    # report for gcloud and aws only

Group names work anywhere a provider name does, and you can mix them: cloudsesame infra az.

Behavior ​

These decide what happens when something isn't ready. Flags override them for a single run.

OptionDefaultDescription
offline"prompt"predev when offline: "prompt" asks whether to continue, "continue" warns and continues, "fail" exits. auth always fails offline.
unauthenticated"prompt"When a provider isn't ready: "prompt" asks (log in / skip / stop), "login" logs in right away, "skip" warns and continues, "fail" exits.
noTerminal"fail"What "prompt" becomes without a terminal (CI, agents, pipes): "fail" or "skip".
animation"after-login"The open-sesame animation when everything is ready: "after-login", "always" or "never". Never plays without a terminal, in CI, or with NO_COLOR.

Connectivity ​

OptionDefaultDescription
onlineCheck"www.gstatic.com:443"host:port probed (TCP) to detect connectivity, or false to skip the check.
timeout20000Timeout per check, in milliseconds.

Cache ​

Running several commands in a row (cloudsesame infra -- tofu plan, then tofu apply, then a script) checks every provider each time. Turn on the cache to reuse a recent pass:

json
{ "cache": true }
OptionDefaultDescription
cachefalsetrue reuses checks that passed in the last 30 seconds; a number sets the seconds, e.g. 120.
  • Only targets that passed are remembered. Anything not ready is checked (and prompted for) as usual, and a failure forgets the earlier pass.
  • A result is reused per target and per identity environment: changing the target's config or a variable like AWS_PROFILE, CLOUDSDK_CONFIG or a token checks again.
  • Reused results show (cached), and keep their original time, so repeated runs don't keep them alive past the TTL. When every target is cached, the connectivity check is skipped too.
  • check always checks, and --fresh checks everything for one run. Both still record the results.
  • With a command after --, a cached Cloudflare login's token is read again from cf's login file instead of running cf auth whoami, as long as it's valid for at least 5 more minutes. Otherwise cf refreshes it as usual.
  • Results live in ~/.cache/cloudsesame/checks.json ($XDG_CACHE_HOME, %LOCALAPPDATA% on Windows), readable only by you. It holds statuses and hashed keys, never tokens.

Validation ​

An invalid config exits with code 2 and names the field, for example aws[1].accountId when an account ID isn't 12 digits, or gcloud[0].quotaProject when it's set with credentials: "user", or gcloud[0].permissions without a project. Unknown fields are errors too, so typos don't go unnoticed.

Ready-made configs for common setups are in Recipes.