Skip to main content

CLI Third-Party Integrations

Manage third-party integrations (GitHub, Notion, Google, N8N, Zapier) from the command line.

Overview

The Trix CLI provides commands to connect, sync, and manage third-party integrations directly from the terminal. Import memories from GitHub, Notion, Google, and connect to automation platforms like N8N and Zapier.

All integrations are managed via the trix integrations command group, providing a unified interface for connecting to external services.

Supported Integrations

IntegrationDirectionWhat You Can Import
GitHubImportRepositories, issues, pull requests, code
NotionImportPages, databases, blocks
GoogleImportGmail emails, Calendar events, Drive documents
N8NBidirectionalWebhooks, workflow triggers, automation
ZapierBidirectionalZaps, triggers, actions (6,000+ apps)

Connecting Integrations

connect

Connect a new third-party service to Trix using OAuth authentication.

connect.sh
# Connect GitHub
trix integrations connect github

# Connect Notion
trix integrations connect notion

# Connect Google (Gmail, Calendar, Drive)
trix integrations connect google

Running the connect command will:

  1. Open your browser for OAuth authorization
  2. Ask you to grant Trix access to the service
  3. Store encrypted credentials securely
  4. Return a connection ID for managing the integration

OAuth tokens are encrypted at rest using AES-256-GCM with account-specific keys. Your credentials are never stored in plaintext.

Syncing Data

sync

Import or sync data from a connected integration.

sync.sh
# Sync a specific connection
trix integrations sync <connection-id>

# Full sync (re-import everything)
trix integrations sync <connection-id> --full

# Incremental sync (only new/updated items)
trix integrations sync <connection-id> --incremental

✨ New: Automatic Background Sync!
All Google connections now automatically sync every 30 minutes in the background. No manual configuration needed!

Google Integration Commands

Recommended: For Google integrations, use the specialized trix google command which provides Gmail label filtering, Drive folder management, and Calendar preferences.

Connection Management

google-connect.sh
# Connect to Google
trix google connect

# List Google connections
trix google list

# View connection details
trix google status <connection-id>

# Trigger manual sync
trix google sync <connection-id>

# Disconnect
trix google disconnect <connection-id>

Gmail Label Configuration

google-gmail.sh
# List all Gmail labels
trix google gmail labels list <connection-id>

# View label sync preferences
trix google gmail labels preferences <connection-id>

# Enable specific labels
trix google gmail labels enable <connection-id> INBOX SENT IMPORTANT

# Disable specific labels
trix google gmail labels disable <connection-id> SPAM TRASH

# Sync label list from Gmail
trix google gmail labels sync <connection-id>

Drive Folder Configuration

google-drive.sh
# List all Drive folders
trix google drive folders list <connection-id>

# View folder sync preferences
trix google drive folders preferences <connection-id>

# Enable specific folders
trix google drive folders enable <connection-id> <folder-id-1> <folder-id-2>

# Disable specific folders
trix google drive folders disable <connection-id> <folder-id>

# Configure recursive sync
trix google drive folders set-recursive <connection-id> <folder-id> true

Calendar Configuration

google-calendar.sh
# List available calendars
trix google calendar list <connection-id>

# View calendar preferences
trix google calendar preferences <connection-id>

# Enable/disable specific calendars
trix google calendar enable <connection-id> <calendar-id>
trix google calendar disable <connection-id> <calendar-id>

# Configure sync range (days past/future)
trix google calendar set-range <connection-id> <calendar-id> --past 30 --future 90

Default Behavior: New Google connections sync only INBOX for Gmail. Configure label preferences to sync additional folders. Drive syncs all accessible folders by default unless you configure folder preferences.

Managing Connections

list

View all connected integrations:

list.sh
# List all connections
trix integrations list

# List with status
trix integrations list --status

# Filter by type
trix integrations list --type github

status

Check the status of a specific integration:

status.sh
# Check connection status
trix integrations status <connection-id>

# Shows:
# - Connection health
# - Last sync time
# - Total items imported
# - OAuth token expiry
# - Error status (if any)

disconnect

Remove a connection and revoke access:

disconnect.sh
# Disconnect an integration
trix integrations disconnect <connection-id>

# Keep imported memories (default)
trix integrations disconnect <connection-id> --keep-memories

# Delete all imported memories
trix integrations disconnect <connection-id> --delete-memories

Disconnecting an integration revokes OAuth tokens but keeps imported memories by default. Use --delete-memories to remove imported content.

GitHub Integration

Connecting GitHub

github-connect.sh
# Connect GitHub account
trix integrations connect github

# You'll be asked to:
# 1. Authorize Trix to access your GitHub account
# 2. Select which repositories to import
# 3. Configure sync settings

What Gets Imported

  • Repositories - README, description, topics, stars
  • Issues - Title, body, labels, state, comments
  • Pull Requests - Title, description, branch info, reviews
  • Code - File content (configurable)
github-sync.sh
# Sync specific repository
trix integrations sync <connection-id> --repo owner/repo

# Sync all repositories
trix integrations sync <connection-id> --all-repos

# Sync only issues
trix integrations sync <connection-id> --issues-only

Notion Integration

Connecting Notion

notion-connect.sh
# Connect Notion workspace
trix integrations connect notion

# Grant access to:
# 1. Pages you want to import
# 2. Databases to sync
# 3. Workspace settings

What Gets Imported

  • Pages - Converted to markdown with full content
  • Databases - Structure and entries
  • Blocks - Text, code, images, embeds
notion-sync.sh
# Sync all Notion content
trix integrations sync <connection-id>

# Sync specific page
trix integrations sync <connection-id> --page <page-id>

# Sync specific database
trix integrations sync <connection-id> --database <db-id>

Google Integration

Connecting Google

google-connect.sh
# Connect Google account
trix integrations connect google

# Select services to enable:
# - Gmail
# - Google Calendar
# - Google Drive

What Gets Imported

  • Gmail - Email bodies, subjects, senders, labels
  • Calendar - Events, attendees, descriptions
  • Drive - Document content (Docs, Sheets, Slides)
google-sync.sh
# Sync Gmail only
trix integrations sync <connection-id> --service gmail

# Sync Calendar only
trix integrations sync <connection-id> --service calendar

# Sync Drive only
trix integrations sync <connection-id> --service drive

Automation Platforms

N8N Integration

Connect Trix to N8N workflows for automation:

n8n.sh
# Setup N8N webhook
trix integrations connect n8n --webhook-url <url>

# Configure webhook signature verification
trix integrations connect n8n \
  --webhook-url <url> \
  --secret <webhook-secret>

Zapier Integration

Connect Trix to Zapier for 6,000+ app integrations:

zapier.sh
# Connect Zapier account
trix integrations connect zapier

# Authorize Trix in Zapier
# Then create Zaps using:
# - Triggers: New Memory, Updated Memory
# - Actions: Create Memory, Search Memories, Update Memory

Troubleshooting

Connection fails during OAuth

  • Check your internet connection
  • Ensure you're logged into the correct account in your browser
  • Try clearing browser cookies and cache
  • Verify the service isn't experiencing downtime

Sync fails or times out

  • Check connection status: trix integrations status <id>
  • Verify OAuth token hasn't expired (refresh automatically in most cases)
  • Try incremental sync instead of full sync
  • Check API rate limits for the service

Token expired errors

refresh-token.sh
# Refresh OAuth token manually
trix integrations refresh <connection-id>

# Or reconnect
trix integrations disconnect <connection-id>
trix integrations connect <provider>

Next Steps