Star on GitHub

Docs

Command line

leglas init                Prepare a project and teach its agents
leglas [options]           Start the server and open the interface
leglas new <surface>       Scaffold a branch point for a surface
leglas explore <surface>   Brief an agent's exploration of a surface, or build it
leglas classify            Decide where a direction should live
leglas add --title T --url U   Register a preview on this machine
leglas list                Show every preview, shared and local
leglas log [entry]         What past explorations decided
leglas show <title>        Everything Leglas knows about one direction
leglas share [title] [title]  Share the rail, one direction or a pair
leglas link [title] [title]   A link that opens the interface on them
leglas remove <title>...   Take directions this machine registered off the rail
leglas requests            Show change requests made from the interface
leglas watch --run "<cmd>" Hand each request to your agent as it arrives
leglas keep <title> --to <path>  Keep a winner and end the exploration

--json on any command prints a single machine-readable envelope, except watch, which runs until it is stopped and prints one JSON line per event (below). --port chooses Leglas's own port and --user-port your dev server's; --config names a config file instead of searching upward. Every command's options are under leglas <command> --help.

What each command is for, from an agent's side, is in Working with agents.

Watch as JSON

leglas watch --json prints one JSON object per line as things happen, each with an event:

eventWhenOther fields
watchingThe loop has startedcommand, what each request runs; agent, the agent picked in the interface or null
startedA request was handed to the agentid, title, intent, target
doneThe agent exited 0 and the request left the queueid, title
failedThe agent failed; the request stays in the queue and is not retriedid, title, code, reason
errorReading the queue failed; the loop carries onmessage
stoppedCtrl-C or SIGTERM stopped the loop

The agent's own output goes to stderr, so stdout carries only these lines. If watch cannot start, it prints the usual { "ok": false, "error": … } envelope and exits 1.