@letta-ai/letta-code 0.1.10 → 0.1.12

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.
Files changed (3) hide show
  1. package/README.md +36 -21
  2. package/letta.js +3104 -113020
  3. package/package.json +2 -2
package/README.md CHANGED
@@ -24,7 +24,7 @@ Install the package via [npm](https://docs.npmjs.com/downloading-and-installing-
24
24
  npm install -g @letta-ai/letta-code
25
25
  ```
26
26
 
27
- Make sure you have your Letta API key set in your environment:
27
+ Set your Letta API key via environment variable:
28
28
  ```bash
29
29
  export LETTA_API_KEY=...
30
30
  ```
@@ -38,44 +38,59 @@ Any of the agents you create in Letta Code will be viewable (and fully interacta
38
38
 
39
39
  ## Persistence
40
40
 
41
- All agents in Letta are **stateful**: they maintain context forever and can self-edit their own [memory blocks](https://www.letta.com/blog/memory-blocks). Agents can share memory blocks across projects—for example, multiple agents can share user coding preferences while maintaining project-specific memories independently.
41
+ All agents in Letta are **stateful**: they maintain context forever and can self-edit their own [memory blocks](https://www.letta.com/blog/memory-blocks).
42
+
43
+ ### Project-Level Agent Persistence
44
+
45
+ **Letta Code automatically remembers the last agent used in each directory.**
46
+ When you run `letta` in a project, it resumes where you left off with the same agent.
47
+
48
+ **How it works:**
49
+ - First time running `letta` in a directory → creates new agent (with shared memory blocks across all Letta Code agents)
50
+ - Subsequent runs → automatically resumes that agent
51
+ - Agent ID stored in `.letta/settings.local.json` (gitignored, personal to you)
52
+
53
+ ```bash
54
+ letta # Auto-resumes project agent (or creates new if first time)
55
+ letta --new # Force create new agent
56
+ letta --agent <id> # Use specific agent ID
57
+ ```
42
58
 
43
59
  ### Memory Configuration
44
60
 
45
- Letta Code uses a hierarchical memory system with both global and local blocks:
61
+ Letta Code uses a hierarchical memory system:
46
62
 
47
63
  **Global** (`~/.letta/settings.json`)
64
+ - API keys and credentials
48
65
  - `persona` block - defines agent behavior
49
66
  - `human` block - stores user coding preferences
50
67
 
51
- **Local** (`./.letta/settings.json`)
52
- - `project` block - stores project-specific context
53
-
54
- ### Starting Letta Code
55
-
56
- ```bash
57
- letta # New agent (attaches to existing memory blocks or creates new)
58
- letta --continue # Resume last agent session
59
- letta --agent <id> # Resume specific agent session
60
- ```
68
+ **Project** (`./.letta/settings.local.json`)
69
+ - Last agent ID for this directory (auto-resumes)
70
+ - Gitignored - personal to you, not shared with your team
61
71
 
62
- When you start a new agent, it automatically connects to existing memory block IDs from your settings files. If none exist, it creates them.
72
+ **Project Shared** (`./.letta/settings.json`)
73
+ - `project` block - stores project-specific context
74
+ - Can be committed - shared with team
63
75
 
64
- Memory blocks are highly configurable — see our [docs](https://docs.letta.com/guides/agents/memory-blocks) for advanced configuration options. Join our [Discord](https://discord.gg/letta) to share feedback on persistence patterns for coding agents.
76
+ Memory blocks are highly configurable — see our [docs](https://docs.letta.com/guides/agents/memory-blocks) for advanced configuration options.
77
+ Join our [Discord](https://discord.gg/letta) to share feedback on persistence patterns for coding agents.
65
78
 
66
79
  ## Usage
67
80
 
68
81
  ### Interactive Mode
69
82
  ```bash
70
- letta # Start new session (new agent with shared memory blocks)
71
- letta --continue # Resume last session (last recently used agent)
72
- letta --agent <id> # Open specific agent
83
+ letta # Auto-resume project agent (or create new if first time)
84
+ letta --new # Force create new agent
85
+ letta --agent <id> # Use specific agent ID
86
+ letta --continue # Resume global last agent (deprecated, use project-based)
73
87
  ```
74
88
 
75
89
  ### Headless Mode
76
90
  ```bash
77
- letta -p "Run bun lint and correct errors" # Run non-interactive
78
- letta -p "Pick up where you left off" --continue # Continue previous session
91
+ letta -p "Run bun lint and correct errors" # Auto-resumes project agent
92
+ letta -p "Pick up where you left off" # Same - auto-resumes by default
93
+ letta -p "Start fresh" --new # Force new agent
79
94
  letta -p "Run all the test" --allowedTools "Bash" # Control tool permissions
80
95
  letta -p "Just read the code" --disallowedTools "Bash" # Control tool permissions
81
96
 
@@ -198,7 +213,7 @@ bun run dev -- -p "Hello world" # example with args
198
213
  bun run build
199
214
 
200
215
  # expose the binary globally (adjust to your preference)
201
- bun link --global # or: bun add --global .
216
+ bun link
202
217
 
203
218
  # now you can run the compiled CLI
204
219
  letta