lmscript
lmscript is a small scripting language and command-line interpreter for automating files, data, processes, native tools, and AI teams. A script is checked before it runs; a dry preflight previews effects before the real pass.
Start with the tutorials in order. Each chapter includes a script you can download, a command to run it, and output from the published compiler.
New to lmscript? Follow the numbered path first, then keep the quick cheat sheet nearby. The command names, braces, semicolons, and function calls should feel familiar if you know another programming language; the built-ins and host blocks are specific to lmscript.
First follow Install and first checks. Save downloaded scripts in an examples/ subdirectory of your working directory so the commands below resolve their paths. In a website repository checkout, use lmscript-site/ as that working directory.
Reading order
- Hello and variables — Start with a variable, an argument, and an f-string.
- Quick cheat sheet — One-page syntax and the built-ins used most often.
- Control flow and functions — Use a function and a loop to compute a result; continue skips one iteration.
- Strings and data — Read JSON data, update a list, build a map, and format the result.
- Files and processes — Write and read a temporary file, then run a process as an argument array without a shell.
- Errors and require — Use require for a condition that must hold; a failed requirement stops the run with an error.
- Typed host blocks — Compile native host calls with install declarations for lmdraw, lmcad, and lmhtml.
- Driving teams — The default path is offline. Enable live mode to seed a configured Lead, prompt once, then open its terminal in interactive mode.
- Writing a team automation — Build a repeatable workflow from team setup, seeding, prompts, checks, and a final handoff.
- A small multi-agent workflow — Lead assigns work to Coder; Reviewer checks it; Lead decides the next step.
- Writing an autorun script — Declare provider roles and placeholders so lmctl autorun can map them on another machine.
- Agentic recipes — Agent workflows with llm_prompt: routing, crews, managers, tools, human approval, parallel review, checkpoints and local knowledge.
Reference
- User guide: command-line options, runtime values, lmctl functions, and error fixes.
- Workflow authoring skill: patterns for writing maintainable team scripts.
- lmscript tool page: package and project information.
When a script fails, use Troubleshooting to compare the exact compiler output with common mistakes.
Use the source repository for releases and issue tracking.