Skip to main content

mr auth whoami

Print the identity and capabilities the server associates with the current credentials. Useful to confirm a token works and which role it has.

Usage

mr auth whoami

Examples

Show the current identity

mr auth whoami

As raw JSON

mr auth whoami --json

Flags

This command has no local flags.

Inherited global flags

FlagTypeDefaultDescription
--jsonboolfalseOutput raw JSON
--no-headerboolfalseOmit table headers
--pageint1Page number for list commands (default page size: 50)
--quietboolfalseOnly output IDs
--serverstringhttp://localhost:8181mahresources server URL (env: MAHRESOURCES_URL)

Output

Username, Role, IsAdmin, CanWrite and ScopeGroupId lines; --json emits the full /v1/auth/me object (authEnabled, userId, username, role, scopeGroupId, isAdmin, canWrite, superUser, csrfToken)

Exit Codes

0 success; 1 error (login failed, network error, or not authenticated)