> ## Documentation Index
> Fetch the complete documentation index at: https://docs.headlesslabs.xyz/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Command aliases

> Aliases create persistent per-server shortcuts for registered Headless commands. They do not replace the original command's access checks or permissions.

## Access and scope

Creating, viewing, and deleting aliases requires Discord's `Manage Server` permission. Each server can store up to 100 shortcuts in a separate configuration. Examples use `.`; use the prefix configured for your server.

## Templates and arguments

`.alias add <shortcut> <command and arguments>` can store fixed text and placeholders. `{}` inserts all remaining text supplied when invoking the shortcut; `{0}`, `{1}`, and later indexes insert zero-based argument positions. Without placeholders, the invocation text is appended to the end of the target.

## Target validation

A shortcut name accepts 1–24 characters: ASCII letters, numbers, `_`, and `-`. It cannot occupy a registered command name or change the meaning of a built-in shorthand; runtime permits a redundant mapping only when it points to the exact same command. It also cannot match the root of its target or point to another custom alias. The destination must be a registered Headless command; it may use a built-in command or its official alias, cannot contain control characters, and is limited to 300 characters.

## Inspect, paginate, and delete

`.alias view` shows one shortcut's target and `.alias list` lists server aliases. The list shows 20 per page; only the person who opened it can use its pagination controls, which expire after 120 seconds. `.alias remove` immediately deletes one alias. `.alias removeall` deletes shortcuts targeting one registered command path, while `.alias reset` deletes all custom aliases; both require confirmation within 60 seconds by the same user, who must still have `Manage Server`. Built-in aliases are not deleted.

## Steps

**1. Choose a registered command**

Use a real command path from Commands, such as `ban`. The destination may be a built-in command or its official alias; do not target another custom alias or the `.alias` system itself.

**2. Choose how arguments are passed**

Use `{}` to retain all remaining text or `{0}`, `{1}` for zero-based positions; include fixed target text only when needed.

**3. Create and test the shortcut**

Run `.alias add` and test the invocation. The original command's permissions, access checks, and validation remain active.

**4. Review before bulk deletion**

Check `.alias list` or `.alias view`. For `removeall` or `reset`, review the summary and confirm only if you intend to remove those shortcuts.

> **Full validation rules**
>
> An alias is one word of 1–24 characters (`a-z`, `0-9`, underscore, or hyphen). It cannot occupy a registered command root or change a reserved shorthand; a redundant mapping is accepted only when it preserves the exact built-in target. It also cannot match the root of its destination. The target must be a registered path no longer than 300 characters; control characters, invalid braces, and chained aliases are rejected. Supported placeholders are `{}`, `{0}`, `{1}`, and other numeric positions.

## Commands by workflow

### Create, inspect, and list aliases

```headless-command Syntax theme={null}
.alias add [shortcut] [command]
```

```headless-command Example theme={null}
.alias add deport ban {0} {1}
```

```headless-command Syntax theme={null}
.alias view [shortcut]
```

```headless-command Example theme={null}
.alias view deport
```

```headless-command Syntax theme={null}
.alias list
```

```headless-command Example theme={null}
.alias list
```

### Remove aliases

```headless-command Syntax theme={null}
.alias remove [shortcut]
```

```headless-command Example theme={null}
.alias remove deport
```

```headless-command Syntax theme={null}
.alias removeall [command]
```

```headless-command Example theme={null}
.alias removeall ban
```

```headless-command Syntax theme={null}
.alias reset
```

```headless-command Example theme={null}
.alias reset
```

> [!WARNING]
>
> `removeall` and `reset` are bulk-delete operations, but they do not affect built-in aliases. Canceling or letting the confirmation expire leaves the configuration unchanged.

**Note:**

This example makes `.deport @Member Spam` invoke the real `.ban @Member Spam` command. Alias data is stored with the server ID in the persistent `command_aliases` collection.

## Related pages

* [Command syntax](/docs/en/resources/syntax.md)
* [Headless permissions](/docs/en/permissions.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.