@letta-ai/letta-code 0.1.19 → 0.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +138 -3
- package/letta.js +37807 -27099
- package/package.json +3 -2
package/README.md
CHANGED
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
A self-improving, stateful coding agent that can learn from experience and improve with use.
|
|
4
4
|
|
|
5
|
-
https://github.com/user-attachments/assets/
|
|
5
|
+
<img width="1713" height="951" alt="letta-code" src="https://github.com/user-attachments/assets/ae546e96-368a-4a7b-9397-3963a35c8d6b" />
|
|
6
6
|
|
|
7
7
|
---
|
|
8
8
|
|
|
9
9
|
## What is Letta Code?
|
|
10
10
|
|
|
11
|
-
Letta Code is a command-line harness around the stateful Letta
|
|
11
|
+
Letta Code is a command-line harness around the stateful [Letta API](https://docs.letta.com/api-reference/overview). You can use Letta Code to create and connect with any Letta agent (even non-coding agents!) - Letta Code simply gives your agents the ability to interact with your local dev environment, directly in your terminal.
|
|
12
12
|
|
|
13
13
|
Letta Code is model agnostic, and supports Sonnet 4.5, GPT-5, Gemini 2.5, GLM-4.6, and more.
|
|
14
14
|
|
|
@@ -76,6 +76,75 @@ Letta Code uses a hierarchical memory system:
|
|
|
76
76
|
Memory blocks are highly configurable — see our [docs](https://docs.letta.com/guides/agents/memory-blocks) for advanced configuration options.
|
|
77
77
|
Join our [Discord](https://discord.gg/letta) to share feedback on persistence patterns for coding agents.
|
|
78
78
|
|
|
79
|
+
## Skills
|
|
80
|
+
|
|
81
|
+
**Skills are automatically discovered from a `.skills` directory in your project.**
|
|
82
|
+
|
|
83
|
+
Skills allow you to define custom capabilities that the agent can reference and use. When you start a new session, Letta Code recursively scans for `SKILL.MD` files and loads any skill definitions found.
|
|
84
|
+
|
|
85
|
+
### Creating Skills
|
|
86
|
+
|
|
87
|
+
Create a `.skills` directory in your project root and organize skills in subdirectories:
|
|
88
|
+
|
|
89
|
+
```bash
|
|
90
|
+
mkdir -p .skills/data-analysis
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
Each skill is defined in a file named `SKILL.MD`. The directory structure determines the skill ID:
|
|
94
|
+
|
|
95
|
+
```
|
|
96
|
+
.skills/
|
|
97
|
+
├── data-analysis/
|
|
98
|
+
│ └── SKILL.MD # skill id: "data-analysis"
|
|
99
|
+
└── web/
|
|
100
|
+
└── scraper/
|
|
101
|
+
└── SKILL.MD # skill id: "web/scraper"
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
Create a skill file (`.skills/data-analysis/SKILL.MD`):
|
|
105
|
+
|
|
106
|
+
```markdown
|
|
107
|
+
---
|
|
108
|
+
name: Data Analysis Skill
|
|
109
|
+
description: Analyzes CSV files and generates statistical reports
|
|
110
|
+
category: Data Processing
|
|
111
|
+
tags:
|
|
112
|
+
- analytics
|
|
113
|
+
- statistics
|
|
114
|
+
- csv
|
|
115
|
+
---
|
|
116
|
+
|
|
117
|
+
# Data Analysis Skill
|
|
118
|
+
|
|
119
|
+
This skill analyzes data files and generates comprehensive reports.
|
|
120
|
+
|
|
121
|
+
## Usage
|
|
122
|
+
|
|
123
|
+
Use this skill to analyze CSV files and generate statistical summaries...
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
**Skill File Format:**
|
|
127
|
+
|
|
128
|
+
- **File name:** Must be named `SKILL.MD` (case-insensitive)
|
|
129
|
+
- **Required frontmatter:**
|
|
130
|
+
- `name` - Display name for the skill
|
|
131
|
+
- `description` - Brief description of what the skill does
|
|
132
|
+
- **Optional frontmatter:**
|
|
133
|
+
- `category` - Category for organizing skills (skills are grouped by category in the agent's memory)
|
|
134
|
+
- `tags` - Array of tags for filtering/searching
|
|
135
|
+
- **Body:** Additional details and documentation about the skill
|
|
136
|
+
|
|
137
|
+
Skills are automatically loaded into the agent's memory on startup, making them available for reference throughout your session.
|
|
138
|
+
|
|
139
|
+
### Custom Skills Directory
|
|
140
|
+
|
|
141
|
+
You can specify a custom skills directory using the `--skills` flag:
|
|
142
|
+
|
|
143
|
+
```bash
|
|
144
|
+
letta --skills /path/to/custom/skills
|
|
145
|
+
letta -p "Use the custom skills" --skills ~/my-skills
|
|
146
|
+
```
|
|
147
|
+
|
|
79
148
|
## Usage
|
|
80
149
|
|
|
81
150
|
### Interactive Mode
|
|
@@ -83,13 +152,79 @@ Join our [Discord](https://discord.gg/letta) to share feedback on persistence pa
|
|
|
83
152
|
letta # Auto-resume project agent (or create new if first time)
|
|
84
153
|
letta --new # Create new agent with new memory blocks
|
|
85
154
|
letta --agent <id> # Use specific agent ID
|
|
86
|
-
letta --model <model> # Specify model (e.g., claude-sonnet-4.5, gpt-4o)
|
|
155
|
+
letta --model <model> # Specify model (e.g., claude-opus-4.5, claude-sonnet-4.5, gpt-4o)
|
|
87
156
|
letta -m <model> # Short form of --model
|
|
88
157
|
letta --continue # Resume global last agent (deprecated, use project-based)
|
|
158
|
+
|
|
159
|
+
# Managing tools (requires --agent flag)
|
|
160
|
+
letta --agent <id> --link # Attach Letta Code tools to agent, then start session
|
|
161
|
+
letta --agent <id> --unlink # Remove Letta Code tools from agent, then start session
|
|
89
162
|
```
|
|
90
163
|
|
|
91
164
|
> **Note:** The `--model` flag is inconsistent when resuming sessions. We recommend using the `/model` command instead to change models in interactive mode.
|
|
92
165
|
|
|
166
|
+
#### Interactive Commands
|
|
167
|
+
|
|
168
|
+
While in a session, you can use these commands:
|
|
169
|
+
- `/agent` - Show current agent link
|
|
170
|
+
- `/model` - Switch models
|
|
171
|
+
- `/toolset` - Switch toolsets (codex/default)
|
|
172
|
+
- `/rename` - Rename the current agent
|
|
173
|
+
- `/stream` - Toggle token streaming on/off
|
|
174
|
+
- `/link` - Attach Letta Code tools to current agent (enables Read, Write, Edit, Bash, etc.)
|
|
175
|
+
- `/unlink` - Remove Letta Code tools from current agent
|
|
176
|
+
- `/clear` - Clear conversation history
|
|
177
|
+
- `/exit` - Exit and show session stats
|
|
178
|
+
- `/logout` - Clear credentials and exit
|
|
179
|
+
|
|
180
|
+
#### Managing Letta Code Tools
|
|
181
|
+
|
|
182
|
+
Letta Code provides tools like `Bash`, `Read`, `Write`, `Edit`, `Grep`, `Glob`, and more. You can attach or remove these tools from any agent:
|
|
183
|
+
|
|
184
|
+
**Via CLI flags** (before starting session):
|
|
185
|
+
```bash
|
|
186
|
+
letta --agent <id> --link # Attach Letta Code tools
|
|
187
|
+
letta --agent <id> --unlink # Remove Letta Code tools
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
**Via interactive commands** (during session):
|
|
191
|
+
```bash
|
|
192
|
+
/link # Attach Letta Code tools to current agent
|
|
193
|
+
/unlink # Remove Letta Code tools from current agent
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
When you attach tools with `/link` or `--link`, they are added to the agent with approval rules enabled (human-in-the-loop). This means the agent can use these tools, but you'll be prompted to approve each tool call. Use permission modes to control approval behavior (see Permissions section below).
|
|
197
|
+
|
|
198
|
+
### Toolsets
|
|
199
|
+
|
|
200
|
+
Letta Code includes different toolsets optimized for different model providers:
|
|
201
|
+
|
|
202
|
+
1. **Default Toolset** (Anthropic-optimized, best for Claude models)
|
|
203
|
+
2. **Codex Toolset** (OpenAI-optimized, best for GPT models)
|
|
204
|
+
3. **Gemini Toolset** (Google-optimized, best for Gemini models)
|
|
205
|
+
|
|
206
|
+
**Automatic Selection:**
|
|
207
|
+
When you specify a model, Letta Code automatically selects the appropriate toolset:
|
|
208
|
+
```bash
|
|
209
|
+
letta --model haiku # Loads default toolset
|
|
210
|
+
letta --model gpt-5-codex # Loads codex toolset
|
|
211
|
+
letta --model gemini-3-pro # Loads gemini toolset
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
**Manual Override:**
|
|
215
|
+
You can force a specific toolset regardless of model:
|
|
216
|
+
```bash
|
|
217
|
+
# CLI flag (at startup)
|
|
218
|
+
letta --model haiku --toolset codex # Use Codex-style tools with Claude Haiku
|
|
219
|
+
letta --model gpt-5-codex --toolset gemini # Use Gemini-style tools with GPT-5-Codex
|
|
220
|
+
letta --toolset gemini # Use Gemini tools with default model
|
|
221
|
+
|
|
222
|
+
# Interactive command (during session)
|
|
223
|
+
/toolset # Opens toolset selector
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
The `/model` command automatically switches toolsets when you change models. Use `/toolset` if you want to manually override the automatic selection.
|
|
227
|
+
|
|
93
228
|
### Headless Mode
|
|
94
229
|
```bash
|
|
95
230
|
letta -p "Run bun lint and correct errors" # Auto-resumes project agent
|