Skip to main content

Setup

1
Enable Gmail in config
2
export NTRP_GMAIL=true
3
Create Google OAuth credentials
4
  • Go to Google Cloud Console
  • Create a project (or select existing)
  • Enable the Gmail API
  • Create OAuth 2.0 credentials (Desktop application)
  • Download the credentials JSON
  • 5
    Place credentials
    6
    Save the downloaded file as ~/.ntrp/credentials.json.
    7
    Authenticate
    8
    Start the server and the TUI. On first use of any email tool, ntrp will open a browser window for OAuth consent. The token is saved to ~/.ntrp/gmail_token.json.

    Configuration

    VariableDefaultDescription
    NTRP_GMAILfalseEnable Gmail integration
    NTRP_GMAIL_DAYS30Days of email history to index

    Available tools

    ToolDescription
    emailsSearch and list emails by date or query
    read_emailGet full email content by ID
    send_emailSend an email (requires approval)

    Multiple accounts

    Add additional Gmail accounts via the API:
    curl -X POST http://localhost:8000/gmail/add \
      -H "Authorization: Bearer $NTRP_API_KEY"
    
    List connected accounts:
    curl http://localhost:8000/gmail/accounts \
      -H "Authorization: Bearer $NTRP_API_KEY"