Skip to content

Conversation

@ahosker
Copy link
Contributor

@ahosker ahosker commented Nov 24, 2025

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.

- Add --clear option to models CLI command
- When used, calls ModelsDev.refresh() to update cache
- Shows success message after cache refresh
- Allows users to force refresh models from models.dev
@rekram1-node
Copy link
Collaborator

prolly should call it --refresh

- Change CLI flag from --clear to --refresh
- Update description to better reflect functionality
- Update success message to match new flag name
@rekram1-node rekram1-node changed the title Add --clear flag to models command Add --refresh flag to models command Nov 24, 2025
@rekram1-node
Copy link
Collaborator

I'm also thinking since it is a flag it should still output the model list, otherwise a subcommand would make more sense prolly

/oc update this so that if it refreshes the model list it still outputs the models afterwards

- Remove early return when --refresh flag is used
- Now refreshes cache and then displays models list
- Follows standard CLI flag behavior where flags modify main action
@ahosker
Copy link
Contributor Author

ahosker commented Nov 24, 2025

True - taking that one line away is an improvement for sure, can confirm if the model exists that way also

opencode models github-copilot --refresh

@rekram1-node
Copy link
Collaborator

Lol I tried to use the github action but u were faster

@rekram1-node rekram1-node merged commit dd6113c into sst:dev Nov 24, 2025
3 checks passed
@rekram1-node
Copy link
Collaborator

thanks!

shuv1337 added a commit to Latitudes-Dev/shuvcode that referenced this pull request Nov 24, 2025
* ci: fix action

* feature: optional selectedListItemText element in themes and luminance-based fallback to solve 4369 (sst#4572)

Co-authored-by: knanao <[email protected]>
Co-authored-by: knanao <[email protected]>

* ignore: update download stats 2025-11-23

* ignore: update @solidjs/start dependency and fix console redirect handling

Updates the @solidjs/start dependency to latest version and removes deprecated getResponseHeaders usage from auth callback. Also adds error handling for workspace ID lookup to prevent redirect failures.

* Update Nix flake.lock and hashes

* tweak: fix bool

* sync

* ci: stuff

* Update Nix flake.lock and hashes

* ci: stuff

* Update Nix flake.lock and hashes

* fix bash tool wsl

* ci: ignore

* release: v1.0.106

* Update Nix flake.lock and hashes

* ci: ignore

* token

* ci: secret

* chore: format code

* ci: ignore

* ci: ignore

* ci: ignore

* ci: remove log

* tweak: slight improvements to title gen

* wip: zen

* wip: zen

* chore: format code

* fix: add explicit fallback model and prevent direct opencode provider calls (sst#4653)

Co-authored-by: Aiden Cline <[email protected]>

* nix: bundle js dist with bun and patch tree-sitter wasm paths (sst#4644)

Co-authored-by: Aiden Cline <[email protected]>
Co-authored-by: Github Action <[email protected]>

* chore: format code

* fix: fatal: undefined is not an object (evaluating 'color.buffer')

* bump copilot plugin, give better error message for copilot (sst#4678)

* release: v1.0.107

* tweak: modified files sidebar

* fix: persist light vs dark mode

* chore: format code

* tweak: display MCPs in alphabetic order in the sidebar. (sst#4680)

Co-authored-by: Github Action <[email protected]>

* TUI: fix: add null check for user.time in duration calculation (sst#4679)

* ignore: update download stats 2025-11-24

* docs: add Ollama Cloud provider setup to providers.mdx (sst#4693)

* non-corpo loading spinner

* chore: format code

* release: v1.0.108

* textarea highlight cursor color

* chore: format code

* wip: zen

* ci: nix hash

* add autoupdate: notify

* zen: add opus 4.5

* wip(share): more styling

* wip(share): more styling

* wip(share): more styling

* wip(share): enterprise favicon

* fix(console): favicon issues

* chore: format code

* fix(console): remove extra favicon

* adjust bundled provider logic, fix tree shaking stuff (sst#4708)

* wip: zen

* zen: display reasoning tokens

* fix(desktop): layout

* Add --refresh flag to models command (sst#4707)

* zen: byok for gemini

* remove hardcoded openrouter provider

* release: v1.0.109

* chore: format code

* Update Nix flake.lock and hashes

---------

Co-authored-by: Aiden Cline <[email protected]>
Co-authored-by: Ariane Emory <[email protected]>
Co-authored-by: knanao <[email protected]>
Co-authored-by: knanao <[email protected]>
Co-authored-by: GitHub Action <[email protected]>
Co-authored-by: Dax Raad <[email protected]>
Co-authored-by: opencode <[email protected]>
Co-authored-by: Frank <[email protected]>
Co-authored-by: Huang Qi <[email protected]>
Co-authored-by: Albert O'Shea <[email protected]>
Co-authored-by: Aiden Cline <[email protected]>
Co-authored-by: Carli Samuele <[email protected]>
Co-authored-by: Frankie Seabrook <[email protected]>
Co-authored-by: Sebastian Herrlinger <[email protected]>
Co-authored-by: Adam <[email protected]>
Co-authored-by: Adam Hosker <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants