[PR #4707] Add --refresh flag to models command #11077

Closed
opened 2026-02-16 18:15:52 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/anomalyco/opencode/pull/4707

State: closed
Merged: Yes


Summary

  • Add --refresh flag to the opencode models command to refresh the models cache
  • When used, calls ModelsDev.refresh() to force fetch fresh data from models.dev (an existing function in the codebase)
  • Shows a success message after cache refresh
  • Allows users to refresh their cached models when needed manually
  • Shows models after refreshing

Usage

opencode models --refresh

or

opencode models opencode --refresh

This is useful when users want to force refresh their models cache to get the latest models from models.dev without waiting for the automatic hourly refresh. Such as an hour ago, when a new Opus was released.

Currently, the advice is to run rm ~/.cache/opencode/models.json, which is equally as effective but less cool.

**Original Pull Request:** https://github.com/anomalyco/opencode/pull/4707 **State:** closed **Merged:** Yes --- ## Summary - Add `--refresh` flag to the `opencode models` command to refresh the models cache - When used, calls `ModelsDev.refresh()` to force fetch fresh data from models.dev (an existing function in the codebase) - Shows a success message after cache refresh - Allows users to refresh their cached models when needed manually - Shows models after refreshing ## Usage ```bash opencode models --refresh ``` or ```bash opencode models opencode --refresh ``` This is useful when users want to force refresh their models cache to get the latest models from models.dev without waiting for the automatic hourly refresh. Such as an hour ago, when a new Opus was released. Currently, the advice is to run `rm ~/.cache/opencode/models.json`, which is equally as effective but less cool.
yindo added the pull-request label 2026-02-16 18:15:52 -05:00
yindo closed this issue 2026-02-16 18:15:52 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#11077