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

# Command Aliases

> Turn any confine command into your own custom shortcut.

## Overview

An alias is a nickname you assign to a command. Instead of typing the full thing every time, you define a shortcut once and confine expands it for you — optionally with parts of the command already filled in.

They're most useful for commands your staff run constantly with the same arguments. Rather than `,role @someone @Image Perms` a dozen times a day, you set up `,pic @someone` and be done with it.

<Info>
  Creating and managing aliases requires the **Manage Server** permission.
</Info>

## Creating an alias

<CodeGroup>
  ```javascript Syntax theme={null}
  ,alias add (shortcut) (command)
  ```

  ```javascript Example theme={null}
  ,alias add deport ban
  ```
</CodeGroup>

`,alias create` does the same thing if you prefer that wording.

### Rules for shortcuts

A few things confine won't accept:

| Rule              | Detail                                                                 |
| ----------------- | ---------------------------------------------------------------------- |
| Length            | Between 1 and 64 characters                                            |
| Opening character | Can't begin with `,` `'` `"` `<` or `@`                                |
| Conflicts         | Can't match an existing confine command or one of its built-in aliases |
| Target            | The command you're aliasing has to be real — typos get rejected        |

## Filling in arguments ahead of time

The real value of aliases comes from baking arguments in. Anything typed after the alias gets slotted into numbered placeholders — `{0}` for the first word, `{1}` for the second, and upward from there.

Take a normal command:

```javascript theme={null}
,ban @financely spamming invite links
// {0} → @financely
// {1} → spamming invite links
```

Now wrap it in an alias that locks the duration in place:

```javascript theme={null}
,alias add hush timeout {0} 10m
,hush @financely
```

Running `,shh @`financely fires `,timeout @`financely` 10m`. The member comes from your input, the ten minutes is fixed.

<Tip>
  Numbering starts at zero, not one. `{0}` is always the first thing typed after your shortcut.
</Tip>

### Example: a one-word image permission command

```javascript theme={null}
,alias add pic role {0} @Image Perms
,pic @financely
```

Your moderators never have to remember the role name — they just tag someone.

## Deleting aliases

### One at a time

<CodeGroup>
  ```javascript Syntax theme={null}
  ,alias remove (shortcut)
  ```

  ```javascript Example theme={null}
  ,alias remove deport
  ```
</CodeGroup>

### Every alias pointing at one command

Handy when a single command has collected several shortcuts over time.

<CodeGroup>
  ```javascript Syntax theme={null}
  ,alias removeall (command)
  ```

  ```javascript Example theme={null}
  ,alias removeall ban
  ```
</CodeGroup>

### Everything at once

`,alias reset` wipes every alias in the server. You'll get a confirmation prompt with buttons first — it only listens to whoever ran the command, and times out after 30 seconds if left alone.

## Checking what's configured

<AccordionGroup>
  <Accordion title="Looking up a single alias">
    Forgot what a shortcut actually does? Check it directly.

    <CodeGroup>
      ```javascript Syntax theme={null}
          ,alias view (shortcut)
      ```

      ```javascript Example theme={null}
          ,alias view deport
      ```
    </CodeGroup>
  </Accordion>

  <Accordion title="Listing everything">
    Run `,alias list` for a paginated view of every alias in the server alongside the command each one runs.
  </Accordion>
</AccordionGroup>
