A Node.js command-line tool that fetches call transcripts from Close CRM, analyzes them using OpenAI ChatGPT batch processing, and generates summary reports with percentage breakdowns.
- Fetch Transcripts: Download call transcripts from Close CRM with flexible filtering options
- AI-Powered Analysis: Process transcripts using OpenAI ChatGPT with custom analysis questions
- Summary Reports: Generate reports with percentage breakdowns and visualizations
- Flexible Filtering: Filter by date range, SDR name, and deal stage
- Multiple Export Formats: Console output, JSON, and CSV exports
- Node.js: Version 18.x or higher
- Close CRM API Key: Required for fetching transcripts
- OpenAI API Key: Required for analyzing transcripts
npm install -g call-transcript-analyzerOr for local development:
git clone <repository-url>
cd call-transcript-analyzer
npm install
npm linkCreate a .env file in your project directory:
# Required
CLOSE_API_KEY=api_your_close_crm_key_here
OPENAI_API_KEY=sk-your_openai_key_here
# Optional
OPENAI_MODEL=gpt-4o-mini
LOG_LEVEL=info
OUTPUT_DIR=./analysis-resultsAvailable OpenAI Models:
gpt-4o-mini(default) - Fast and cost-effectivegpt-4o- More capable, higher costgpt-4-turbo- Previous generation, good balancegpt-3.5-turbo- Fastest, lowest cost
Choose based on your accuracy requirements and budget.
Create a questions.json file defining your analysis questions:
[
{
"id": "q1",
"text": "Did the SDR build rapport with the prospect?",
"answerFormat": "multiple_choice",
"options": ["Yes", "No", "Partially"],
"includeInReport": true
},
{
"id": "q2",
"text": "Rate the SDR's objection handling (1-5)",
"answerFormat": "rating_scale",
"scaleRange": { "min": 1, "max": 5 },
"includeInReport": true
}
]See config/questions.example.json for more examples.
call-analyzer fetch \
--start-date 2025-10-01 \
--end-date 2025-10-31 \
--output ./analysis-resultscall-analyzer analyze \
--input ./analysis-results/transcripts \
--questions ./questions.json \
--output ./analysis-results/analyzedcall-analyzer report \
--input ./analysis-results/analyzed \
--questions ./questions.jsonFetch call transcripts from Close CRM.
call-analyzer fetch [options]Options:
--start-date <date>- Start date in YYYY-MM-DD format--end-date <date>- End date in YYYY-MM-DD format--sdr <name>- Filter by SDR name--stage <stage>- Filter by deal stage (Discovery, Demo, Negotiation, etc.)-o, --output <dir>- Output directory (default: ./analysis-results)
Example:
call-analyzer fetch --start-date 2025-10-01 --end-date 2025-10-31 --sdr "John Smith"Process transcripts using OpenAI ChatGPT batch API.
call-analyzer analyze [options]Options:
-i, --input <dir>- Input directory with transcript files-q, --questions <file>- Questions configuration file-o, --output <dir>- Output directory for analysis results--overwrite- Overwrite existing analysis results
Example:
call-analyzer analyze --input ./transcripts --questions ./questions.json --output ./analyzedGenerate aggregate reports from analyzed transcripts.
call-analyzer report [options]Options:
-i, --input <dir>- Input directory with analysis results-q, --questions <file>- Questions configuration file-f, --format <format>- Output format: console, json, or csv (default: console)-o, --output <file>- Output file path (required for json/csv)--start-date <date>- Filter results by start date--end-date <date>- Filter results by end date--sdr <name>- Filter results by SDR name--stage <stage>- Filter results by deal stage
Examples:
# Console output
call-analyzer report --input ./analyzed --questions ./questions.json
# Export to JSON
call-analyzer report --input ./analyzed --questions ./questions.json --format json --output report.json
# Export to CSV
call-analyzer report --input ./analyzed --questions ./questions.json --format csv --output report.csv
# Filtered report
call-analyzer report --input ./analyzed --questions ./questions.json --sdr "Jane Doe"Filter by SDR and Date Range:
call-analyzer fetch \
--sdr "John Smith" \
--start-date 2025-10-01 \
--end-date 2025-10-31 \
--output ./resultsFilter by Deal Stage:
call-analyzer fetch \
--stage Discovery \
--start-date 2025-10-01 \
--end-date 2025-10-31 \
--output ./results# 1. Fetch transcripts
call-analyzer fetch \
--start-date 2025-10-01 \
--end-date 2025-10-31 \
--output ./analysis
# 2. Analyze with questions
call-analyzer analyze \
--input ./analysis/transcripts \
--questions ./questions.json \
--output ./analysis/analyzed
# 3. Generate report
call-analyzer report \
--input ./analysis/analyzed \
--questions ./questions.jsonLogs are automatically stored in ./logs/ directory with daily rotation:
- File:
./logs/call-analyzer-YYYY-MM-DD.log - Retention: 30 days
- Format: JSON with timestamps, call IDs, and error details
The tool handles common errors gracefully:
- Invalid API Keys: Clear error messages with setup instructions
- Rate Limiting: Automatic prompts to continue, skip, or abort
- Partial Failures: Continues processing remaining items and logs errors
- Empty Results: Helpful messages when no data matches filters
npm run buildnpm testnpm run lint
npm run lint:fix- Check date range is correct
- Verify SDR name spelling (case-sensitive)
- Ensure API key has proper permissions
- Large batches (100+ calls) can take 30-60 minutes
- Split into smaller batches if needed
- Check OpenAI API usage and limits
- Ensure
.envfile exists with API keys - Verify
questions.jsonis properly formatted - Check file paths are correct
ISC
For issues and questions, please check:
- Configuration files (
.env,questions.json) - Log files in
./logs/directory - Close CRM and OpenAI API status