Overview
The trix integrations command group manages connections to
third-party services. Use these commands to connect, sync, and manage
your integrations from the terminal.
trix integrations <command> [options]
Commands:
connect <provider> Connect to a third-party service
disconnect <id> Remove a connection
list List all connections
status <id> Show connection status and sync history
sync <id> Trigger a sync jobtrix integrations connect
Initiates OAuth flow to connect a third-party service.
trix integrations connect <provider> [options]
Arguments:
provider Service to connect: notion, google
Options:
--scopes Comma-separated OAuth scopes (Google only)
--name Custom name for this connection
--no-open Don't auto-open browserExamples
# Connect Notion
trix integrations connect notion
# Connect Google with all services
trix integrations connect google
# Connect Google with specific scopes
trix integrations connect google --scopes gmail,calendar
# Connect with custom name
trix integrations connect notion --name "Work Notion"How It Works
- CLI starts a local HTTP server on a random port
- Opens your browser to the provider's OAuth page
- After authorization, provider redirects to local server
- CLI exchanges authorization code for tokens
- Tokens are encrypted and stored on Trix servers
If your browser doesn't open automatically, copy the URL from the terminal and paste it in your browser manually.
trix integrations disconnect
Removes a connection and deletes associated OAuth tokens.
trix integrations disconnect <connection-id> [options]
Arguments:
connection-id The connection ID (e.g., conn_abc123)
Options:
--force Skip confirmation prompt
--keep-memories Don't delete imported memoriesExamples
# Disconnect with confirmation
trix integrations disconnect conn_abc123
# Force disconnect without prompt
trix integrations disconnect conn_abc123 --force
# Keep imported memories when disconnecting
trix integrations disconnect conn_abc123 --keep-memoriesBy default, disconnecting removes all memories imported from that
connection. Use --keep-memories to preserve them.
trix integrations list
Lists all connected integrations.
trix integrations list [options]
Options:
--provider Filter by provider (notion, google)
--status Filter by status (active, error, syncing)
--json Output as JSONExamples
# List all connections
trix integrations list
# List only Notion connections
trix integrations list --provider notion
# Output as JSON for scripting
trix integrations list --jsonOutput Format
ID PROVIDER NAME STATUS LAST SYNC
conn_abc123 notion Work Notion active 2 hours ago
conn_def456 google Personal active 15 minutes ago
conn_ghi789 notion Side Project error Failed: token expiredtrix integrations status
Shows detailed status and sync history for a connection.
trix integrations status <connection-id> [options]
Arguments:
connection-id The connection ID
Options:
--history Show sync job history
--limit Number of history entries (default: 10)
--json Output as JSONExamples
# Show connection status
trix integrations status conn_abc123
# Show with sync history
trix integrations status conn_abc123 --history
# Show last 20 sync jobs
trix integrations status conn_abc123 --history --limit 20Output Format
Connection: conn_abc123
Provider: notion
Name: Work Notion
Status: active
Created: 2024-01-01T10:00:00Z
Last Sync: 2024-01-15T10:30:00Z
Sync Statistics:
Total Memories: 156
Last Sync Added: 12
Last Sync Updated: 3
Last Sync Deleted: 0
Recent Sync Jobs:
TIME TYPE STATUS DURATION
2024-01-15 10:30:00 incremental completed 45s
2024-01-14 10:30:00 incremental completed 32s
2024-01-13 15:00:00 full completed 3m 12strix integrations sync
Triggers a sync job for a connection.
trix integrations sync <connection-id> [options]
Arguments:
connection-id The connection ID
Options:
--full Full sync (re-import everything)
--service Sync specific service (Google only: gmail, calendar, drive)
--since Only sync content newer than (e.g., "7d", "2024-01-01")
--labels Filter by labels/tags (Gmail only)
--wait Wait for sync to complete
--watch Watch sync progress in real-timeExamples
# Incremental sync (default)
trix integrations sync conn_abc123
# Full sync (re-import everything)
trix integrations sync conn_abc123 --full
# Sync only Gmail
trix integrations sync conn_def456 --service gmail
# Sync recent content only
trix integrations sync conn_abc123 --since "7d"
# Wait for completion
trix integrations sync conn_abc123 --wait
# Watch progress
trix integrations sync conn_abc123 --watchSync Types
| Type | Description | When to Use |
|---|---|---|
| Incremental | Only syncs changed content since last sync | Regular syncs, daily use |
| Full | Re-imports all accessible content | After permission changes, fixing sync issues |
Sync jobs run in the background by default. Use --wait to
block until completion, or --watch to see real-time progress.
Environment Variables
Configure CLI behavior with environment variables:
| Variable | Description | Default |
|---|---|---|
TRIX_API_KEY | API key for authentication | - |
TRIX_API_URL | Base URL for API requests | https://api.trixdb.com/v1 |
TRIX_OAUTH_PORT | Port for OAuth callback server | Random available port |
TRIX_NO_BROWSER | Disable auto-opening browser | false |
Exit Codes
| Code | Meaning |
|---|---|
| 0 | Success |
| 1 | General error |
| 2 | Authentication error |
| 3 | Connection not found |
| 4 | OAuth flow cancelled |
| 5 | Sync job failed |
Scripting Examples
Automated Daily Sync
#!/bin/bash
# sync-all.sh - Sync all integrations
for conn in $(trix integrations list --json | jq -r '.[].id'); do
echo "Syncing $conn..."
trix integrations sync "$conn" --wait
doneHealth Check
#!/bin/bash
# check-integrations.sh - Alert on failed connections
failed=$(trix integrations list --status error --json | jq length)
if [ "$failed" -gt 0 ]; then
echo "WARNING: $failed integration(s) in error state"
trix integrations list --status error
exit 1
fi
echo "All integrations healthy"
exit 0Export Connection List
# Export to CSV
trix integrations list --json | \
jq -r '["ID","Provider","Name","Status"], (.[] | [.id, .provider, .name, .status]) | @csv' \
> connections.csv