> For the complete documentation index, see [llms.txt](https://leaf.js.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://leaf.js.org/guide/plugins-command.md).

# Plugin's Command

Creating a command on an plugin.

```typescript
import Command from "../../../src/plugins/Command.js";

const cmd = new Command({
      name: "leave",
      description: "Left message",
      aliases: ["left"],
      args: {
        min: 1,
        max: 1,
      },
      arguments: [
        {
          name: "name",
          type: "wildcard_target",
          optional: false,
        },
      ],
});

cmd.run = () => {
      this.api.getLogger().info("[Command] wOW");
};

cmd.runAsPlayer = () => {
      this.api.getLogger().info("[Command] wOW");
};

// This will make this command to execute in console and in game.
cmd.execute(); 
```
