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

# Commands Tips and Examples

> Learn about best practices for building effective dictation commands

A key functionality that brings an application from speech to text to a complete dictation solution is Commands. Put your users in the driver seat to control their workflow by defining commands to insert templates, navigate the application, automate repetitive tasks, and more!

<Tip>
  Commands detected by the server are sent to the client in a separate message type than transcripts, and include the following details:

  * Unique identifier for the recognized command.
  * Variable(s) recognized with the command.
  * Raw transcript text and time segments for the recognized command.

  [Click here](/api-reference/transcribe#commands) to view command response message details.

  [Click here](https://github.com/corticph/corti-examples/tree/main/dictation/commands) for a library of commands ready for use.
</Tip>

***

## Building an effective command

Below are some recommendations, tips, and tricks for building commands that are effective and reliable:

| | Best practice | Good Example | Bad Example |
| - | :- | :- | :- |
| 1 | Use an action verb as the first word in your command phrase because users are telling the computer to do something | "go to assessment section" | "assessment" |
| 2 | Don't make command phrases too long or too complex so that users can remember them and say them in one concise utterance | "insert normal exam male" | "insert physical exam for male with history of diabetes" |
| 3 | Make sure to not create command phrases with content that also needs to be recognized dictation text | "pull latest vitals" | "vital signs" |
| 4 | Be mindful of including articles, extraneous terms, and filler words in your command phrases as the command will only be recognized when the defined phrase is matched in full | "insert normal exam" | "insert the normal exam" |
| 5 | Use the variables feature to support having alternative methods to execute a single command | [`delete text`](/stt/commands#delete-text) | |
| 6 | Use the variables feature to support having a single command support many actions | [`navigation`](/stt/commands#navigation) | |

<Note>
  Be sure to test your commands!

  Dictate command phrases to make sure they are recognized reliably, and use the recognized text as phrases to be recognized for the command.
</Note>

***

## Client handling of detected commands

| | Best practice |
| - | :- |
| 1 | Configured commands must have unique values for `id` |
| 2 | Each command should have unique `phrases` to prevent conflicts |
| 3 | Add timeouts, error handling, and command execution logging so that a command does not run indefinitely when there are errors executing the action following command recognition |
| 4 | Consider which commands should be standardized across all users of the application or opened for custom user configuration |

<Note>
  Get creative!

  Most applications follow linear flows to click through from one place to another, but speech-enabling the application with commands opens a world of opportunity for supporting more dynamic navigation through the workflow.
</Note>


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