---
title: Letta Code CLI | Letta Docs
description: Run Letta Code from your terminal
---

Letta Code is a memory-first agent that can run from your terminal. The CLI supports both Letta Cloud agents and [Local mode](/letta-code/local-mode/index.md).

## Install the Letta Code CLI

Requires Node.js 18+

`npm install -g @letta-ai/letta-code`

![Letta Code CLI](/letta-code-demo.gif)

## Getting started

1. **Install Letta Code**

   Run the following command to install Letta Code via your terminal (requires [Node.js](https://nodejs.org/en/download) version 18+):

   ```
   npm install -g @letta-ai/letta-code
   ```

   To launch Letta Code, run:

   ```
   letta
   ```

   If you’re running Letta Code for the first time, a new local agent will be auto-created for you. This default local mode stores agent state on your machine and does not require a Letta login.

2. **Connect to LLM providers**

   Use `/connect` to connect external API keys, coding plans, and local inference servers.

3. **Navigate to your project**

   ```
   cd your-project
   letta
   ```

4. **Send your first message**

   You’re ready to chat! Try asking your agent to explore your codebase or run `/init` to bootstrap its memory.

   Use `/new` to start a new conversation (or `letta --new`), `/resume` to swap conversations, `/agent` to swap agents, and `/model` to swap models. View the [CLI reference](/letta-code/cli-reference/index.md) to see the full list of CLI commands.

5. **Optional: login to Constellation**

   Run `/login` if you want Constellation-managed state and access from `chat.letta.com`, the desktop app, other machines, and messaging integrations.

   Read more about Constellation [here](/letta-code/constellation/index.md).
