-
-
Notifications
You must be signed in to change notification settings - Fork 4
Home
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.
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
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, namedmy-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.
Command syntax is shown as follows:
muse
commandNameOrAlias <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 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.
Arguments that specify files can be given as paths relative to the current working directory, which is generally the project root.
COMMAND | ALIAS | DESCRIPTION |
---|---|---|
new | n | Creates a muse discord bot project. |
generate | g | Generates a new component for the project. |