Skip to content
This repository has been archived by the owner on Mar 5, 2023. It is now read-only.
Spimy edited this page Jun 26, 2020 · 12 revisions

MuseCLI Overview and Command Reference

MuseCLI generates a discord.js bot with music features for you. You can use the generate command to automatically generate boilerplate for commands and events so you don't have to keep re-writing the same code every time you create a new component.

Installing MuseCLI

Install the CLI using the npm package manager:

npm install -g muse-cli

Install the CLI using the yarn package manager:

yarn global add muse-cli

For details about changes between versions, and information about updating from previous releases, see the Releases tab: https://github.com/Spimy/muse-cli/releases

Basic workflow

To create and build a new, basic muse project in typescript, go to the parent directory of your new workspace use the following commands:

muse new my-first-bot typescript
cd my-first-bot

Replace typescript with javascript if you wish to code in JavaScript. As of now (25/06/2020), JavaScript template has not yet been implemented.

For TypeScript: depending on the package manager, run npm build or yarn build to build the project and npm start or yarn start or run the project.
During development, you may need the project to auto-reload, so you may run npm dev or yarn dev for both TypeScript and JavaScript.

When you run muse new my-first-bot a new folder, named my-first-bot, will be created in the current working directory. Since you want to be able to create files inside that folder, make sure you have sufficient rights in the current working directory before running the command.

If the current working directory is not the right place for your project, you can change to a more appropriate directory by running cd <path-to-other-directory> first.

CLI command-language syntax

Command syntax is shown as follows:

musecommandNameOrAlias <requiredArgs>[options]

  • Most commands, and some options, have aliases. Aliases are shown in the syntax statement for each command.
  • Option names are prefixed with a double dash (--). Option aliases are prefixed with a single dash (-). Arguments are not prefixed. For example:
    muse new my-bot typescript -g
    
  • Option names can be given in either camelCase or dash-case. --myOptionName is equivalent to --my-option-name.

Boolean options

Boolean options has one form: --thisOption sets the flag. If no option is supplied, the flag remains in its default state, as listed in the reference documentation.

Relative paths

Arguments that specify files can be given as paths relative to the current working directory, which is generally the project root.

Command Overview

COMMAND ALIAS DESCRIPTION
new n Creates a muse discord bot project.
generate g Generates a new component for the project.