mirror of
https://github.com/bendtherules/opencode-multi-model.git
synced 2026-08-18 13:42:21 +00:00
feat: display last used models as list
- Imported `chalk` for terminal color support. - Constructed a formatted list of previously used models, applying cyan coloring. - Updated user prompt to include the colored model list for clearer visibility.
This commit is contained in:
+5
-1
@@ -5,6 +5,7 @@ import { cleanupMultiModel } from "./core/cleanup";
|
||||
import { closeMultiModel } from "./core/close";
|
||||
import { openMultiModel } from "./core/open";
|
||||
import { getBinaryName, loadSettings, promptUser } from "./core/utils";
|
||||
import chalk from "chalk";
|
||||
|
||||
const program = new Command();
|
||||
|
||||
@@ -39,8 +40,11 @@ program
|
||||
const settings = await loadSettings();
|
||||
if (settings.lastModels.length > 0) {
|
||||
if (!options.force) {
|
||||
const modelList = settings.lastModels
|
||||
.map((m) => ` - ${chalk.cyan(m)}`)
|
||||
.join("\n");
|
||||
const answer = await promptUser(
|
||||
`Use models [${models.join(", ")}]? (Y/n): `,
|
||||
`Continue with last used models?\n${modelList}\n(Y/n): `,
|
||||
);
|
||||
if (answer.toLowerCase() === "y" || answer.toLowerCase() === "yes") {
|
||||
models = settings.lastModels;
|
||||
|
||||
Reference in New Issue
Block a user