A cross-platform command-line tool for batch uploading files to Trint.
This CLI tool provides a convenient way to upload multiple files to Trint for batch processing. It supports Linux, macOS, and Windows operating systems.
npm install -g @trint/batch-uploador (yarn v1.x)
yarn global add @trint/batch-uploadBuild:
yarn
yarn buildDev Run:
yarn dev {params}After installation, you can use either command:
batch-upload [options]
# or
trint-batch-upload [options]-k, --api-key-id <id>- API key ID (or setTRINT_API_KEY_IDenvironment variable)-s, --api-key-secret <secret>- API key secret (or setTRINT_API_KEY_SECRETenvironment variable)
-u, --server <url>- Server URL (default: https://upload.trint.com, use https://upload.eu.trint.com for the EU tenant)
-f, --file <path>- File to upload (can be specified multiple times)-p, --pattern <glob>- Glob pattern for files (e.g.,"~/Videos/*.mp3","./audio/**/*.wav") (can be specified multiple times)-P, --pattern-file <path>- File containing glob patterns (one per line, # for comments) (can be specified multiple times)
-l, --language <code>- Language code for transcription (e.g.,en-GB,en,fr,es,de)
-c, --concurrent <number>- Number of concurrent uploads (default: 1, max: 6)
-D, --debug- Enable debug mode--dry-run- List files that would be uploaded without actually uploading
- The
--patternoption follows .gitignore-style glob syntax:*.mp3- Matches files recursively in all subdirectories**/*.mp3- Explicitly matches files in any subdirectoryaudio/*.mp3- Matches files only in theaudiosubdirectory*.{mp3,wav}- Matches multiple extensions- Hidden files (starting with
.) are not matched by default
- Only supported media file types are uploaded. Files are filtered based on their extension:
- Audio formats:
.mp3,.wav,.m4a,.aac,.ogg,.flac,.wma,.aiff,.opus - Video formats:
.mp4,.mov,.avi,.wmv,.flv,.mkv,.webm,.mpeg,.mpg,.3gp,.m4v - Unsupported files are automatically filtered out (use
--debugto see which files are excluded)
- Audio formats:
# Upload single file with API credentials
batch-upload --api-key-id YOUR_ID --api-key-secret YOUR_SECRET --file ./audio.mp3
# Using environment variables for credentials
export TRINT_API_KEY_ID=your_key_id
export TRINT_API_KEY_SECRET=your_key_secret
batch-upload --file ./audio.mp3
# Upload multiple files
batch-upload --file ./file1.mp3 --file ./file2.wav --file ./file3.m4a
# Upload with glob patterns
batch-upload --pattern "./recordings/**/*.mp3"
batch-upload --pattern "~/Videos/*.mp4" --pattern "~/Music/**/*.wav"
# Upload with pattern from file
batch-upload --pattern-file patterns.txt
# Multiple patterns with specific file types
batch-upload --pattern "./audio/**/*.{mp3,wav}" --pattern "./video/**/*.mp4"
# Upload with language specification
batch-upload --pattern "./recordings/**/*.mp3" --language en-GB
# Upload with concurrent uploads
batch-upload --pattern "./recordings/**/*.mp3" --concurrent 5
# Dry run - list files without uploading
batch-upload --pattern "./recordings/**/*.mp3" --dry-run
# Debug mode - see detailed information
batch-upload --pattern "./recordings/**/*.mp3" --debug
# Show help
batch-upload --help
# Show version
batch-upload --version- Cross-platform support (Linux, macOS, Windows)
- Batch file upload capability
- Multiple file selection
- Glob pattern matching for files
- Pattern file support (load patterns from text files)
- Language specification for transcription
- Concurrent upload support
- Environment variable configuration
- Dry run mode for testing
- Debug mode for troubleshooting
- Command-line interface
- TypeScript implementation
Using the environment variables for credentials is generally more convenient and usually considered safer than adding credentials to the commandline. To create credentials see the API page in the Trint web application:
Available environment variables:
TRINT_API_KEY_ID- Default API key ID (command-line option takes precedence)TRINT_API_KEY_SECRET- Default API key secret (command-line option takes precedence)
yarn buildyarn devyarn testyarn lintyarn formatContributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.