4beginner.md
It begins with
Then you see a scaffold menu 1/4; Select the one option; Enter name of your project; The lms will create an empty structure of plugin.
Welcome to your new project! This scaffold is a starting point for building an AI-enabled Node.js project with LM Studio SDK. To interact with LM Studio, you should start the LM Studio local server with the command:
OR just run the LM Studio. It works as server for CLI (like lms)
The source code resides in the src/ directory. For development purposes, you can run the project using:
To prepare your project for production, compile the TypeScript code to JavaScript using:
This will compile the TypeScript code in the src/ directory to JavaScript in the dist/ directory.
This code isn't required for the plugin to work within LM Studio. All that runs in it is the dev.js or production.js file. The rest is unnecessary for the plugin to work; it's simply waste when TS is converted to JS.
npm start # auto reload on changes
lms get -i # requires manual reload through interface
When you compile a plugin yourself and install it using
The file generated is .lmstudio/dev.js Without -i (--install) it is just compiled but not run into LM Studio. And if you installed the plugin from the website using
it is compiled into a file named .lmstudio/production.js They work the same way. You can even just edit it and reload the plugin without running commands. That is, changing other people's plugins on the fly in your Lm Studio. You can copy/rename from dev.js to production.js it will work without install.
Login first, and push then. This will upload your files to the site for others to see.
For normal loading, the project must have a correct manifest file.
lms create
lms server start
āāā package.json # Dependencies and scripts
āāā tsconfig.json # TypeScript settings
āāā src/ # Source code (TypeScript)
ā āāā dev.js # For development
ā āāā production.js # For production
āāā dist/ # Compiled JS (after build)
āāā .lmstudio/ # Special files for plugin
ā āāā dev.js / production.js
āāā README.md # Plugin description
npm start
npm install -g @lmstudio/sdk
npm run build
lms dev --install -y
lms get username/plugin-name
lms login
lms whoami
lms push