MCPcopy Index your code
hub / github.com/lmstudio-ai/lms

github.com/lmstudio-ai/lms @main

repository ↗ · DeepWiki ↗ · Ask this repo → · + Follow
406 symbols 1,226 edges 96 files 30 documented · 7% updated 9d ago★ 5,037291 open issues
README
<img alt="lmstudio cli logo" src="https://files.lmstudio.ai/lms-light.png" width="180">

lms - Command Line Tool for LM Studio

Built with lmstudio.js

Installation

lms ships with LM Studio 0.2.22 and newer.

If you have trouble running the command, try running npx lmstudio install-cli to add it to path.

To check if the bootstrapping was successful, run the following in a 👉 new terminal window 👈:

lms

Usage

You can use lms --help to see a list of all available subcommands.

For details about each subcommand, run lms <subcommand> --help.

Here are some frequently used commands:

  • lms status - To check the status of LM Studio.
  • lms server start - To start the local API server.
  • lms server stop - To stop the local API server.
  • lms ls - To list all downloaded models.
  • lms ls --json - To list all downloaded models in machine-readable JSON format.
  • lms ps - To list all loaded models available for inferencing.
  • lms ps --json - To list all loaded models available for inferencing in machine-readable JSON format.
  • lms load - To load a model
  • lms load <model path> -y - To load a model with maximum GPU acceleration without confirmation
  • lms unload <model identifier> - To unload a model
  • lms unload --all - To unload all models
  • lms create - To create a new project with LM Studio SDK
  • lms log stream - To stream logs from LM Studio

Contributing

The CLI is part of the lmstudio.js monorepo and cannot be built standalone.

Building and Testing the CLI

# Clone and build the entire monorepo
git clone https://github.com/lmstudio-ai/lmstudio-js.git --recursive
cd lmstudio-js
npm install
npm run build

# Test your CLI changes
node publish/cli/dist/index.js <subcommand>

Example:

node publish/cli/dist/index.js --help
node publish/cli/dist/index.js status

See CONTRIBUTING.md for more information.

Extension points exported contracts — how you extend this code

DeviceNameResolver (Interface)
(no doc) [1 implementers]
src/deviceNameLookup.ts
LegacyLoggedInUserAuthenticationStatus (Interface)
(no doc)
src/authenticationStatusUtils.ts
HelpConfigurableCommand (Interface)
(no doc)
src/index.ts
LogLevelArgs (Interface)
(no doc)
src/logLevel.ts
AskQuestionOpts (Interface)
(no doc)
src/confirm.ts
CreateClientArgs (Interface)
(no doc)
src/createClient.ts
RefinedNumberOpts (Interface)
(no doc)
src/types/refinedNumber.ts
ParsedLmStudioArtifactUrl (Interface)
(no doc)
src/subcommands/parseLmStudioArtifactUrl.ts

Core symbols most depended-on inside this repo

addLogLevelOptions
called by 35
src/logLevel.ts
createLogger
called by 35
src/logLevel.ts
createClient
called by 31
src/createClient.ts
get
called by 28
src/FileData.ts
addCreateClientOptions
called by 26
src/createClient.ts
compareVersions
called by 23
src/compareVersions.ts
deleteAfterCursor
called by 23
src/subcommands/chat/react/inputReducer.ts
register
called by 22
src/architectureStylizations.ts

Shape

Function 269
Interface 57
Method 57
Class 23

Languages

TypeScript100%

Modules by API surface

src/subcommands/get.ts46 symbols
src/subcommands/chat/react/hooks.tsx23 symbols
src/subcommands/importCmd.ts22 symbols
src/subcommands/chat/react/SlashCommandHandler.ts21 symbols
src/subcommands/runtime/survey.ts13 symbols
src/subcommands/chat/util.ts13 symbols
src/subcommands/chat/react/inputReducer.ts12 symbols
src/FileData.ts11 symbols
src/subcommands/load.ts10 symbols
src/deviceNameLookup.ts10 symbols
src/ProgressBar.ts10 symbols
src/subcommands/runtime/update.ts9 symbols

Dependencies from manifests, versioned

@commander-js/extra-typings14.0.0 · 1×
@inquirer/prompts8.0.1 · 1×
@lmstudio/immer-with-plugins10.1.1 · 1×
@lmstudio/lms-common0.8.9 · 1×
@lmstudio/lms-common-server0.2.18 · 1×
@lmstudio/lms-es-plugin-runner0.0.20 · 1×
@lmstudio/lms-isomorphic0.4.6 · 1×
@lmstudio/lms-lmstudio0.0.32 · 1×
@lmstudio/sdk1.5.0 · 1×
@types/columnify1.5.4 · 1×
@types/node20.12.5 · 1×
@types/react19.2.0 · 1×

For agents

$ claude mcp add lms \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact