To make it easier to process local files, we have created a CLI that you can install directly in your computer. This is a great way to process folders containing multiple files and to save the results locally on your computer.
Install
npm install -g @music.ai/cli
Authenticate
export MUSIC_AI_API_KEY=your-api-key
Process local file
High-level method to process a single local file. Behind the scenes, this will: create a new job; wait for its completion; download the results to your local folder; and delete the job from the developer platform.
musicai process file <workflow> <fileLocation> <outputFolder>
Process local folder
Similar to the previous method, but will process all files in the folder:
musicai process folder <workflow> <inputFolder> <outputFolder> [--watch]
You can use the --watch option to continuously process new files added to the inputFolder
Add job
musicai job add <name> <workflow> <inputFile>
Delete job
musicai job delete <jobId>
Job info
musicai job info <jobId>
Job list
musicai job list