This file provides guidance to WARP (warp.dev) when working with code in this repository.
A CLI tool to migrate videos from Vimeo to Bunny.net Stream. Videos transfer directly from Vimeo to Bunny via URL fetch (no local downloads). The tool preserves folder structure (Vimeo folders → Bunny collections) and metadata (title, description, tags).
npm install # Install dependencies
npm run build # Compile TypeScript to dist/
npm run dev # Run directly with ts-node (development)
npm run start # Run compiled version from dist/
npm run build:binaries # Create standalone binaries with pkg# Via ts-node
npx ts-node src/index.ts <command>
# Or after building
node dist/index.js <command>
# Or if globally linked
vimeo2bunny <command>src/index.ts- CLI entry point using Commander.js. Defines commands:config,config:reset,list,migrate,statussrc/commands/- Individual command implementations (config.ts, list.ts, migrate.ts, status.ts)
src/services/vimeo.ts-VimeoClientclass wrapping Vimeo API. Handles pagination, rate limiting with exponential backoff, video/folder listingsrc/services/bunny.ts-BunnyClientclass wrapping Bunny Stream API. Handles collections, video fetch via URL, processing status pollingsrc/services/migration.ts-MigrationServiceorchestrates the migration in phases:- Discover Vimeo content
- Create Bunny collections from folders
- Initialize video migration tracking
- Migrate videos with concurrency control and timeout handling
src/types/index.ts- All TypeScript interfaces: Vimeo types (VimeoVideo, VimeoFolder, etc.), Bunny types (BunnyVideo, BunnyCollection, etc.), migration state types
src/utils/config.ts- Credential storage using OS keychain (via keytar) with conf fallback. Migration state persistence to~/.vimeo2bunny/migration-state.jsonsrc/utils/keychain.ts- Secure credential storage abstraction (macOS Keychain, Windows Credential Store, Linux Secret Service)src/utils/security.ts- Input validation (URL, IDs), metadata sanitization, safe error messagessrc/utils/schemas.ts- Zod schemas for validating migration statesrc/utils/logger.ts- Colored console output with chalksrc/utils/progress.ts- Spinner/progress indicators with ora
- Videos are tracked by
vimeoIdmetatag in Bunny to detect already-migrated videos and enable resumable migrations - Rate limiting handled via axios interceptors with retry-after header support
- Migration state is persisted after each operation for crash recovery
- Both APIs use pagination - always fetch all pages when listing
Credentials are resolved in order: Environment variables (VIMEO_ACCESS_TOKEN, BUNNY_LIBRARY_ID, BUNNY_LIBRARY_API_KEY) > OS keychain > conf file
No test framework is configured. When adding tests, verify the project's preferred testing approach first.