You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
## The Problem
msgvault already supports remote CLI commands (`stats`, `search`,
`show-message`) against a NAS server. But the TUI—the primary way to
explore your archive—only works locally. If your archive lives on a NAS,
you can't browse it from your laptop.
## What This PR Does
Enables `msgvault tui` to work transparently against a remote server.
When `[remote].url` is configured, the TUI connects to your NAS and
gives you the full browsing experience: aggregate views, drill-down
navigation, search, filtering—everything works identically to local
mode.
```bash
# In config.toml
[remote]
url = "https://nas:8080"
api_key = "your-key"
# Then just run TUI as normal
msgvault tui # Connects to NAS automatically
msgvault tui --local # Force local if needed
```
## Implementation
**Server side:** 6 new API endpoints that expose the `query.Engine`
capabilities needed by the TUI:
- `/api/v1/aggregates` – sender/domain/label/time aggregations
- `/api/v1/aggregates/sub` – drill-down into sub-aggregations
- `/api/v1/messages/filter` – filtered message lists with pagination
- `/api/v1/stats/total` – stats with filter context
- `/api/v1/search/fast` – metadata search (subject, sender, recipient)
- `/api/v1/search/deep` – full-text body search via FTS5
**Client side:** `remote.Engine` implements the full `query.Engine`
interface over HTTP, so the TUI code doesn't change at all—it just gets
a different engine.
**Safety:** Deletion staging and attachment export are disabled in
remote mode. These require local file access and are potentially
destructive, so they're local-only operations.
## Testing
- [x] All handler tests pass (10 new tests for aggregate endpoints)
- [x] Remote engine unit tests pass
- [x] TUI builds with remote support
- [ ] Manual end-to-end testing against NAS
---
Closes#130
---------
Co-authored-by: Wes McKinney <[email protected]>
Co-authored-by: Claude Opus 4.6 <[email protected]>
@@ -125,6 +130,30 @@ See the [Configuration Guide](https://msgvault.io/configuration/) for all option
125
130
126
131
msgvault includes an MCP server that lets AI assistants search, analyze, and read your archived messages. Connect it to Claude Desktop or any MCP-capable agent and query your full message history conversationally. See the [MCP documentation](https://msgvault.io/usage/chat/) for setup instructions.
127
132
133
+
## Daemon Mode (NAS/Server)
134
+
135
+
Run msgvault as a long-running daemon for scheduled syncs and remote access:
The TUI can connect to a remote server by configuring `[remote].url`. Use `--local` to force local database when remote is configured. See [docs/api.md](docs/api.md) for the HTTP API reference.
156
+
128
157
## Documentation
129
158
130
159
-[Setup Guide](https://msgvault.io/guides/oauth-setup/): OAuth, first sync, headless servers
0 commit comments