Log in with the CLI
This tutorial connects the CLI to your account: you create a personal access token in the platform UI, then log in with it from your terminal.
What you will accomplish
By the end of this tutorial you will have:
- A personal access token saved securely
- The CLI logged in to your account, ready to run commands
Before you begin
- You have completed Set up your account, so your email is verified.
- The CLI is installed; see Install the CLI.
Steps
1. Create a personal access token
A personal access token is required to authenticate the CLI.
- Open the account menu (your avatar in the top bar), click Settings, then click Personal Access Tokens in the sidebar.
- Click Generate new token. If you signed in more than two hours ago, the platform first asks you to sign in again, then brings you back with the dialog open.
- Give the token a descriptive name such as
cli-localin Token name. - Choose an Expiration.
- Click Generate token.
- Copy the token value now — it is shown only once.
Store the value in a password manager or other secure location.
2. Log in from your terminal
Open a terminal and run:
swale login --account-name <account-name>
Replace <account-name> with the account name you chose during registration. When the command asks for Token:, paste the token value you copied in step 1. What you paste stays hidden, and it never reaches your shell history.
The command checks the token with the platform, stores it on this machine and makes this account the CLI's current account. It prints Logged in to account '<account-name>'. If it prints an error instead, it has stored nothing: run swale login again with the correct account name and token.