Skip to Content

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 login

You will be prompted in sequence for:

  1. Account: A phone number (preferably with a country code such as +86) or an email address.
  2. Password: Input is not echoed to the screen.

Checking Login Status

To verify whether your current token is still valid, run:

unitarylab whoami

The 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] › /whoami

The output is identical to that of unitarylab whoami.

Logging Out

Run:

unitarylab logout

The 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 CommandBehavior
/loginRe-authenticates within the session and refreshes the current session’s token without exiting.
/whoamiParses the current token and displays the account identifier and remaining validity.
/logoutClears 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 /logout or unitarylab logout when 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 /login to preserve your current session context and avoid interrupting the conversation.
  • When switching between multiple accounts: Run /logout followed by /login, or maintain separate login states in different terminal windows.

Last updated on