# Commands

> Register functions in your app and run them, with typed arguments, from the desktop app. It is on by default.

Commands are functions in your app that you run from the desktop app: reset a flag, seed test data, force a logout. You fill in their arguments in a form and see what they returned or threw.

[Setting up Commands in the SDK](/docs/sdk/commands/)

![The Commands panel with a command run and its response open below the list](/_astro/commands-panel-light.BTuwKswk_Z2s55eR.webp)![The Commands panel with a command run and its response open below the list](/_astro/commands-panel-dark.B1McH8Wv_1Fvtn0.webp)

The Commands panel with a command run and its response open below the list

## Using the Commands panel

### Finding a command

Your commands are listed under **Custom commands**, and those Xerlock adds itself, such as the [navigation](/docs/desktop/navigation/) commands, under **Xerlock commands**. The **Custom** and **Xerlock** toggles choose which sections show. Click a section header to collapse it.

Type in **Search commands…** to show the commands whose name or description contains the text, ignoring case.

Click the star on a command to keep it at the top of its section. The rest are sorted by name.

### Running a command

Select a command to open it. **Parameters** shows its description and a field for each argument, labelled with its type and, when it can be left empty, **optional**.

**Response** shows what the handler returned, how long it took, and a **Copy** button. When the command fails, it shows **The command threw an error.** or **The app rejected these arguments.**, with the app’s message.

### History

Choose **History** to see the last 50 runs for this app, newest first, kept between sessions. Each shows whether it succeeded, its arguments and when it ran.

* **Run again** runs it with the same arguments.
* Select a run, then **Replay**, to change the arguments before running it.
* **No longer available** marks a command the app no longer registers.
* Responses larger than 20,000 characters aren’t kept.

**Clear history** clears this app’s runs. Your starred commands stay.

## Limits and Troubleshooting

* The desktop app waits 10 seconds for a command to finish. After that it shows **The command could not be run. The app did not answer as expected.**, while the handler carries on in the app.
* A command whose `registerCommand()` call you delete stays listed until the app reloads.
