@music.ai/cli

1.0.11 • Public • Published

Music.AI CLI

This package bundles a CLI to allow basic usage of the Music.AI API.

Quick start

Here's how you can easily process a folder containing audio files against the music-ai/isolate-drums workflow:

export MUSIC_AI_API_KEY=your-api-key
musicai process folder music-ai/isolate-drums ./audio ./stems

Installation

npm i @music.ai/cli -g

CLI Reference

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.

In addition to these steps, the result will also be saved in a file named workflow.result.json. This file will contain all the outputs in JSON format. If an output is a file, the relative path to the downloaded file will be written in the JSON. If the output is not a file, the actual value will be written instead.

musicai process file <workflow> <fileLocation> <outputFolder>
Example

If the workflows has two outputs, vocals in WAVE format and bpm, two files will be created at the output folder: vocals.wav and workflow.result.json.

// workflow.result.json
{
  "vocals": "./vocals.wav",
  "bpm": "64"
}

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 <jobId>

/@music.ai/cli/

    Package Sidebar

    Install

    npm i @music.ai/cli

    Weekly Downloads

    74

    Version

    1.0.11

    License

    none

    Unpacked Size

    15.2 kB

    Total Files

    5

    Last publish

    Collaborators

    • hugorodrigues
    • mateuspires