Reference

apex whoami

Who the CLI is acting as, with which credential, and where it found it

apex whoami [options]
Options
OptionDescription
--jsonmachine-readable output

Examples

Who the CLI acts as, with which credential, and when it expires.

apex whoami

The same, for a script.

apex whoami --json