Docs › Get started › Signing in

Signing in

How the editor signs in through your browser, the code you can paste instead, how long a session lasts, and how to sign out.

On this page

AstraCode signs in through your browser. You approve the sign-in on astracode.io, and the editor receives a session it keeps in your operating system's keychain. You need to be signed in for chat, the agent, completions and dictation.

Where you can start signing in

Your own API key does not replace signing in. With a key set and no session, the sign-in window still shows. See Bring your own key.

Signing in through the browser

  1. Choose Log In (or run AstraCode: Sign In). A notification says Signing in to AstraCode in your browser… and your browser opens.
  2. If you are not signed in on the site, sign in there, or create your account. The site asks for your email and sends you a code. If your email is not confirmed yet, it asks you to confirm it first.
  3. The page Sign in to AstraCode desktop shows the account the editor will use. Choose Sign in. To use a different account, choose or sign in with another account.
  4. The browser says All set! and hands you back to the editor. The editor says Signed in to AstraCode. You can close the browser tab.

Only choose Sign in on that page if you just started signing in from AstraCode yourself. The page says the same.

Diagram: the editor opens the browser, you approve on astracode.io, the browser hands a one-time code back to the editor on 127.0.0.1, and the editor is signed in. When the browser cannot reach the computer, you paste a code instead.
The browser sign-in, and the paste-a-code route for when the browser cannot reach the editor.

How it reaches the editor

While you sign in, the editor listens on a temporary port on your own machine, http://127.0.0.1:<port>/callback. When you approve, the browser sends a one-time code to that address, and the editor swaps it for a session. The listener exists only while a sign-in is in progress. The code cannot be used by anything else: it only works together with a secret that never leaves the editor.

The editor waits up to 30 minutes for you to finish in the browser, long enough to create an account. To stop waiting, choose Cancel on the Signing in to AstraCode in your browser… notification.

Choosing Cancel on the browser page does not tell the editor. It keeps waiting; cancel the notification in the editor too, then start again.

Signing in with a code

Sometimes the browser cannot reach the editor's temporary port: the editor is running on another computer, or something on your machine blocks 127.0.0.1. Then you sign in with a code instead: the browser shows a code and you paste it into the editor.

When the editor offers it

Paste the code

  1. Choose Use a code instead, or choose Log In in a remote window. Your browser opens and the editor shows a box titled Sign in to AstraCode: Approve the sign-in in your browser, then paste the code it shows.
  2. In the browser, sign in if asked, then choose Sign in on Sign in to AstraCode desktop.
  3. The page Paste this code into AstraCode shows a code. Choose Copy.
  4. Paste it into the box in the editor and press Enter. Spaces and line breaks are removed for you. The editor says Signed in to AstraCode.

The box stays open when you switch to the browser, so you can copy and come back. Press Escape to give up without signing in.

A code works once, for five minutes Paste it straight away, and only into an AstraCode you started yourself, just now. AstraCode never asks for this code by email, chat or on another website. If the code is refused, the editor says why and adds A code works once, for five minutes. Choose Try again for a fresh one.

The AstraCode CLI has the same flow: astracode-agent login --code. See AstraCode CLI.

Two links open AstraCode and start signing in, which is how the website's buttons hand you to the editor:

LinkWhat it does
astracode://astracode.astracode-ai/signinRuns AstraCode: Sign In.
astracode://astracode.astracode-ai/signupRuns AstraCode: Sign Up.

Both do something only while you are signed out. Signed in, the link just brings the editor to the front.

How long a session lasts

The session is stored in your operating system's keychain (Keychain on macOS, Credential Manager on Windows, the Secret Service on Linux), never in a settings file.

Signing out

  1. Open AstraCode Settings: run AstraCode: Open Settings.
  2. On General, choose Log out in the account panel at the top.
  3. Confirm Log Out in Log out of AstraCode?. The editor says Logged out. and the sign-in window returns.

There is no sign-out command in the command palette; the Settings button is the way. To manage the account itself, choose Manage account on the same panel, which opens your dashboard on astracode.io.

Sign In with a Token, for gateway operators

AstraCode: Sign In with a Token is for organisations that run their own AstraCode gateway and issue sign-in tokens to their people. It is not the code from the paste flow above.

  1. Run AstraCode: Sign In with a Token.
  2. In AstraCode sign-in token, paste the token your gateway issued and press Enter.
  3. The editor says Signed in to AstraCode.

The token is stored as it is, without being checked. A wrong token shows up on your first request, as The gateway rejected this token. If you did not get a token from your administrator, use AstraCode: Sign In instead.

Which gateway the editor talks to is the setting astracode.gatewayUrl (default https://api.astracode.io), under Browser & Network, Gateway in AstraCode Settings. It can only be set for your user, not by a project, so a repository cannot send your credentials elsewhere.

Signing in from the CLI

The CLI has its own sign-in, astracode-agent login, with the same browser flow and the same paste-a-code fallback. See AstraCode CLI.

If something goes wrong

Every message, with its cause and fix, is in Sign-in problems.

← Install AstraCode The chat panel →

All documentation

Get started

Using the editor

Agent

Context

Workspaces

Connectors

Extending AstraCode

CLI

Account and usage

Troubleshooting

Reference