FoxReach
Back to Blog
Product Updates

Manage FoxReach from Your Terminal with the CLI

List leads, create campaigns, check analytics, and more — all from the command line with the official FoxReach CLI.

FoxReach Team3 min read

Overview

The FoxReach CLI brings your outreach workspace to the terminal. Built on top of the Python SDK, it gives you fast, scriptable access to leads, campaigns, templates, email accounts, inbox, and analytics — with rich table output by default and a --json flag for piping into other tools.

Install it with pip:

pip install foxreach-cli

Setup

After installing, set your API key:

foxreach config set-key
# Enter your API key: otr_your_key
# ✓ API key saved to ~/.foxreach/config.json

You can also use environment variables (they take precedence over the config file):

export FOXREACH_API_KEY="otr_your_key"

Verify the setup:

foxreach config show
# API Key: otr_****_key
# Base URL: https://api.foxreach.io

Leads

# List all active leads
foxreach leads list --status active

# Search for leads
foxreach leads list --search "techcorp"

# Get a specific lead
foxreach leads get cld_abc123

# Create a lead
foxreach leads create \
  --email jane@example.com \
  --first-name Jane \
  --last-name Smith \
  --company TechCorp

# Update a lead
foxreach leads update cld_abc123 --company "TechCorp Inc."

# Delete a lead
foxreach leads delete cld_abc123

Campaigns

# List campaigns
foxreach campaigns list
foxreach campaigns list --status active

# Create a campaign
foxreach campaigns create \
  --name "Q1 Enterprise Outreach" \
  --timezone "America/New_York" \
  --daily-limit 50

# Add leads to a campaign
foxreach campaigns add-leads cmp_xyz \
  --lead-ids cld_abc123,cld_def456

# Assign email accounts
foxreach campaigns add-accounts cmp_xyz \
  --account-ids acc_sender1

# Start, pause, or check a campaign
foxreach campaigns start cmp_xyz
foxreach campaigns pause cmp_xyz
foxreach campaigns get cmp_xyz

Sequences

# List sequence steps in a campaign
foxreach sequences list --campaign cmp_xyz

# Add a sequence step
foxreach sequences create --campaign cmp_xyz \
  --subject "Quick question about {{company}}" \
  --body "Hi {{firstName}}, I noticed {{company}} is growing..." \
  --delay-days 0

# Add a follow-up
foxreach sequences create --campaign cmp_xyz \
  --subject "Re: Quick question" \
  --body "Hi {{firstName}}, just following up..." \
  --delay-days 3

Templates

# List templates
foxreach templates list

# Create a template
foxreach templates create \
  --name "SaaS Founder Outreach v1" \
  --subject "Quick question about {{company}}" \
  --body "Hi {{firstName}}..."

# Update a template
foxreach templates update tpl_abc --name "SaaS Founder Outreach v2"

Inbox & Analytics

# List inbox threads
foxreach inbox list
foxreach inbox list --unread --category interested

# Check analytics
foxreach analytics overview
foxreach analytics campaign cmp_xyz

JSON Output for Scripting

Every command supports --json for machine-readable output. Pipe it into jq for powerful scripting:

# Get all active lead emails
foxreach leads list --status active --json | jq -r '.data[].email'

# Count leads per company
foxreach leads list --json | jq -r '.data[].company' | sort | uniq -c | sort -rn

# Export campaign stats
foxreach analytics campaign cmp_xyz --json > campaign_report.json

Complete Workflow: Create and Launch a Campaign

Here's a full workflow from the terminal:

# 1. Create leads
foxreach leads create --email sarah@techcorp.io --first-name Sarah --last-name Chen --company TechCorp --json | jq -r '.data.id'
foxreach leads create --email mike@startupco.com --first-name Mike --last-name Johnson --company StartupCo --json | jq -r '.data.id'

# 2. Create campaign
CAMPAIGN_ID=$(foxreach campaigns create --name "Q1 Outreach" --daily-limit 50 --json | jq -r '.data.id')

# 3. Add sequences
foxreach sequences create --campaign $CAMPAIGN_ID --subject "Quick question" --body "Hi {{firstName}}..." --delay-days 0
foxreach sequences create --campaign $CAMPAIGN_ID --subject "Following up" --body "Hi {{firstName}}, just checking in..." --delay-days 3

# 4. Add leads and accounts
foxreach campaigns add-leads $CAMPAIGN_ID --lead-ids cld_abc,cld_def
foxreach campaigns add-accounts $CAMPAIGN_ID --account-ids acc_sender1

# 5. Launch!
foxreach campaigns start $CAMPAIGN_ID

Resources

Stay ahead of the inbox

Get cold email tips, deliverability hacks, and product updates. No spam, unsubscribe anytime.