@loglune/cli
v1.0.0
Published
Loglune control-plane CLI: reproduce, inspect, diff and bisect feature-flag rulesets from a terminal, CI or an AI agent.
Readme
@loglune/cli
The command-line client for the Loglune control plane: reproduce the exact feature-flag ruleset a user got at a given time, inspect and diff published versions, bisect a bad flag value, and author and publish changes, from a terminal, CI, or your own AI agent.
Full guide for people and AI agents: https://loglune.com/docs/agents
Install
Requires Node.js 22 or later.
npm install --global @loglune/cliOr run it without installing:
npx @loglune/cli helpAuthenticate
Every request is authorized by a seat-bound operator token. Issue one at https://loglune.com/app/tokens, then put it in the environment without echoing it:
read -rs LOGLUNE_OPERATOR_TOKEN && export LOGLUNE_OPERATOR_TOKENThe token is read only from LOGLUNE_OPERATOR_TOKEN, never from a flag, so it stays out of shell history and process listings.
| Variable | Required | Meaning |
|---|---|---|
| LOGLUNE_OPERATOR_TOKEN | yes | the operator token |
| LOGLUNE_API_URL | no | control-plane origin (default https://loglune.com) |
Commands
| Command | What it returns |
|---|---|
| reproduce | The exact ruleset delivered at a version or at an instant T. Bills 1 reproduction. |
| inspect | Flags, segments and config values of one published version (default: the current one). |
| diff | Field-level difference between two versions. |
| impact | Which flags a change to one flag reaches through prerequisites. |
| depgraph | The prerequisite graph of a version. |
| rollout-guard | Risky-publish findings between two versions. |
| lint | Every risky shape one published version holds, with what to change. |
| bisect | The published change that flipped a flag to the bad value for one context. |
| explain | Why a bug-report record got each value, read against the version it names. |
| audit | Every change with its hash-chain check. |
| fingerprints | Evaluation records ingested from bug reports, newest first. |
| triage | One report's answers, the changes behind them and the fixes, per flag. |
| history | Reproductions billed in one month. |
| define | Create, update or delete one flag, segment or config in the draft; --patch changes only the named fields. |
| publish | Make the draft the next live version. |
| simulate | What publish would change now, with nothing written; --records re-judges stored records with the attribute values a ticket gives. |
| annotate | Add a note to a published version after the fact. |
| rollback | Publish a new version equal to an earlier one. |
| kill | Serve one variation of a flag to everyone, published at once. |
| revert | Undo one logged edit in the draft (publish to ship it). |
| discard | Drop every unpublished edit, so the draft equals the live version. |
| normalize | Trim and lower-case segment user lists in the draft (publish to ship it). |
| readiness | Whether a flag can be removed from code: ok, caution or no. |
| ai-launch | Hosted AI bug resolution or flag removal (coming soon; answers 403). |
| ai-status | State and evidence of one Loglune-run AI request. |
| ai-cancel | Stop one Loglune-run AI request (coming soon; answers 403). |
| restore-point | A bookmark of the customer database now, or at an instant in the last 30 days. |
| restore | Roll the database back to a bookmark or an instant (overwrites). |
reproduce, define, publish, annotate, rollback, kill, revert, discard, normalize, ai-launch, ai-cancel and restore change state or bill, and need --confirm yes.
loglune help bisect
loglune inspect
loglune reproduce --at 2026-08-22T14:07:00Z --confirm yesloglune guide prints how an AI agent should use Loglune.
Output and exit codes
A successful result is printed as JSON on stdout. A failure prints HTTP <status> <error>, a one-line hint: saying what to do next, and retry after: <n>s when the server gave a wait, on stderr.
With --json, every result, failures included, is one JSON line on stdout:
{ "ok": false, "status": 429, "body": { "error": "quota_exceeded" }, "hint": "…", "retryAfter": 7 }| Exit | Meaning |
|---|---|
| 0 | success, or help / guide / --version |
| 1 | the request failed: an HTTP error or no response |
| 2 | usage error: unknown command or flag, missing token, or LOGLUNE_API_URL is not a URL (nothing was sent) |
MCP
The same operations are available to MCP clients at https://loglune.com/api/mcp (streamable HTTP, Authorization: Bearer <token>). See https://loglune.com/docs/agents for client setup.
License
MIT. The bundled third-party notices are in dist/THIRD_PARTY_LICENSES.md.
