Nia Sync is a standalone CLI daemon that continuously synchronizes your local data sources with Nia, enabling AI agents to search your personal knowledge base.Documentation Index
Fetch the complete documentation index at: https://docs.trynia.ai/llms.txt
Use this file to discover all available pages before exploring further.
Privacy First: Local folders are private to your account. They’re searched separately from public repositories and documentation.
Quick Install
Follow the Installation guide to install the Nia CLI vianpx nia-wizard@latest.
Getting Started
Add a Source
Add a local folder or database to sync:The CLI auto-detects known database paths (iMessage, browser history, etc.).
Start Syncing
Start the sync daemon:The daemon watches for file changes and syncs incrementally in real-time.
CLI Commands
Core Commands
| Command | Description |
|---|---|
nia | Start sync daemon (watch mode by default) |
nia login | Browser-based OAuth authentication |
nia logout | Clear stored credentials |
nia status | Show all configured sources with sync status |
nia status --json | Output status as JSON for scripting |
nia once | Run one-time sync then exit |
nia add <path> | Add new source for sync |
nia link <ID> <path> | Link cloud source to local path |
nia remove <ID> | Remove source from sync |
nia upgrade | Check and install updates |
Search & Query
Search your indexed sources directly from the terminal:| Flag | Description |
|---|---|
-l, --local-folder | Limit search to specific folder(s). Accepts ID prefix or display name |
--sources | Show source snippets used to generate the answer |
--markdown/--no-markdown | Toggle rich Markdown rendering (default: on) |
--stream/--no-stream | Toggle streaming response (default: on) |
-j, --json | Output raw JSON for programmatic use |
-n, --limit | Max source snippets to display |
Monitoring & Debugging
| Command | Description |
|---|---|
nia info <ID> | Show detailed info for a source (chunk count, last sync, errors) |
nia logs | Show sync logs for all sources |
nia logs <ID> | Show sync logs for a specific source |
nia logs --tail | Continuously tail new logs |
nia logs --errors | Only show error logs |
nia diff | Dry-run: show what would sync without uploading |
nia diff <ID> | Dry-run for a specific source |
nia doctor | Run diagnostics for common issues (auth, API, disk access) |
nia whoami | Show current authenticated user |
nia version | Show CLI version |
nia version --check | Check for available updates |
Sync Control
| Command | Description |
|---|---|
nia pause <ID> | Pause continuous sync for a source |
nia resume <ID> | Resume continuous sync for a source |
nia resync <ID> | Force full resync by resetting cursor |
nia resync --all | Force full resync for all sources |
Web Integration
Open Nia web app pages directly from the CLI:Configuration Management
Config Commands
Manage CLI settings directly from the terminal:Ignore Patterns
Customize which files are excluded from sync:Watch Directories
Configure which directories are scanned for auto-linking sources:Source ID Shortcuts
You don’t need to type full UUIDs. Nia accepts:- ID prefixes:
nia info a3f2matchesa3f2b1c8-... - Display names:
nia pause "My Notes"matches by folder name
Daemon Mode
Runningnia without arguments starts the sync daemon with real-time file watching:
- Watches for file changes using native filesystem events
- Syncs changes within seconds of detection
- Periodically refreshes the source list from the web UI
- Auto-discovers new folders matching unlinked sources
- Sends heartbeats to mark daemon as online
Daemon Flags
| Flag | Default | Description |
|---|---|---|
--watch/--poll | --watch | Real-time watching vs interval polling |
-f, --fallback | 600 | Fallback sync interval in seconds (catches missed events) |
-r, --refresh | 30 | How often to check for new sources from web UI |
Supported Data Sources
Nia Sync automatically extracts and indexes content from various data sources:Chat & Messages
- iMessage (
~/Library/Messages/chat.db) - WhatsApp (
ChatStorage.sqlite) - Telegram (JSON exports, ZIP files)
Apple Ecosystem
- Apple Notes (
NoteStore.sqlite) - Apple Contacts (AddressBook / vCard)
- Apple Reminders (SQLite)
- macOS Stickies (Stickies DB / plist)
Browser History
- Safari (
~/Library/Safari/History.db) - Chrome / Brave / Edge
- Firefox
Media & Files
- Screenshots (metadata + optional OCR text)
- Generic SQLite databases
- Regular folders with text files, code, notes
Virtual File Format
Database content is extracted into virtual text files for semantic search:| Source | Virtual Path Format |
|---|---|
| iMessage | messages/{contact}/{date}_{row_id}_{direction}.txt |
whatsapp/{contact}/{date}_{msg_id}.txt | |
| Safari/Chrome/Firefox | history/{domain}/{date}_{id}.txt |
| Telegram | telegram/{chat_name}/{date}_{msg_id}.txt |
| Apple Notes | notes/{folder}/{note_title}_{id}.txt |
| Screenshots | screenshots/{date}_{filename}.txt |
Web UI
You can also manage synced sources from the Nia web app:- Go to app.trynia.ai
- Navigate to Settings → Local Sync
- View sync status, add/remove sources, and configure sync intervals
Sync Intervals
Configure how often sources are synced:| Interval | Description |
|---|---|
5m | Every 5 minutes |
hourly | Every hour |
6h | Every 6 hours |
daily | Once per day |
Searching Local Folders
Once synced, your local folders are searchable via MCP tools:Local folders are private and searched separately from public repositories. Use
local_folders parameter in search() to include them.Configuration
Environment Variables
| Variable | Default | Description |
|---|---|---|
NIA_API_URL | https://api.trynia.ai | Override API base URL |
Config File
Credentials are stored in~/.nia-sync/config.json with secure permissions (mode 0600).
Limits
| Limit | Value |
|---|---|
| Max files per folder | 5,000 |
| Max total upload size | 100 MB per folder |
| Max individual file size | 5 MB |
| Max database size | 1 GB |
| Max rows per table | 100,000 |
Security
350+ exclusion patterns automatically protect sensitive files from being synced.
- Credentials:
.env,.pem,.key, SSH keys,*credentials*,*secrets*,*token* - Version control:
.git,.svn - Dependencies:
node_modules,venv,__pycache__ - Build outputs:
dist/,build/,.next/
End-to-End Encryption
For sensitive personal data (messages, contacts, notes), Nia supports E2E encrypted sync where plaintext never leaves your device. The server stores only ciphertext and encrypted vectors.E2E Encryption Guide
Learn how E2E encryption works, supported source types, key management, and cookbook examples for syncing iMessage, WhatsApp, Apple Notes, and more.

