mirror of
https://gitea.toothfairyai.com/ToothFairyAI/tf_code.git
synced 2026-03-31 14:22:27 +00:00
20 lines
567 B
TypeScript
20 lines
567 B
TypeScript
import { App } from "../../app/app"
|
|
import { Provider } from "../../provider/provider"
|
|
import { cmd } from "./cmd"
|
|
|
|
export const ModelsCommand = cmd({
|
|
command: "models",
|
|
describe: "list all available models",
|
|
handler: async () => {
|
|
await App.provide({ cwd: process.cwd() }, async () => {
|
|
const providers = await Provider.list()
|
|
|
|
for (const [providerID, provider] of Object.entries(providers)) {
|
|
for (const modelID of Object.keys(provider.info.models)) {
|
|
console.log(`${providerID}/${modelID}`)
|
|
}
|
|
}
|
|
})
|
|
},
|
|
})
|