mirror of
https://github.com/lmstudio-ai/lms.git
synced 2025-09-19 21:40:02 +08:00
CLI update
This commit is contained in:
@ -1,4 +1,4 @@
|
||||
import { text, type SimpleLogger } from "@lmstudio/lms-common";
|
||||
import { makePrettyError, text, type SimpleLogger } from "@lmstudio/lms-common";
|
||||
import { LMStudioClient } from "@lmstudio/sdk";
|
||||
import chalk from "chalk";
|
||||
import { checkHttpServer, getServerLastStatus } from "./subcommands/server";
|
||||
@ -13,13 +13,15 @@ export async function createClient(logger: SimpleLogger) {
|
||||
port = 1234;
|
||||
}
|
||||
if (!(await checkHttpServer(logger, port))) {
|
||||
logger.errorWithoutPrefix(text`
|
||||
${"\n"}${chalk.redBright(text`
|
||||
LM Studio server is not running. To start the server, run the following command:
|
||||
`)}
|
||||
logger.errorWithoutPrefix(
|
||||
makePrettyError(text`
|
||||
${chalk.redBright(text`
|
||||
LM Studio server is not running. To start the server, run the following command:
|
||||
`)}
|
||||
|
||||
${chalk.yellow("lms start ")}${chalk.gray("[--port <PORT>] [--cors=true|false]")}
|
||||
`);
|
||||
${chalk.yellow("lms server start ")}${chalk.gray("[--port <PORT>] [--cors=true|false]")}
|
||||
`).message,
|
||||
);
|
||||
process.exit(1);
|
||||
}
|
||||
const baseUrl = `ws://127.0.0.1:${port}`;
|
||||
|
Reference in New Issue
Block a user