Driving teams
The default path is offline. Add --live to seed a configured Lead, prompt once, then open its terminal in interactive mode.
A provider is an AI service accessed through its command-line program; a model selects which AI model it uses. A teamfile is the .lmctl text file that names members and their settings. An alias such as Lead names a member, and a session is its ongoing provider conversation. Seeding creates missing provider sessions from that file. Prompting sends the named member one real turn; the returned map includes a status and reply.
The live branch can create provider sessions and send a real prompt. Test the offline path first; use --live only when you intend to contact the configured provider. lm_terminal opens the provider interface only when the run is interactive.
Script: teams.lms
# This offline default is safe to run. Pass --live to seed and prompt a provider.
team = path_join(Directory, "tutorial-team.lmctl");
if (ARGV.get(0, "") == "--live") {
write_file_exclusive(team, "# Tutorial team\n_MEMBER_ alias=Lead provider=claude\n");
seeded = lm_seed(team);
require(seeded.status == "ok", f"Could not seed team: {seeded.error}");
reply = lm_prompt(team, "Lead", "Reply with one sentence describing your task.");
require(reply.status == "ok", f"Prompt failed: {reply.error}");
println(reply.reply);
if (!NonInteractive) { lm_terminal(team, "Lead"); }
} else {
println("Preview only. Run with --live to seed a provider session.");
}
Run it
lmscript examples/teams.lms
Output
Preview only. Run with --live to seed a provider session.
Previous: Typed host blocks · Next: Writing a team automation
Try it: download examples/teams.lms, save it under examples/ in a writable working directory, then run the command above from that directory.