> ## Documentation Index
> Fetch the complete documentation index at: https://docs.memanto.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# memanto login

> Sign in to Memanto Cloud with your browser (or an API key) and make it the active backend.

# memanto login

Sign in to [Memanto Cloud](https://docs.memanto.ai/cloud/overview.md) and make it the active backend. Opens the Memanto console in your browser to approve this computer; there is no key to copy.

```bash theme={null}
memanto login [OPTIONS]
```

**Options:**

* `--key TEXT` - Sign in with an API key (`mk_...`) instead of the browser, e.g. for CI. Create one in the console under **API keys**.

**Examples:**

Sign in with the browser:

```bash theme={null}
memanto login
```

Sign in on a CI runner or a headless machine:

```bash theme={null}
memanto login --key mk_...
```

**Output:**

```
To sign in, approve this computer in the Memanto console:
  https://console.memanto.ai/cli/authorize?code=ABCD-EFGH
  Code: ABCD-EFGH
⠋ Waiting for approval in your browser · 9:58 left · Ctrl-C to cancel
Signed in to Memanto Cloud as you@example.com.
Next: memanto connect to set up your coding tools.
```

In the console, sign in or create an account, check that the code matches the one in your terminal, and click **Approve**.

![Memanto console asking 'Sign in this computer?' for my-laptop, with the code to compare and Approve and Deny buttons](https://mintcdn.com/memanto/LZOeY0eZRqAGAcUc/logo/cli/cloud/console-approve.png?fit=max\&auto=format\&n=LZOeY0eZRqAGAcUc\&q=85\&s=9c308e9d4101079ea487cf502cd9cb6d)

## Moving memories from Memanto local

If you were using Memanto local (with a Moorcheh API key or on-prem) and the command runs in a terminal, `login` asks what to do with those memories after you approve:

```
You were using Memanto local with Moorcheh Cloud. What about its memories?
  1  Move them to Memanto Cloud  (recommended; your local copy stays)
  2  Continue on Memanto Cloud without them  (move later with: memanto migrate to-cloud)
  Enter 1 or 2 [1]:
Which memories?
  1  Active memories only  (recommended)
  2  All, including expired ones
  Enter 1 or 2 [1]:
```

Moving runs [`memanto migrate to-cloud`](https://docs.memanto.ai/cli/migrate/migrate#move-to-memanto-cloud).

**Notes:**

* The sign-in code is valid for 10 minutes. Ctrl-C cancels.
* No browser on this machine (SSH, a container)? Open the printed link on any device.
* The key is saved as `MEMANTO_API_KEY` in `~/.memanto/.env`, never in a tool's config files.
* The computer appears in the console under **API keys → Computers**. Signing in again on the same computer replaces it instead of adding another entry.
* The backend you used before is remembered, so [`memanto logout`](https://docs.memanto.ai/cli/auth/logout) can switch back to it.
* Coming from another backend, the active agent is cleared, because it belonged to that backend.
* If the console denies the request: `Sign-in was denied.` If the code runs out: `The sign-in code expired. Run 'memanto login' again.`


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.