Skip to content

Commit b359e80

Browse files
committed
docs: improve README with XDG paths, expanded CLI commands, and HTTP API endpoints
- Add installation variants (crates.io, headless, from source) - Document XDG-compliant directory structure and paths - Add `localgpt paths` and expanded config commands - Expand daemon and memory command examples - Add desktop GUI and streaming chat endpoints - Update audit log and security file paths - Document session management and web UI endpoints
1 parent 1251aed commit b359e80

1 file changed

Lines changed: 48 additions & 9 deletions

File tree

README.md

Lines changed: 48 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,14 @@ A local device focused AI assistant built in Rust — persistent memory, autonom
2020
## Install
2121

2222
```bash
23-
# Full install (includes desktop GUI)
23+
# From crates.io (includes desktop GUI)
2424
cargo install localgpt
2525

2626
# Headless (no desktop GUI — for servers, Docker, CI)
2727
cargo install localgpt --no-default-features
28+
29+
# From source checkout
30+
cargo install --path crates/cli
2831
```
2932

3033
## Quick Start
@@ -39,16 +42,21 @@ localgpt chat
3942
# Ask a single question
4043
localgpt ask "What is the meaning of life?"
4144

45+
# Inspect resolved config/data/state/cache paths
46+
localgpt paths
47+
4248
# Run as a daemon with heartbeat, HTTP API and web ui
4349
localgpt daemon start
4450
```
4551

4652
## How It Works
4753

48-
LocalGPT uses plain markdown files as its memory:
54+
LocalGPT uses XDG-compliant directories (or platform equivalents) for config/data/state/cache. Run `localgpt paths` to see your resolved paths.
55+
56+
Workspace memory layout:
4957

5058
```
51-
~/.localgpt/workspace/
59+
<data_dir>/workspace/
5260
├── MEMORY.md # Long-term knowledge (auto-loaded each session)
5361
├── HEARTBEAT.md # Autonomous task queue
5462
├── SOUL.md # Personality and behavioral guidance
@@ -58,11 +66,11 @@ LocalGPT uses plain markdown files as its memory:
5866
└── tech/
5967
```
6068

61-
Files are indexed with SQLite FTS5 for fast keyword search, and sqlite-vec for semantic search with local embeddings
69+
Files are indexed with SQLite FTS5 for fast keyword search, and sqlite-vec for semantic search with local embeddings.
6270

6371
## Configuration
6472

65-
Stored at `~/.localgpt/config.toml`:
73+
Stored at `<config_dir>/config.toml` (run `localgpt config path` or `localgpt paths`):
6674

6775
```toml
6876
[agent]
@@ -77,7 +85,7 @@ interval = "30m"
7785
active_hours = { start = "09:00", end = "22:00" }
7886

7987
[memory]
80-
workspace = "~/.localgpt/workspace"
88+
workspace = "~/.local/share/localgpt/workspace" # optional override
8189

8290
# Optional: Telegram bot
8391
[telegram]
@@ -90,7 +98,7 @@ api_token = "${TELEGRAM_BOT_TOKEN}"
9098
If you run a local server that speaks the OpenAI API (e.g., LM Studio, llamafile, vLLM), point LocalGPT at it and pick an `openai/*` model ID so it does **not** try to spawn the `claude` CLI:
9199

