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]
| Flag | Description |
|---|---|
--dev | Required. Use the local dev token. Without --as, you act as the built-in admin dev user. |
--as EMAIL | Act as an enabled directory user (the token becomes <base token>:EMAIL). Handy for trying the platform as an owner or a non-admin. |
--api URL | API base URL. Default $TC_API, else http://localhost:4780. |
--token TOKEN | Base 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?