Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions packages/opencode/src/cli/cmd/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import { Instance } from "../../project/instance"
import type { Hooks } from "@opencode-ai/plugin"
import { Process } from "../../util/process"
import { text } from "node:stream/consumers"
import { Filesystem } from "../../util/filesystem"

type PluginAuth = NonNullable<Hooks["auth"]>

Expand Down Expand Up @@ -214,6 +215,20 @@ export const AuthListCommand = cmd({
const results = Object.entries(await Auth.all())
const database = await ModelsDev.get()

const rawAuth = await Filesystem.readJson<Record<string, unknown>>(authPath).catch(() => ({}))
if (rawAuth.$schema) {
prompts.log.info(`Schema ${UI.Style.TEXT_DIM}${rawAuth.$schema}`)
}

if (rawAuth.provider) {
const providerSection = rawAuth.provider as Record<string, unknown>
for (const [providerID, config] of Object.entries(providerSection)) {
const name = (config as any)?.name || providerID
const hasCredentials = results.some(([id]) => id === providerID)
prompts.log.info(`${name} ${UI.Style.TEXT_DIM}${hasCredentials ? "(configured)" : "(not configured)"}`)
}
}

for (const [providerID, result] of results) {
const name = database[providerID]?.name || providerID
prompts.log.info(`${name} ${UI.Style.TEXT_DIM}${result.type}`)
Expand Down