92100
1. Start your server (LM Studio default port: `1234`; llamafile default: `8080`) and note its model name.
93-
2. Edit `~/.localgpt/config.toml`:
101+
2. Edit your config file (`localgpt config path`):
94102
```toml
95103
[agent]
96104
default_model = "openai/<your-model-name>"
@@ -175,11 +183,11 @@ Verification runs at every session start. If the file is unsigned, missing, or t
175183
- **Marker stripping** — known LLM control tokens (`<|im_start|>`, `[INST]`, `<<SYS>>`, etc.) are stripped from tool outputs
176184
- **Pattern detection** — regex scanning for injection phrases ("ignore previous instructions", "you are now a", etc.) with warnings surfaced to the user
177185
- **Content boundaries** — all external content is wrapped in XML delimiters (`<tool_output>`, `<memory_context>`, `<external_content>`) so the model can distinguish data from instructions
178-
- **Protected files** — the agent is blocked from writing to `LocalGPT.md`, `.localgpt_manifest.json`, `.device_key`, and the audit log
186+
- **Protected files** — the agent is blocked from writing to `LocalGPT.md`, `.localgpt_manifest.json`, `IDENTITY.md`, `localgpt.device.key`, and `localgpt.audit.jsonl`
179187

180188
### Audit Chain
181189

182-
All security events (signing, verification, tamper detection, blocked writes) are logged to an append-only, hash-chained audit file at `~/.localgpt/.security_audit.jsonl`. Each entry contains the SHA-256 of the previous entry, making retroactive modification detectable.
190+
All security events (signing, verification, tamper detection, blocked writes) are logged to an append-only, hash-chained audit file at `<state_dir>/localgpt.audit.jsonl`. Each entry contains the SHA-256 of the previous entry, making retroactive modification detectable.
183191

184192
```bash
185193
localgpt md audit # View audit log
@@ -192,17 +200,25 @@ localgpt md audit --filter=tamper_detected
192200
```bash
193201
# Chat
194202
localgpt chat # Interactive chat
203+
localgpt chat --resume # Resume most recent session
195204
localgpt chat --session <id> # Resume session
196205
localgpt ask "question" # Single question
206+
localgpt ask -f json "question" # JSON output
207+
208+
# Desktop GUI (default build)
209+
localgpt desktop
197210

198211
# Daemon
199212
localgpt daemon start # Start background daemon
213+
localgpt daemon start --foreground
214+
localgpt daemon restart # Restart daemon
200215
localgpt daemon stop # Stop daemon
201216
localgpt daemon status # Show status
202217
localgpt daemon heartbeat # Run one heartbeat cycle
203218

204219
# Memory
205220
localgpt memory search "query" # Search memory
221+
localgpt memory recent # List recent entries
206222
localgpt memory reindex # Reindex files
207223
localgpt memory stats # Show statistics
208224

@@ -221,6 +237,12 @@ localgpt sandbox test # Run sandbox smoke tests
221237
# Config
222238
localgpt config init # Create default config
223239
localgpt config show # Show current config
240+
localgpt config get agent.default_model
241+
localgpt config set logging.level debug
242+
localgpt config path
243+
244+
# Paths
245+
localgpt paths # Show resolved XDG/platform paths
224246
```
225247

226248
## HTTP API
@@ -229,11 +251,28 @@ When the daemon is running:
229251

230252
| Endpoint | Description |
231253
|----------|-------------|
254+
| `GET /` | Embedded web UI |
232255
| `GET /health` | Health check |
233256
| `GET /api/status` | Server status |
257+
| `GET /api/config` | Effective config summary |
258+
| `GET /api/heartbeat/status` | Last heartbeat status/event |
259+
| `POST /api/sessions` | Create session |
260+
| `GET /api/sessions` | List active in-memory sessions |
261+
| `GET /api/sessions/{session_id}` | Session status |
262+
| `DELETE /api/sessions/{session_id}` | Delete session |
263+
| `GET /api/sessions/{session_id}/messages` | Session transcript/messages |
264+
| `POST /api/sessions/{session_id}/compact` | Compact session history |
265+
| `POST /api/sessions/{session_id}/clear` | Clear session history |
266+
| `POST /api/sessions/{session_id}/model` | Switch model for session |
234267
| `POST /api/chat` | Chat with the assistant |
268+
| `POST /api/chat/stream` | SSE streaming chat |
269+
| `GET /api/ws` | WebSocket chat endpoint |
235270
| `GET /api/memory/search?q=<query>` | Search memory |
236271
| `GET /api/memory/stats` | Memory statistics |
272+
| `POST /api/memory/reindex` | Trigger memory reindex |
273+
| `GET /api/saved-sessions` | List persisted sessions |
274+
| `GET /api/saved-sessions/{session_id}` | Get persisted session |
275+
| `GET /api/logs/daemon` | Tail daemon logs |
237276

238277
### Egui Web UI (PoC)
239278

0 commit comments

Comments
 (0)