AI Workforce OneHQDocs

Sign in

Sign in by approving this computer with a one-time code that you type into HQ in your browser. Your editor gets its own access, separate from the hq CLI.

Sign in

  1. Run HQ: Sign In

    Press Sign in in the Teams view, or run HQ: Sign In from the Command Palette (Ctrl+Shift+P, or Cmd+Shift+P on macOS). The extension asks HQ for a one-time code, copies it to your clipboard, and opens HQ's approval page in your browser:

    Enter BCDF-GHJK in the browser (copied). Waiting for approval.

    Press Cancel on that message to stop. The message closes by itself once the sign-in is approved, cancelled or fails.

  2. Approve it in HQ

    Sign in to HQ if you are not already, then paste or type the code. The page never fills it in for you, so a link someone else sent you cannot approve their computer. Check that the device name matches yours (for example Visual Studio Code on my-laptop), pick the organizations it may reach, and confirm with your password or your two-factor code.

  3. Back in the editor

    The extension notices the approval within a few seconds and says "Signed in to AI Workforce One HQ as you@example.com." The Teams view fills in.

The code expires after 10 minutes.

Run HQ: Sign In again for a new one. Denying the request in the browser ends the sign-in at once.

If you have more than one editor window open, sign in from one of them. The other windows say "Signing in to AI Workforce One HQ from another VS Code window. Wait for it to finish, or sign in here instead." A window that had no account yet uses the new one once the sign-in finishes.

Its own access

The extension gets its own access to HQ, separate from hq login. Each one is listed in HQ, under Account, Devices, and each can be removed on its own. Manage devices in HQ, in the extension's Account view, opens that page.

Use more than one account

You can be signed in to more than one HQ account at once, for example your agency account and a client's own account. Each window works as one of them, and two windows can work as two accounts at the same time.

  1. Sign the browser in as the other account

    The browser approves as whoever is signed in to HQ in it. Sign out of HQ in the browser and sign in as the account you want to add, or use a private window. The approval page says who is approving: "Approving as owner@client.com · Not you? Sign out".

  2. Run HQ: Add Another Account

    Press Add another account... in the Account view, the + in the Teams view's title bar, or run HQ: Add Another Account. In VS Code's Accounts menu, signing in to AI Workforce One HQ again does the same. Approve the code in the browser as before. The extension says "Signed in to AI Workforce One HQ as owner@client.com. This window now uses it."

  • Each account is its own access. Each one is its own row in HQ, under Account, Devices, and can be removed on its own.
  • Switch the window's account from the status bar: with more than one account signed in, clicking it opens Choose an account. The Account view and HQ: Switch Account do the same. Switching changes what this window's Teams view shows and which account new terminals, folders and forwards use. Terminals, folders and forwards you already opened stay open, each working as the account that opened it.
  • Names show the account. With more than one account signed in, folder names, terminal tabs and port rows end in a short form of the account, such as owner@client.
  • Each VS Code profile keeps its own accounts. In a new profile, sign in again.

If the browser approves as an account that is already signed in here, nothing is added: "The browser approved this sign-in as a@agency.com, who is already signed in here, so it was not kept. ..." The extension ends that new access in HQ at once.

Going back to version 0.1

If you install version 0.1 again, the account you used with 0.1 keeps working, with no new sign-in. Version 0.1 shows only that account. Folders opened in 0.2 as another account do not open there ("This team is not available on this sign-in."); they never open as the 0.1 account. The other accounts' access stays listed in HQ, under Account, Devices: remove the ones you no longer use. Updating to 0.2 again brings every account back, with no sign-in.

Where the sign-in is kept

In your editor's secret storage on this computer: the system keychain on macOS and Windows, and the Secret Service (for example GNOME Keyring or KWallet) on Linux. On Linux without a keyring, the editor keeps it with weaker protection, and the extension says so once: "Your HQ sign-in is stored without the system keychain on this computer."

Check who is signed in

The status bar shows HQ: and the email of the account this window uses. The Account view in the HQ sidebar lists every account signed in on this computer, marks the one this window uses "Active in this window", and has Manage devices in HQ under each, Add another account... and the HQ address. Manage devices in HQ opens HQ in your browser, signed in as whoever the browser is signed in as.

Sign out

Run HQ: Sign Out to sign out of the account this window uses, or press the sign-out icon beside an account in the Account view or in Choose an account. With more than one account signed in, the extension asks first: "Sign out of a@agency.com? Its HQ terminals and port forwards close in every window." HQ ends that account's access, and its terminals and port forwards close in every window. Other accounts are not touched. A window that was using the account you signed out of shows "You have other HQ accounts signed in on this computer." with Switch Account and Add Another Account; it never switches to another account on its own.

If HQ cannot be reached, the extension still signs you out on this computer and says "Signed out on this computer. HQ could not be reached to end this computer’s access; remove it in HQ, under Account, Devices."

When access ends from HQ

If you or an admin remove this computer in HQ, or an account's access ends another way, the extension says "Your access to HQ as a@agency.com ended on this computer. Sign in again, or switch to another account.", closes that account's terminals and port forwards, and offers Sign in.

If your sign-in needs renewing, the extension says "Your HQ sign-in as a@agency.com needs renewing." Press Sign in and approve as that same account. If the browser approves as someone else, that approval is ended at once and the extension says "You approved as owner@client.com, but this account is a@agency.com. ..." Sign the browser in as the right account and try again.

The HQ address

The extension signs in to https://hq.aiworkforceone.com. The hq.host and hq.allowedHosts settings exist for AI Workforce One staff; leave them as they are. Changing the address needs a new sign-in.

If it fails

MessageWhat to do
"The sign-in was denied in the browser."Someone chose Deny on the approval page. Sign in again.
"This sign-in code expired. Sign in again."The 10 minutes ran out. Start over.
"HQ for VS Code is not available on this HQ yet."This HQ address does not offer the extension. Check hq.host.
"Could not sign in: ..."Read the reason. If it says HQ could not be reached, check your connection.
"Your HQ sign-in as a@agency.com needs renewing."Press Sign in and approve as that account.
"You approved as owner@client.com, but this account is a@agency.com. ..."The browser was signed in as another account. Sign the browser in as a@agency.com, then sign in again.
"The browser approved this sign-in as a@agency.com, who is already signed in here, so it was not kept. ..."To add another account, sign the browser in as that account first.
"Too many HQ sign-ins were started from this network. Wait a minute and try again."Wait a minute, then sign in again.

More in Troubleshooting.