Sessions

Choose a session to see its conversation.

    Add a site

    A site is a machine whose lmctl sessions show on this page. It runs the site agent, lmctl site serve, as a systemd user service under the user that owns the sessions. Run these steps on the new machine.

    1. What the machine needs

    Linux with systemd user services, Node.js 22 or later (command -v node prints its path), and a name for the site: short, letters, digits and dashes, for example litebook.

    2. Install lmctl

    The site agent is a packed lmctl build, a file named like lmctl-ai-lmctl-VERSION.tgz. Ask the owner of the site group for it. The package called lmctl on the public npm registry is not this one.

    mkdir -p ~/.local/share/lmctl-site/build1
    cd ~/.local/share/lmctl-site/build1
    cp /path/to/lmctl-ai-lmctl-VERSION.tgz lmctl.tgz
    printf '{"dependencies":{"@lmctl-ai/lmctl":"file:./lmctl.tgz"}}\n' > package.json
    npm install --no-audit --no-fund
    ln -sfn build1 ~/.local/share/lmctl-site/current

    3. The site key

    The agent signs in with an app key that it reads from a file named in LMCTL_APPKEY_FILE. Sites of the shared site group use the file ~/.lmctl/testuser-site.key. Get that file from the owner of the site group over a private channel and copy it to the same path. This page never shows a key: do not paste one into a page, a chat or a command line.

    mkdir -p ~/.lmctl
    chmod 600 ~/.lmctl/testuser-site.key

    4. The service

    Create ~/.config/systemd/user/lmctl-site-agent.service with the text below. Replace NAME with the site name and NODE with the path that command -v node prints. LMCTL_SITE_ALLOW_SHELL=1 lets you run shell commands on this machine from this page (Shell); leave that line out to keep it off.

    [Unit]
    Description=lmctl site agent NAME
    After=network-online.target
    
    [Service]
    Environment=PATH=%h/.local/bin:/usr/local/bin:/usr/bin:/bin
    Environment=LMCTL_APPKEY_FILE=%h/.lmctl/testuser-site.key
    Environment=LMCTL_SITE_ALLOW_SHELL=1
    ExecStart=NODE %h/.local/share/lmctl-site/current/node_modules/.bin/lmctl site serve --name NAME --since 24h --interval 60
    Restart=always
    RestartSec=10
    
    [Install]
    WantedBy=default.target

    5. Start it

    systemctl --user daemon-reload
    systemctl --user enable --now lmctl-site-agent
    loginctl enable-linger "$USER"
    journalctl --user -u lmctl-site-agent -n 20

    enable-linger keeps the agent running after you log out. Within a minute the site shows here under its name, online. It is closed: open it to see its sessions.