Answer: OpenCode stores its CLI settings in one global file at ~/.config/opencode/cli.json. When $XDG_CONFIG_HOME is set, it uses $XDG_CONFIG_HOME/opencode/cli.json instead. Status: Confirmed Entry: tool/opencode/settings/cli-settings-file-location Revision: 1 Digest: sha256:11cd7eed7c9ee315 (changes whenever the content changes) Timeline: Created: 2026-11-13T03:56:12Z Last changed: 2026-11-13T03:56:12Z Last verified: 2026-11-20T13:45:00Z Next check: 2026-11-21T13:45:00Z Check interval: Daily Expected change: No fixed schedule Data: Field | Value | Source | As of Default config file path | ~/.config/opencode/cli.json | [1] | 2026-11-20 XDG config file path | $XDG_CONFIG_HOME/opencode/cli.json | [1] | 2026-11-20 JSON Schema URL | https://opencode.ai/v2/cli.json | [1] | 2026-11-20 Sources: [1] opencode. "Settings | OpenCode". https://opencode.ai/docs/cli/config/ Role: primary. Accessed: 2026-11-20T13:45:00Z Quote: "OpenCode stores CLI settings in one global file: Copy Copied Failed ~/.config/opencode/cli.json" (Supports: Default config file path) Quote: "When $XDG_CONFIG_HOME is set, OpenCode uses: Copy Copied Failed $XDG_CONFIG_HOME/opencode/cli.json" (Supports: XDG config file path) Quote: ""$schema" : "https://opencode.ai/v2/cli.json"" (Supports: JSON Schema URL) Snapshot SHA-256: 8bd0d1bd2cd194bfea370982c31f597ac50f27460383bd8166f6c3d9117eeafa (captured 2026-11-13T03:56:12Z) 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-13T03:56:12Z, so the values verified then were kept. Cross-check: not-available at 2026-11-20T13:45:00Z. No independent second source is configured for this entry Last successful check: 2026-11-20T13:45:00Z Last attempt: 2026-11-20T13:45:00Z Notes and limitations: Extracted automatically from a single official source (section "Configuration file"). Related: https://latestn.com/tool/opencode/settings/cloudflare-customize-config How do I customize the opencode Cloudflare SDK configuration? https://latestn.com/tool/opencode/settings/command-file-locations Where do global and project opencode commands live? https://latestn.com/tool/opencode/settings/compaction-buffer-setting How do I configure the compaction buffer setting in opencode? https://latestn.com/tool/opencode/settings/change-settings-in-tui How do I change opencode CLI settings from the TUI? https://latestn.com/tool/opencode/settings/change-theme How do I change the theme in opencode? https://latestn.com/tool/opencode/settings/cli-json-schema How do I add the JSON schema to opencode's cli.json for validation? https://latestn.com/tool/ All entries in AI tools Change log: Time | Event | Change | Source 2026-11-13T03:56:12Z | added | Entry created | — Changes for this entry as a feed: https://latestn.com/tool/opencode/settings/cli-settings-file-location/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/settings/cli-settings-file-location POST: https://latestn.com/dispute/tool/opencode/settings/cli-settings-file-location with claim, evidence_url, and optionally field and contact (form-encoded or JSON) GET: https://latestn.com/dispute/tool/opencode/settings/cli-settings-file-location?claim={what is wrong}&evidence_url={link} How to cite: LatestN. (2026). Where does opencode store its CLI settings file? Revision 1, last verified 2026-11-20T13:45:00Z. https://latestn.com/tool/opencode/settings/cli-settings-file-location (accessed 2026-11-21T09:52:17Z). @misc{LatestN_tool_opencode_settings_cli_settings_file_location_r1, title = {Where does opencode store its CLI settings file?}, author = {{LatestN}}, year = {2026}, howpublished = {\url{https://latestn.com/tool/opencode/settings/cli-settings-file-location}}, note = {Revision 1; digest sha256:11cd7eed7c9ee315; last verified 2026-11-20T13:45:00Z; accessed 2026-11-21T09:52:17Z} } 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/settings/cli-settings-file-location