> For the complete documentation index, see [llms.txt](https://docs.living-memory.app/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.living-memory.app/cli.md). Agents can also search and read this documentation through its [MCP server](https://docs.living-memory.app/~gitbook/mcp).

# Living Memory CLI quickstart

Sign in from a terminal, list or create Capsules, and open or revoke a read-only connection for an AI. Includes the released alpha commands.

The released TypeScript `lm` signs in, lists or creates Capsules and manages scoped read-only Agent Doors. Use Node.js 20.12 or newer.

## Sign in and list Capsules

```sh
npx @nature-labs/lm@0.2.0-alpha.0 login
npx @nature-labs/lm@0.2.0-alpha.0 capsules list
```

Complete browser approval within five minutes. The package is an alpha. You can install the same version with `npm install -g @nature-labs/lm@0.2.0-alpha.0` and then run `lm` directly, as in the examples below. `lm whoami` shows the account's default memory where available. `lm capsules list` is the Capsule inventory.

To create a new Capsule with a first note:

```sh
lm capsules create "Bike" "Tyre pressure is 80 psi front, 90 psi rear."
```

## Open and revoke a read-only connection

Set `CAPSULE_ID` to the exact ID from `lm capsules list` for a Capsule on which you can manage Agent Doors.

```sh
lm doors open "$CAPSULE_ID" work-agent
lm doors list "$CAPSULE_ID"
```

`doors open` prints the connection link once. Add it to an MCP client as a remote Streamable HTTP server, then ask the client to search for a known fact in the Capsule. Anyone holding the link has the granted reads until expiry or revocation. Keep it private. `doors list` shows the issued door ID, holder, label, access, status and available last-used and expiry information.

```sh
lm doors revoke "$CAPSULE_ID" "$DOOR_ID"
```

Use the actual `DOOR_ID` from the list. The next request through the revoked link should be refused. To check a received link without echoing it in tool output, use `lm doctor door "$CONNECTION_URL"`. Pakkana Visitor Doors and membership are managed in Pakkana.

## Scripts and versions

Use `--json` for one-line response envelopes: `{"ok":true,"data":{…}}` or `{"ok":false,"error":{"code":…,"message":…}}`. The exit codes are 0 for success, 1 for failure and 2 for usage errors. Use `lm --help` for the installed commands.

The earlier Go [0.1.0-rc.5](https://github.com/v1b3x0r/lm-cli/releases/tag/v0.1.0-rc.5) also installs as `lm`. It provides the legacy Room and [Local](https://docs.living-memory.app/local.md) commands, including `lm setup local`, `remember` and `handoff`. The TypeScript alpha has no generic memory write or handoff command for existing Capsules and no payment command. Run `lm version` before following examples for either release. The paid-through and inactivity columns from the later CLI source update remain unreleased in the npm alpha.

See the [TypeScript release](https://github.com/v1b3x0r/lm-cli/releases/tag/v0.2.0-alpha.0) and the [npm package](https://www.npmjs.com/package/@nature-labs/lm).
