# Commands

## Command Format

{% code title="Example command" overflow="wrap" %}

```yaml
# [OPTIONAL] → Command Identifier
# You can remove any command from the configuration to disable it.
# The identifier will not affect the command, it can be named anything.
command:

    # [REQUIRED] → Command Type
    # The command type determines how the command will work.
    type: "info"
    
    # [REQUIRED] → Command Name
    # The name of the command, for example:
    # /[name] [arguments]
    name: "name"
    
    # [OPTIONAL] → Command Toggle
    # Disable or enable the command.
    # The value defaults to true.
    enabled: true

    # [OPTIONAL] → Command Aliases
    # Every command can have unlimited aliases.
    # Aliases are alternative command names that will execute the same command.
    aliases: ["name2", "name3"]

    # [OPTIONAL] → Command Permission
    # Every command can have permission to execute the command.
    # When this is not set, it will default to everyone.
    permission: "leaf.name"
    
    # [OPTIONAL] → Command Requirements
    # Add a permission requirement for different servers.
    require:
      # The requirements identifier.
      # This can be anything.
      "identifier":
        # The required permission.
        permission: "leaf.bypass"
        # The servers that the permission is required on.
        servers:
        - "ServerName"
```

{% endcode %}

## Example Command

{% code title="commands.yml" %}

```yaml
#  __         ______     ______     ______
# /\ \       /\  ___\   /\  __ \   /\  ___\
# \ \ \____  \ \  __\   \ \  __ \  \ \  __\
#  \ \_____\  \ \_____\  \ \_\ \_\  \ \_\
#   \/_____/   \/_____/   \/_/\/_/   \/_/
#
# Author : Smudge

commands:
  info:
    type: "info"
    name: "hello"
    # This message will be sent back to the player!
    message: "hello world"
```

{% endcode %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://smuddgge.gitbook.io/leaf-3.0.0/commands.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
