Skip to content

CLI ignores config file (~/.opencode.json), always starts in setup mode #698

Closed

Description

@MarkusAureus

Hello,

I am experiencing an issue where the opencode CLI completely ignores the configuration file and always starts in the interactive "Add credential" setup mode.

My Environment:

  • (Linux Mint Cinnamon 22`)

Troubleshooting Steps Performed:
We have systematically tried everything to fix this, but the issue persists:

  1. Confirmed ~/.opencode.json has the correct name, location, and read permissions.
  2. Confirmed the JSON content is valid and syntactically correct.
  3. Removed a potentially conflicting ~/.config/opencode directory.
  4. Tried moving the config file to the primary location at ~/.config/opencode/.opencode.json.
  5. Recreated the file cleanly using cat << EOF to eliminate any hidden character issues.

None of these steps solved the problem. It seems to be a bug in the application that prevents it from reading any user-provided configuration on my system.

We also noticed the documentation at https://opencode.ai/docs/local is confusing, as it shows a configuration format for a web/JS context, not for the standalone CLI tool.

Thank you for looking into this.

Activity

  1. thdxr commented on Jul 5, 2025

    @thdxr
    Member

    the path is ~/.config/opencode/config.json

  2. MarkusAureus commented on Jul 5, 2025

    @MarkusAureus
    Author

    Tried moving the config file to the primary location at ~/.config/opencode/.opencode.json.

    {
    "providers": {
    "ollama": {
    "baseURL": "http://localhost:11434"
    }
    },
    "model": "ollama/codellama"
    }

  3. thdxr commented on Jul 5, 2025

    @thdxr
    Member

    the path is ~/.config/opencode/config.json

  4. self-assigned this
    on Jul 5, 2025
  5. MarkusAureus commented on Jul 5, 2025

    @MarkusAureus
    Author

    Are you AI bot ??

  6. wienans commented on Jul 5, 2025

    @wienans
    Contributor

    @MarkusAureus The question is if you are the bot because he provides correct path and file name and you say you relocated the file , while giving us the path and file name you got the path correct, but no one knows why you still called the file .opencode.json instead of config.json

    Not sure where you found the initial info about the name but maybe you should trust him about the configs name and not only about the path.

  7. dzikipunk commented on Jul 24, 2025

    @dzikipunk

    There is a misleading info in official docs that points to opencode.json "Place your global opencode config in ~/.config/opencode/opencode.json. "
    and not in config ~/.config/opencode/config.json,
    https://opencode.ai/docs/config/

  8. rekram1-node commented on Oct 2, 2025

    @rekram1-node
    Collaborator

    @dzikipunk opencode reads both:

    ~/.config/opencode/opencode.json

    and

    ~/.config/opencode/config.json

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions