CLI
lgr deploys agents, talks to them and runs tasks from a terminal. It needs
Node.js 22 or later.
Install
The lagrange plugin for Codex and Claude Code carries the CLI as one file.
To use it on its own, download that file:
curl -fsSLo ~/lgr.mjs https://raw.githubusercontent.com/TensorBlock/lagrange-plugins/main/lagrange/skills/deploy/scripts/lgr.mjs
alias lgr="node ~/lgr.mjs"Sign in
lgr login --url https://d3iwapvcygehqg.cloudfront.net
lgr whoamilgr login opens a page in the browser with a code to approve, then saves
an API key for the project you pick under $XDG_CONFIG_HOME/lgr. In CI, set
LGR_API_URL and LGR_API_KEY instead, with a key from Settings → API
keys. lgr logout forgets the saved key.
Agents
| Command | |
|---|---|
lgr import [dir] | Write lgr.yaml from AGENTS.md or CLAUDE.md, skills and MCP servers. --harness, --model, --mcp a,b to bring servers from your Codex or Claude Code config, --force to rewrite it. |
lgr deploy | Create the agent in lgr.yaml, or add a version. --file for another file, --preview to add a version callers don't get yet. |
lgr release <agent>@vN | Make a version live |
lgr agents | List agents |
lgr chat <agent>[@vN] | Talk to an agent through its endpoint, as callers do |
lgr keys <agent> | List caller keys; create NAME or revoke ID |
lgr pause <agent> / lgr resume <agent> | Stop and resume new calls through the endpoint |
lgr improvements [id] | List improvement candidates, or show one |
lgr promote <id> | Promote a candidate; --traffic 0.1 for a canary |
lgr reject <id> | Reject a candidate (--reason) |
lgr rollback <id> | Make the version a promoted candidate replaced live again |
Runs
| Command | |
|---|---|
lgr run <task> | Run a task and stream its progress |
lgr runs | Recent runs (--status, --agent, --instance, --limit) |
lgr logs <run> | A run's events; --follow to stream |
lgr cancel <run> | Cancel a queued or running run |
lgr approve <run> <approval> | Approve a pending tool call; --deny to reject it |
lgr compare <task> --harness a,b | Run the same task on several harnesses side by side |
Options for lgr run:
| Option | |
|---|---|
--agent NAME[@vN] | Run an agent, or one of its versions |
--harness ID, --model NAME, --instructions TEXT | Run without an agent, or override the agent's |
--repo URL --ref REF | Check out a repository into the workspace first |
--profile NAME [--continue] [--no-persist] | Run on a profile |
--instance NAME [--continue], --fleet NAME | Run on an instance or fleet |
--approval ask | Pause before tool calls that change things, until you approve them |
--callback URL | POST the result to URL when the run finishes |
--max-minutes N, --max-cost USD, --max-turns N | Limits for this run |
--detach | Print the run ID and exit |
--json | Machine-readable output (any command) |
Compute and triggers
| Command | |
|---|---|
lgr instances [launch|show|stop|start|snapshot|terminate] [name] | Long-lived instances (--size, --profile, --agent) |
lgr instances agent <name> <agent|none> | Serve an agent on an instance |
lgr fleets [create|show|scale|delete] [name] | Groups of instances (--desired, --size, --agent) |
lgr send <instance> <message> | Message an instance's agent and stream the reply (--fleet NAME, --new) |
lgr profiles [create|show|rollback] [name] | Saved environments (--setup, --env KEY=VALUE, --version) |
lgr triggers [create|show|enable|disable|callback|fire|delete] [name] | Schedules and webhooks (--agent, --instance or --fleet; --schedule "CRON" or --webhook; --message) |
lgr callbacks [secret|rotate|retry <id>] | Callback deliveries and their signing secret |
Secrets
lgr secrets # names and when they were set
lgr secrets set LINEAR_TOKEN CRM_TOKEN --from-env
echo -n "$VALUE" | lgr secrets set STRIPE_KEY
lgr secrets set STRIPE_KEY --value "$VALUE"
lgr secrets delete STRIPE_KEY--from-env reads each value from the environment, a .env file in the
current folder, or your Codex config, without printing it.
lgr help lists every command and option.