div whoami

Show the email the div CLI is currently signed in as on this machine.

div whoami

Prints the email address tied to the saved CLI session on this machine, plus the slug of the current folder if it's a deployed div project. One-line answer to "am I signed in, and as who?"

#Synopsis

div whoami

No flags.

#What it does

  1. Reads auth.json on this machine (~/.config/div/auth.json on Linux, ~/Library/Preferences/div/auth.json on macOS).
  2. If there's no saved session, prints Not logged in. Run div deploy to get started. and exits.
  3. If there is, prints ✓ Logged in as <email> using the email it captured at first verify (or via div login).
  4. If the current directory is a deployed div project (has a div.json with a non-null slug), prints a second line with the slug and its preview URL — handy for confirming you're about to deploy to the project you think you are.

#Aliases

  • div who — kept as an alias for backwards compatibility with pre-3.4.0 versions; new code and docs should prefer div whoami to match the convention of npm whoami, vercel whoami, fly auth whoami, etc.

#Examples

# Anywhere — just check the saved session
div whoami
# ✓ Logged in as you@example.com

# Inside a deployed project folder
cd my-site
div whoami
# ✓ Logged in as you@example.com
#   In project: my-site-a4f9d2 https://my-site-a4f9d2.div.so

# Not signed in (no auth.json yet)
div whoami
# Not logged in. Run div deploy to get started.

#When you need it

  • Sanity-check the active account before running a destructive command (div deploy overwrites files).
  • Confirm div login actually saved a session.
  • Debug a "this isn't deploying to my expected project" surprise — the second line tells you the cwd's slug and host.

#See also

  • div login — pair this machine's CLI with a div.so account.
  • div logout — revoke the saved session.
  • div deploy — what the saved session unlocks once you're signed in.
  • Authentication — how the credentials are stored.