mirror of
https://github.com/bendtherules/opencode-multi-model.git
synced 2026-08-18 21:52:11 +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 { closeMultiModel } from "./core/close";
|
||||||
import { openMultiModel } from "./core/open";
|
import { openMultiModel } from "./core/open";
|
||||||
import { getBinaryName, loadSettings, promptUser } from "./core/utils";
|
import { getBinaryName, loadSettings, promptUser } from "./core/utils";
|
||||||
|
import chalk from "chalk";
|
||||||
|
|
||||||
const program = new Command();
|
const program = new Command();
|
||||||
|
|
||||||
@@ -39,8 +40,11 @@ program
|
|||||||
const settings = await loadSettings();
|
const settings = await loadSettings();
|
||||||
if (settings.lastModels.length > 0) {
|
if (settings.lastModels.length > 0) {
|
||||||
if (!options.force) {
|
if (!options.force) {
|
||||||
|
const modelList = settings.lastModels
|
||||||
|
.map((m) => ` - ${chalk.cyan(m)}`)
|
||||||
|
.join("\n");
|
||||||
const answer = await promptUser(
|
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") {
|
if (answer.toLowerCase() === "y" || answer.toLowerCase() === "yes") {
|
||||||
models = settings.lastModels;
|
models = settings.lastModels;
|
||||||
|
|||||||
Reference in New Issue
Block a user