Skip to main content

Authentication

To use the SitePack CLI, you need to authenticate with your SitePack account. This ensures you have the necessary permissions to manage apps, themes, and organizations.

Logging In​

Run the following command in your terminal to start the authentication process:

sitepack login

This will open your default web browser and prompt you to sign in to your SitePack account. Once authorized, the CLI will store a secure token locally.

Preview of the Login Process​

$ sitepack login
? Select the account you want to use: sitepack.dev
✔ Authentication successful. Welcome, [username]!

Two-factor authentication​

Signing in happens in the browser against your normal SitePack account, so it goes through the same two-factor gate as the Admin Portal. There is nothing CLI-specific to configure.

  • Email code (default). On a browser SitePack does not recognise, you confirm the sign-in with a 6-digit code sent to your account's email address.
  • Authenticator app (TOTP). If you have enabled an authenticator app on your account, you confirm with the current code from that app (or a backup code) instead of the email code. Staff accounts are required to use an authenticator app. You set this up under My account → Security in the Admin Portal.
  • Trusted browser. After you verify, that browser stays trusted and is not challenged again for a while, up to about a week. Trust is bound to the browser (a device cookie), not to your IP address, so changing network or location does not force a new challenge. Clearing the browser's cookies, or revoking the device under My account → Security, makes the next sitepack login prompt for a second step again.

Checking Authentication Status​

To check which account you are currently logged in with, use the whoami command:

sitepack whoami

This will display your username and the currently active organization.

Logging Out​

If you need to remove the authentication credentials from your local machine, use the logout command:

sitepack logout

After logging out, you will need to run sitepack login again to perform any actions that require authentication.