cli: filter auth list entries
Only list credentials that validate against Auth.Info; skip $schema and other metadata keys so no “undefined” rows appear.
what behavior were u seeing before?
Can u show output of opencode auth list
Auth file used
~/.local/share/opencode/auth.json
{
"$schema": "https://example.com/schema",
"openai": { "type": "api", "key": "sk-test" }
}
Old behavior (upstream/dev code):
$ bun run --cwd packages/opencode src/index.ts auth list
┌ Credentials ~/.local/share/opencode/auth.json
│
● $schema undefined
│
● OpenAI api
│
└ 2 credentials
New behavior (branch fix/auth-list-filter):
$ bun run --cwd packages/opencode src/index.ts auth list
┌ Credentials ~/.local/share/opencode/auth.json
│
● OpenAI api
│
└ 1 credentials
So the fix removes the not needed $schema undefined entry and only shows real providers.
I see, well that file shouldn't have the schema anyways i dont know why thatd be there, but realistically shouldn't this be filtered at the Auth.all() level? That way it applies elsewhere too?
Or we could error on invalid values and tell user they corrupted the file or something
Yeah I kept the filter in the CLI to stay minimal, since other call sites already ignore entries without a type, it was just the listing was noisy.
I’m happy to move the Auth.Info.safeParse into Auth.all() (and maybe log a warning for dropped keys) so all consumers get validated data.
I am unsure about hard errors because users tend to keep $schema in JSON, so failing the command might be worse dev exp than just a quiet skip but I can fold that into this PR too.
Hard error was just an idea doesnt have to be that
For this did we want to move into the auth.all, should I go ahead and do that?
Yeah we should move it there
if youre down yes plz
/review
lgtm