At the end of last year I wrote a small CLI to make my life a little easier. I kept finding myself doing the same manual things over and over, so like any lazy procrastinating good dev I spent a few hours writing code to knock off a minute or two each time I need to do one of these tasks.
I should stress, this tool should be considered beta. I've been using it myself for a few months along with a few other folks internally (they claim), as well as the occasional friendly customer. The last friendly customer seemed offended that this wasn't more accessible, so we decided to go ahead and make it public.
Getting Started
First you need to install the CLI however you normally install global packages. I personally use Volta so I'm biased, but you can pick your poison.
From there you'll need to initialize the CLI so it has the right credentials set up. If you haven't already, create a Mux Access Token in your dashboard and give it the appropriate access (you probably want read/write access for Video at least or it's not going to be terribly useful). Save the newly created access token locally when asked. For this example, we'll save it to ~/Downloads/MuxToken.env.
Now use that .env file to initialize the CLI!
You can also call init without specifying an environment file and the CLI will prompt you for your token ID and secret. The CLI will also ask if you want to go ahead and set up a signing key. This is optional, but you might want to do it if you want to use the signed playback policy tools.
From here, you can go wild! You can upload a handful of files from a directory if you'd like:
What's next?
We've got big plans for the CLI long term! Standalone binaries, easier initialization, and a laundry list of features are just a few of the things we've got planned right now. We'd love to hear how you'd like to use it, though, so feel free to let us know via an issue on the Github repo!
Happy hacking!