Scripts Reference

All utility scripts in /scripts/

46 scripts for operations, testing, maintenance, and debugging.

Archive & Backup

ScriptPurposeWhen to Use
archive-inactive.tsArchive inactive companies to archive tablesMonthly cleanup
archive-non-ab.tsArchive non-AB companies to archive tablesPost-import cleanup
restore-from-archive.tsRestore companies from archive tablesOn request
backup-database.tsCreate pg_dump backup with timestampBefore major operations
verify-archive.tsValidate no active companies were lost in archiveAfter archive operation

Testing & Debugging

ScriptPurposeWhen to Use
test-enrichment-v7.tsRun enrichment v7 on single companyDevelopment testing
test-firecrawl-direct.tsTest Firecrawl API directlyFirecrawl debugging
test-fixed-scraper.tsTest scraper with fixed configScraper debugging
test-google-maps-enhanced.tsTest Google Places integrationMaps debugging
test-hunter-eniro.tsTest Hunter.io + EniroLegacy source debugging
test-platform-scraper.tsTest Wix/WordPress scrapersPlatform scraper debugging
test-scb-connection.tsTest SCB API connectivitySCB debugging
test-api-structure.tsVerify API endpoint structureAPI validation
test-contact-mapping.tsTest contact mapping logicContact mapping debugging
benchmark-domain-discovery.tsBenchmark domain discovery performancePerformance testing

Cache Management

ScriptPurposeWhen to Use
clear-cache.tsClear all Redis cachesCache corruption
clear-v7-cache.tsClear enrichment v7 cache onlyv7 config changes
clear-website-cache.tsClear website scrape cache onlyScraper changes

Enrichment Operations

ScriptPurposeWhen to Use
enrich-company.tsEnrich single company by orgNrManual enrichment
enrich-lead.tsEnrich single lead by orgNrManual lead enrichment
run-enrich.tsRun enrichment batchBatch processing

Data Import

ScriptPurposeWhen to Use
import-prv-trademarks.tsImport PRV trademark dataTrademark data update

Maintenance

ScriptPurposeWhen to Use
check-api-key.tsVerify API keys are validKey rotation
check-export.tsTest export functionalityExport validation
generate-reports.tsGenerate system reportsReporting
inspect-wins.tsInspect Windows-specific issuesWindows debugging
migrate.tsRun database migrationsSchema updates
update-vendfox-domain.tsUpdate VendFox domain manuallyDomain correction
fix-vendfox-domain.tsFix VendFox domain issuesDomain bugfix
verify-api.tsVerify API is respondingHealth check

Configuration

ScriptPurpose
add_cache_table.sqlSQL to add cache table
database_migration_unified_search.sqlUnified search migration
migrate_scb_schema_20260307.sqlSCB schema migration
populate_enhanced_leads.sqlPopulate enhanced leads table

Indexer

ScriptPurpose
indexer/debug-zone.pyDebug zone file parsing
indexer/download-zone.shDownload IIS .se zone file