If you just want to add a button that triggers a specific function you should probably consider the Playlist Commands Helper which is designed to expedite simple command creation. However, if you need to create a command that isn't so simple you'll need to do it without the playlist commands helper. The first thing you'll need to do is create a hollow PlaylistCommandsBuilder that we'll make into the command or commands you want.
Once we've got a hollow command object, we can start specializing it by adding one or more of the command types. For example, if we wanted to create a new submenu we would need to append a submenu command type to newCommand
Each command object can support multiple commands within itself, and you can control where commands appear relative to one another using insert*Before and insert*After. With this command created, the next step is to register it to a medialist or medialists. See the Playlist Commands Manager section for more information.