Skip to content

Commit dd6113c

Browse files
authored
Add --refresh flag to models command (#4707)
1 parent d39bcd9 commit dd6113c

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

packages/opencode/src/cli/cmd/models.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import type { Argv } from "yargs"
22
import { Instance } from "../../project/instance"
33
import { Provider } from "../../provider/provider"
4+
import { ModelsDev } from "../../provider/models"
45
import { cmd } from "./cmd"
56
import { UI } from "../ui"
67
import { EOL } from "os"
@@ -19,8 +20,17 @@ export const ModelsCommand = cmd({
1920
describe: "use more verbose model output (includes metadata like costs)",
2021
type: "boolean",
2122
})
23+
.option("refresh", {
24+
describe: "refresh the models cache from models.dev",
25+
type: "boolean",
26+
})
2227
},
2328
handler: async (args) => {
29+
if (args.refresh) {
30+
await ModelsDev.refresh()
31+
UI.println(UI.Style.TEXT_SUCCESS_BOLD + "Models cache refreshed" + UI.Style.TEXT_NORMAL)
32+
}
33+
2434
await Instance.provide({
2535
directory: process.cwd(),
2636
async fn() {

0 commit comments

Comments
 (0)