Skip to main content

Login and whoami

tc login​

Saves the API URL and a token to the config file, after checking them with GET /api/whoami.

tc login --dev [--as EMAIL] [--api URL] [--token TOKEN]
FlagDescription
--devRequired. Use the local dev token. Without --as, you act as the built-in admin dev user.
--as EMAILAct as an enabled directory user (the token becomes <base token>:EMAIL). Handy for trying the platform as an owner or a non-admin.
--api URLAPI base URL. Default $TC_API, else http://localhost:4780.
--token TOKENBase token. Default $TC_DEV_TOKEN, else dev-token.

Output

Logged in to http://localhost:4780 as Ben Carter <ben.carter@contoso.com>

Errors: M1-local only supports tc login --dev without --dev; UNAUTHORIZED if the token is rejected (dev tokens work only when the server sets TC_DEV_TOKEN).

Availability

Only --dev exists today. Company sign-in for the CLI (device code or browser) arrives with the platform's OAuth authorization server.

Example

tc login --dev --as megan.bowen@contoso.com

tc whoami​

Shows the signed-in user and the API you're talking to.

tc whoami [--json]

Output

Ben Carter <ben.carter@contoso.com> @ http://localhost:4780

JSON

{
"user": { "id": "…", "email": "ben.carter@contoso.com", "name": "Ben Carter", "isAdmin": false, "roles": { "orgAdmin": false, "auditor": false, "approver": false, "builder": true, "delegated": [] } },
"product": "vastframe",
"version": "0.0.4-m4"
}

Errors: Not logged in. Run tc login --dev. when there's no token.

Was this page helpful?