---
title: commands
framework: appkit
role: symbol
role_heading: Instance Property
path: appkit/nsspeechrecognizer/commands
---

# commands

An array of strings defining the commands for which the speech recognizer object should listen.

## Declaration

```swift
var commands: [String]? { get set }
```

## Discussion

Discussion Setting this property when the speech recognizer is already listening means that the current command list is updated and listening continues. The items in the array should be NSString objects. The command strings must match the current locale of the recognizer, which is selected in the Dictation pane of Accessibility system preferences.

## See Also

### Configuring Speech Recognizers

- [displayedCommandsTitle](appkit/nsspeechrecognizer/displayedcommandstitle.md)
- [listensInForegroundOnly](appkit/nsspeechrecognizer/listensinforegroundonly.md)
- [blocksOtherRecognizers](appkit/nsspeechrecognizer/blocksotherrecognizers.md)
