login
Open a browser window so you can sign in to Stockbit, then verify with status before using market data tools.
Instructions
Open a browser window so the user can sign in to Stockbit. Nothing else here works until they have.
ASK THE USER FIRST, then call with confirm: true. This opens a real, visible window on their machine; where the client supports elicitation they are also asked directly.
It returns in about a second, BEFORE the login finishes — a person takes minutes and every client has a tool-call timeout. Tell them to sign in in the window that opened, then call status to see whether it worked. Do not call this again while status says a login is in progress.
The captured token goes straight to the keychain (or the encrypted file store off macOS). It is never returned here and never shown to you.
If the browser is ALREADY signed in to Stockbit, it no longer waits fifteen minutes for a form that will never appear: it reads the credential out of the browser's own session and finishes in seconds, and if there is nothing usable there it signs that profile out and re-opens the login page.
switch_account: true is for signing in as a DIFFERENT account — it clears the browser's Stockbit session first and never reuses what was there. Ask the user before using it; it signs them out of Stockbit in that browser profile.
Refuses when STOCKBIT_NO_BROWSER is set (to anything but 0/false/no/off), and names the terminal command instead. It also refuses if a session is already stored, unless force: true (which switch_account implies).
This does NOT log in to the trading account: that needs a 6-digit PIN typed at the user's own terminal via stockbit-auth trading-login, and no tool here accepts a PIN.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| force | No | Log in again even though a session is already stored. | |
| confirm | Yes | Must be true, and only after asking the user in words. | |
| fresh_profile | No | Use a throwaway browser profile instead of the saved one — nothing carried over, so the user re-enters password and OTP. For a profile that is corrupt or held open by another process. To sign in as a different account, use switch_account instead. | |
| switch_account | No | Sign the current Stockbit account OUT of the browser profile first, then show a real login form. For logging in as someone else. Implies force. |