Add lettabot-history CLI (#211)

* Add lettabot-history CLI

* Document and test lettabot-history

* Validate lettabot-history limit

* fix: address review feedback on history CLI

- Extract shared loadLastTarget into cli/shared.ts (was duplicated in message.ts, react.ts, history-core.ts)
- Clamp --limit to platform maximums (Discord: 100, Slack: 1000)
- Fix Discord author formatting: use globalName/username instead of deprecated discriminator
- Add Slack fetch test

Written by Cameron ◯ Letta Code

"You miss 100% of the shots you don't take." -- Wayne Gretzky -- Michael Scott

---------

Co-authored-by: Jason Carreira <jason@visotrust.com>
Co-authored-by: Cameron <cameron@pfiffer.org>
This commit is contained in:
Jason Carreira
2026-02-09 13:16:10 -05:00
committed by GitHub
parent 673f247793
commit 16b5e5b7b7
10 changed files with 467 additions and 56 deletions

View File

@@ -237,6 +237,18 @@ The agent sees a clear `[SILENT MODE]` banner when triggered by heartbeats/cron,
If your agent isn't sending messages during heartbeats, check the [ADE](https://app.letta.com) to see what the agent is doing and whether it's attempting to use `lettabot-message`.
## Agent CLI Tools
LettaBot includes small CLIs the agent can invoke via Bash (or you can run directly):
```bash
lettabot-message send --text "Hello from a background task"
lettabot-react add --emoji :eyes: --channel discord --chat 123 --message 456
lettabot-history fetch --limit 25 --channel discord --chat 123456789
```
See [CLI Tools](docs/cli-tools.md) for details and limitations.
## Connect to Letta Code
Any LettaBot agent can also be directly chatted with through [Letta Code](https://github.com/letta-ai/letta-code). Use the `/status` command to find your `agent_id`, and run:
```sh