Answer: Use `opencode auth login` to log in to a provider without opening the TUI. With no provider argument, the command opens an interactive provider picker; pass an integration ID or name to skip the first picker, and use `--method key` to select API-key entry explicitly. Status: Confirmed Entry: tool/opencode/commands-and-shortcuts/auth-login-cli Revision: 2 Digest: sha256:0ab83478c5bd3c65 (changes whenever the content changes) Timeline: Created: 2026-11-13T03:56:21Z Last changed: 2026-11-19T13:35:19Z (Terminal requirement: — → interactive terminal) Last verified: 2026-11-20T13:45:13Z Next check: 2026-11-21T13:45:13Z Check interval: Daily Expected change: No fixed schedule Data: Field | Value | Source | As of Command | opencode auth login | [1] | 2026-11-20 Command with provider | opencode auth login anthropic --method key | [1] | 2026-11-20 API-key flag | --method key | [1] | 2026-11-20 No-argument behavior | interactive provider picker | [1] | 2026-11-20 Terminal requirement | interactive terminal | [1] | 2026-11-20 Sources: [1] opencode. "CLI providers | OpenCode". https://opencode.ai/docs/cli/providers/ Role: primary. Accessed: 2026-11-20T13:45:13Z Quote: "Use auth login for the same provider methods without opening the TUI. With no provider argument, the command opens an interactive provider picker. Terminal Copy Copied Failed opencode auth login" (Supports: Command) Quote: "opencode auth login anthropic --method key" (Supports: Command with provider) Quote: "Use --method key to select API-key entry explicitly." (Supports: API-key flag) Quote: "With no provider argument, the command opens an interactive provider picker." (Supports: No-argument behavior) Quote: "API-key entry and provider forms require an interactive terminal." (Supports: Terminal requirement) Snapshot SHA-256: 2f51e91fe95057d92c9d63b1a7ccb930aa9ac87ae3f8ed633a97ab71ab72e47f (captured 2026-11-18T13:38:46Z) Verification: Method: Automated extraction from [1] with deepseek-flash (JSON output, thinking disabled). Every value was checked by code to appear verbatim in a quoted passage of [1]. On this check the text of [1] was unchanged since 2026-11-18T13:38:46Z, so the values verified then were kept. Cross-check: not-available at 2026-11-20T13:45:13Z. No independent second source is configured for this entry Last successful check: 2026-11-20T13:45:13Z Last attempt: 2026-11-20T13:45:13Z Notes and limitations: Extracted automatically from a single official source (section "CLI"). Related: https://latestn.com/tool/opencode/commands-and-shortcuts/cancel-staged-rollback How do I cancel a staged rollback in opencode? https://latestn.com/tool/opencode/commands-and-shortcuts/command-arguments How do I pass arguments to an opencode command? https://latestn.com/tool/opencode/commands-and-shortcuts/create-custom-command How do I create a custom slash command in opencode? https://latestn.com/tool/opencode/agents-and-automation/server-plugin-lifecycle-setup How do I define a server plugin in opencode and run code when it loads? https://latestn.com/tool/opencode/agents-and-automation/server-plugin-transforms How do I transform or modify opencode behavior using the plugin API? https://latestn.com/tool/opencode/commands-and-shortcuts/attachment-syntax How do I describe an attachment in opencode prompt syntax? https://latestn.com/tool/ All entries in AI tools Change log: Time | Event | Change | Source 2026-11-19T13:35:19Z | changed | Terminal requirement: — → interactive terminal | [1] 2026-11-19T13:35:19Z | changed | No-argument behavior: — → interactive provider picker | [1] 2026-11-19T13:35:19Z | changed | API-key flag: — → --method key | [1] 2026-11-19T13:35:19Z | changed | Command with provider: — → opencode auth login anthropic --method key | [1] 2026-11-19T13:35:19Z | changed | Command: — → opencode auth login | [1] 2026-11-19T13:35:19Z | changed | example command: opencode auth login anthropic --method key → — | [1] 2026-11-19T13:35:19Z | changed | API-key method flag: --method key → — | [1] 2026-11-19T13:35:19Z | changed | skip picker: Pass an integration ID or name to skip the first picker. → — | [1] 2026-11-19T13:35:19Z | changed | command: opencode auth login → — | [1] 2026-11-13T03:56:21Z | added | Entry created | — Changes for this entry as a feed: https://latestn.com/tool/opencode/commands-and-shortcuts/auth-login-cli/latest Challenge this entry: Open challenges: None How: If a value here is wrong or out of date, send what is wrong and a link to evidence. Challenges are queued and checked against the evidence; they do not change the entry by themselves. If the entry changes as a result, the change log says so. Form: https://latestn.com/dispute/tool/opencode/commands-and-shortcuts/auth-login-cli POST: https://latestn.com/dispute/tool/opencode/commands-and-shortcuts/auth-login-cli with claim, evidence_url, and optionally field and contact (form-encoded or JSON) GET: https://latestn.com/dispute/tool/opencode/commands-and-shortcuts/auth-login-cli?claim={what is wrong}&evidence_url={link} How to cite: LatestN. (2026). How do I log in to a provider from the opencode CLI without opening the TUI? Revision 2, last verified 2026-11-20T13:45:13Z. https://latestn.com/tool/opencode/commands-and-shortcuts/auth-login-cli (accessed 2026-11-21T09:59:32Z). @misc{LatestN_tool_opencode_commands_and_shortcuts_auth_login_cli_r2, title = {How do I log in to a provider from the opencode CLI without opening the TUI?}, author = {{LatestN}}, year = {2026}, howpublished = {\url{https://latestn.com/tool/opencode/commands-and-shortcuts/auth-login-cli}}, note = {Revision 2; digest sha256:0ab83478c5bd3c65; last verified 2026-11-20T13:45:13Z; accessed 2026-11-21T09:59:32Z} } Reuse: License: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/) Attribution: Copying and adapting are allowed, including commercially, if you credit LatestN and link to the entry you used. Each entry ends with a ready-made citation. URL: https://latestn.com/tool/opencode/commands-and-shortcuts/auth-login-cli