Account Guide
Overview
This chapter covers all account-related commands and workflows in the CLI. It applies to scenarios such as:
- Using the CLI for the first time and needing to log in before invoking remote services.
- Switching between multiple devices, or having your login session expire after a long period of inactivity.
- Wanting to temporarily switch accounts within a session without exiting the current conversation.
- Needing to check how much longer your current session will remain valid.
This chapter covers: logging in, checking login status, logging out, and the corresponding in-session commands.
Command Reference and Invocation
unitarylab login: Interactively prompts for your account and password.unitarylab whoami: Displays your account identifier and remaining session validity.unitarylab logout: Clears locally stored login credentials.- In-session
/login,/whoami,/logout: Perform the corresponding operations without exiting the current session.
In-session commands mirror their CLI subcommand counterparts but are used in different contexts: CLI subcommands are invoked in the shell and affect the login state of the entire device, while in-session commands are invoked during a conversation and apply to the current session.
Logging In
Logging in is a prerequisite for using the CLI’s remote capabilities. Run:
unitarylab loginYou will be prompted in sequence for:
- Account: A phone number (preferably with a country code such as
+86) or an email address. - Password: Input is not echoed to the screen.
Checking Login Status
To verify whether your current token is still valid, run:
unitarylab whoamiThe CLI will display your account identifier and the remaining validity period. A remaining validity of less than 60 seconds is treated as expired, and you will need to log in again.
To check your login status without exiting a session, run /whoami within the session:
[agent│deepseek-v4-pro] › /whoamiThe output is identical to that of unitarylab whoami.
Logging Out
Run:
unitarylab logoutThe CLI will clear the locally stored login state. However, this does not affect:
- The account’s status on the remote server.
- Login sessions on other devices.
After logging out, any command requiring remote credentials will prompt you to log in again.
In-Session Commands
The session provides equivalent commands so you can manage login state changes without exiting:
| In-Session Command | Behavior |
|---|---|
/login | Re-authenticates within the session and refreshes the current session’s token without exiting. |
/whoami | Parses the current token and displays the account identifier and remaining validity. |
/logout | Clears the local token; the next tool call will return a 401 response and prompt you to run /login. |
A typical scenario:
[agent│deepseek-v4-pro] › Help me solve a 1D heat equation
(The agent calls a tool; the remote server returns 401)
Please log in again: run /login within the session, or exit the session and run unitarylab login
[agent│deepseek-v4-pro] › /login
Account: +8617700000000
Password: ********
✓ Login successful
[agent│deepseek-v4-pro] › Help me solve a 1D heat equation
(Retry succeeds)Session Expiration
When your login session expires and re-authentication is required, the model will prompt you to run /login within the session or return to the shell and run unitarylab login.
Recommendations
- On shared or untrusted devices: Run
/logoutorunitarylab logoutwhen you are finished. - On personal development machines: Logging in once is sufficient; the CLI will automatically remind you when your session expires.
- When you see a “please log in again” prompt: Prefer the in-session
/loginto preserve your current session context and avoid interrupting the conversation. - When switching between multiple accounts: Run
/logoutfollowed by/login, or maintain separate login states in different terminal windows.