Token onboarding
The tokenin-onboarding extension guides first-time users through adding a Token-In account so Selesai can authenticate with the model provider. It also provides the /tokenin command to manage multiple accounts after onboarding.
Bundled with Selesai
Loaded automatically with Selesai; no per-extension npm install is required.
Setup and prerequisites
- This extension is bundled with Selesai. It is loaded automatically; you do not need to install it separately.
- Runs only on the first interactive startup (
event.reason === "startup") until the onboarding marker is written. - Requires an interactive TUI session.
- You need a Token-In token from
https://token-in.selesai.in/dashboard/tokens.
What it sets up
- Writes
~/.selesai/agent/.tokenInOnboardingCompleteonce onboarding completes or is skipped. - Stores the active credential in Selesai’s
auth.jsonviaAuthStorage. - Keeps multi-account details in
~/.selesai/agent/tokenin-auth.jsonwith file mode0o600. - The first account added during onboarding is set as active automatically.
What you can configure
Token onboarding uses environment suppression, an onboarding marker, and account storage. Credentials are sensitive values stored locally.
Configuration locations and precedence
- User marker and accounts
~/.selesai/agent/
Marker file and multi-account tokenin-auth.json live here.
Settings
| Key / path | Type, default, and values | Description |
|---|---|---|
.tokenInOnboardingComplete | marker file Default: — | Written when onboarding is complete so the prompt does not reappear. |
tokenin-auth.json🔒 | file Default: — | Multi-account TokenIN storage. Written with mode 0o600. |
providers.tokenin.apiKey🔒 | string Default: — | Legacy models.json key removed during onboarding. |
Environment variables
| Key / path | Description |
|---|---|
SELESAI_SKIP_TOKENIN_ONBOARDING | Set to 1 to disable the first-run TokenIN onboarding prompt. |
Command, tool, and shortcut controls
| Key / path | Description |
|---|---|
/tokenin add|switch|remove|usage | Manage stored TokenIN accounts and show quota usage. |
Source evidence
src/extensions/tokenin-onboarding.tsToken onboarding source
What you can do
- On first run, confirm that you want to connect Token-In, open the dashboard, paste the token, and activate the account.
- Add another account later with
/tokenin add. - Switch the active account with
/tokenin switch. - Remove a saved account with
/tokenin remove(cannot remove the active account; switch first). - Check your Token-In quota with
/tokenin usage: it queries the LiteLLM/key/infoendpoint with the active token and shows spend, budget, remaining, and reset time in a boxed display. - Save multiple tokens and rely on automatic failover. If the active key fails with a 401, 429, or budget/quota error, the extension rotates to another saved account and puts the failed key on a 5-minute cooldown before trying it again.
Commands, tools, and shortcuts
| Command | Description |
|---|---|
/tokenin add | Open the Token-In dashboard, paste a token, and add it to tokenin-auth.json. If it is the first account, it becomes active. |
/tokenin switch | Pick a saved account and make it the active credential. |
/tokenin remove | Pick a non-active saved account and remove it. |
/tokenin usage | Show Token-In quota: spend, budget, remaining, and reset time from the LiteLLM /key/info endpoint. |
The command validates that the pasted token starts with sk-. Invalid tokens are rejected and the prompt retries on the next launch.
Limits and safety
- Tokens are stored in
~/.selesai/agent/tokenin-auth.jsonwith mode0o600. The active key is also written to Selesai’sauth.json. - Do not commit
tokenin-auth.json,auth.json, or any file containing a token. - The onboarding prompt does not appear again after the marker file exists, even if the first attempt failed. Use
/tokenin addto retry or add another token. - After a failover, the newly active credential is written to both
tokenin-auth.jsonandauth.json, so the rotation survives new sessions. - The
/tokenin-onboardcommand does not exist; use/tokenin addor wait for first-run onboarding.