# Ad-hoc Command Aliases

Do you ever get tired of typing some built in commands and you'd like to just alias them as something simpler? You can create arbitrary alises now that reduce the amount of typing you do.

```
config set command.aliases.cca="coldbox create app"
cca myApp
```

In the above example, it's the same thing as typing `coldbox create app myApp`.

Aliases are treated as in-place shell expansions so you can alias anything including default parameters as well as multiple commands chained together.

```
config set command.aliases.foobar="echo brad | grep brad | sed s/rad/foo/ > foo.txt && cat foo.txt"
foobar
```

In the above example, typing `foobar` is the same as running the giant command string that's being set into the alias.

If you create an alias that matches an existing command name, your alias will take precedence since aliases are expanded before commands are resolved.

Here we can change the name of a common command like `echo` that we really wish had been named `print`.

```
config set command.aliases.print=echo
print brad
```

Let's take it a step further and alias the alias!

```
config set command.aliases.cout=print
cout brad
```

Running `cout brad` is the same as running `print brad` which is the same as running `echo brad`. Try not to get dizzy when doing this, please.


---

# 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://commandbox.ortusbooks.com/4.7.0/usage/ad-hoc-command-aliases.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.
