Moonlight Docs v2.0 Help

Devtools

The moonlight dev tools is a script collection bundled into a CLI able to help you to set up projects faster. It allows you to create development environments with a few commands, start and set up a test database locally using docker. Additionally, the CLI is able to improve the contribution to the moonlight project itself by offering commands to pull your own fork of moonlight and develop features faster.

Installation

sudo su curl https://raw.githubusercontent.com/Moonlight-Panel/Devtools/main/mldev.sh > /usr/local/bin/mldev chmod +x /usr/local/bin/mldev

A linux vm and the command mentioned in the "Linux" tab :>

Contribution commands

Command

Description

mldev contribution setup <link to own fork on github>

This saves the link to your own fork on GitHub in the config files in ~/.config/mldev/contribution-url and will be used if you create a new contribution

mldev contribution create <name> <path> (branch)

This creates a new dev environment to modify the moonlight source code. The name you need to specify should not contain spaces, as it will be used as a branch name. Make sure the name makes sense if you want to create a pull request later. The path specified is the folder where the cli will create the development environment in. The optional branch parameter is the branch where the cli will create a sub-branch from

mldev contribution commit <description>

The command allows you to commit your changes to push them later to your own fork. You need to execute this in the directory where the mldev.meta file is located in your development environment. The description specifies the commit name

mldev contribution push

This command allows you to push your changes to your own fork on GitHub. You need to execute this in the directory where the mldev.meta file is located in your development environment

Database commands

Command

Description

mldev db start

This command starts a database container for the current project. You need to execute this in the directory where the mldev.meta file is located in your development environment. If the container is missing it will create one

mldev db stop

This command stops the database container for the current project. You need to execute this in the directory where the mldev.meta file is located in your development environment.

mldev db restart

This command stops the database container for the current project. You need to execute this in the directory where the mldev.meta file is located in your development environment.

mldev db delete

This command deletes the database container and the database volume for the current project. You need to execute this in the directory where the mldev.meta file is located in your development environment.

Plugin commands

Command

Description

mldev plugin create <name> <path> (branch)

This creates a new dev environment to develop a moonlight plugin. The name you need to specify should not contain spaces, as it will be used as a branch name. The path specified is the folder where the cli will create the development environment in. The optional branch parameter is the moonlight branch where the cli will download moonlight to compile and run the plugin from

mldev plugin run

The command allows you to compile your plugin and start it in moonlight. You need to execute this in the directory where the mldev.meta file is located in your development environment.

mldev plugin publish

This command allows you to create a build of your plugin which can be used without development environment. You need to execute this in the directory where the mldev.meta file is located in your development environment. The publish output will be located in the publish folder of your project

Last modified: 15 September 2024