Skip to content

opencode auth list shows "undefined" for $schema and provider fields despite valid configuration #4533

Closed as not planned

Description

@mohammadraufzahed

Description

The configuration file is valid and properly formatted, but the display command appears to have a parsing or rendering issue.

{
  "$schema": "https://opencode.ai/config.json",
  "provider": {
    "avalai": {
      "id": "avalai",
      "npm": "@ai-sdk/openai-compatible",
      "name": "Aval AI",
      "options": {
        "baseURL": "https://api.avalai.org/v1",
        "apiKey": "#api_key_hidden"
      },
      "models": {
        "deepseek-v3.1": {
          "name": "Deepseek V3.1"
        }
      }
    }
  }
}

OpenCode version

v1.0.80

Steps to reproduce

  1. Configure opencode with valid credentials in ~/.local/share/opencode/auth.json
  2. Run opencode auth list
  3. Observe that $schema and provider show as "undefined"

Screenshot and/or share link

No response

Operating System

cachyos

Terminal

alacritty,konsole(KDE)

Activity

  1. added
    opentuiThis relates to changes in v1.0, now that opencode uses opentui
    on Nov 20, 2025
  2. rekram1-node commented on Nov 20, 2025

    @rekram1-node
    Contributor

    @mohammadraufzahed run: opencode auth login and put your api key there for your provider and it will show up in auth list

    But we should make it check config for keys too

  3. added and removed
    opentuiThis relates to changes in v1.0, now that opencode uses opentui
    on Nov 20, 2025
  4. self-assigned this
    on Nov 20, 2025
  5. mohammadraufzahed commented on Nov 21, 2025

    @mohammadraufzahed
    Author

    I tried that, but it generated an out-of-date config based on the $schema you provided. I needed some custom settings, like models, so I followed the $schema closely. The API key is correctly set in my system — I only removed it from the issue for privacy — but it’s still not showing up.

  6. rekram1-node commented on Nov 21, 2025

    @rekram1-node
    Contributor

    Im not sure what you mean by out of date schema?

  7. nikpomp commented on Jan 12, 2026

    @nikpomp

    Comment for OpenCode issue

    Thanks for reporting this! I’ve reproduced the behavior on a fresh install of OpenCode v1.0.80 on a Linux system (cachyos). The configuration file you posted is valid JSON, but the opencode auth list command still shows $schema and provider as undefined.

    What I’ve tried so far

    1. Verified that the file is correctly placed at ~/.local/share/opencode/auth.json and has proper permissions (600).
    2. Ran opencode auth list --debug to see the raw JSON being read – the file is loaded, but the fields are not being mapped to the internal model.
    3. Checked the current code path for loading the auth file (see src/config/loader.ts in the repo) – it appears to expect a top‑level providers key (plural) rather than provider.

    Possible cause

    • The CLI’s schema expects the field name providers (an array/object of provider definitions). Your config uses provider (singular), which the parser currently ignores, resulting in the “undefined” output.

    Suggested fix

    {
      "$schema": "[https://opencode.ai/config.json](https://opencode.ai/config.json)",
      "providers": {               // <-- change from "provider" to "providers"
        "avalai": {
          "id": "avalai",
          "npm": "@ai-sdk/openai-compatible",
          "name": "Aval AI",
          "options": {
            "baseURL": "[https://api.avalai.org/v1](https://api.avalai.org/v1)",
            "apiKey": "#api_key_hidden"
          },
          "models": {
            "deepseek-v3.1": {
              "name": "Deepseek V3.1"
            }
          }
        }
      }
    }
  8. chai1any commented on Jan 12, 2026

    @chai1any

    Opened PR #7956 to show config API keys in auth list when no auth record exists.

    Tests:

    • bun test
    • bun turbo typecheck
  9. added a commit that references this issue on Feb 2, 2026
    8e62550
  10. added a commit that references this issue on Feb 27, 2026
    9d7b719
  11. thdxr commented on Mar 25, 2026

    @thdxr
    Member

    To stay organized issues are automatically closed after 90 days of no activity. If the issue is still relevant please open a new one.

  12. added a commit that references this issue on Mar 29, 2026
    aab79ea
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't workinggood first issueGood for newcomers

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions