文档
English Docs
Troubleshooting

Troubleshooting

OpenCode stores diagnostic information in logs and local storage.

Logs

Log files are saved to:

  • macOS/Linux: ~/.local/share/opencode/log/
  • Windows: %USERPROFILE%\.local\share\opencode\log\

Log files are named with timestamps (e.g., 2025-01-09T123456.log). The most recent 10 files are kept.

Increase verbosity:

opencode --log-level DEBUG

Storage

Application data location:

  • macOS/Linux: ~/.local/share/opencode/
  • Windows: %USERPROFILE%\.local\share\opencode

Getting Help

  1. GitHub Issues: github.com/anomalyco/opencode/issues
  2. Discord Community: opencode.ai/discord

Common Issues

OpenCode Won't Start

  • Review error messages in log files
  • Run with --print-logs flag
  • Update to latest: opencode upgrade

Authentication Problems

  • Use /connect to re-authenticate
  • Verify API key validity
  • Confirm network access

Model Not Available

  • Confirm provider authentication
  • Check format: <providerId>/<modelId>
  • Run opencode models to list models

ProviderInitError

  1. Review providers documentation
  2. Clear configuration: rm -rf ~/.local/share/opencode
  3. Re-authenticate via /connect

Provider Package Issues

Clear the cache:

rm -rf ~/.cache/opencode

Copy/Paste Not Working (Linux)

Install clipboard utilities:

# X11
apt install -y xclip
 
# Wayland
apt install -y wl-clipboard