# key

> Press a key on the iPhone's Bluetooth keyboard, optionally with modifiers or repeated.

Source: https://zeptap.com/docs/cli/commands/key



## Usage [#usage]

```sh
zeptap key <name> [--mod cmd,shift,ctrl,alt] [--repeat <n>]
zeptap key cmd+a
```

`press` is an alias.

## Options [#options]

| Option         | Description                                                                                                                      |
| -------------- | -------------------------------------------------------------------------------------------------------------------------------- |
| `<name>`       | `enter`, `escape`, `backspace`, `tab`, `space`, `arrow_up`, `arrow_down`, `arrow_left`, `arrow_right`, `a`, `c`, `v`, `x` or `z` |
| `--mod <list>` | Modifiers, comma-separated: `cmd`, `shift`, `ctrl`, `alt`                                                                        |
| `--repeat <n>` | Press it this many times (default 1)                                                                                             |

Also takes the [global options](https://zeptap.com/docs/cli#global-options).

## Details [#details]

* Aliases: `return` for `enter`, `esc` for `escape`, `delete` for `backspace`, and `up`, `down`, `left`, `right` for the arrows. `command`, `control`, `opt` and `option` work as modifiers.
* `cmd+a` style works too: everything before the last `+` is a modifier.
* `a`, `c`, `v`, `x` and `z` exist for the shortcuts: select all, copy, paste, cut and undo.

## Examples [#examples]

```sh
$ zeptap key -l 7 enter
$ zeptap key -l 7 backspace --repeat 12
$ zeptap key -l 7 cmd+a
$ zeptap key -l 7 v --mod cmd
```

## MCP tool [#mcp-tool]

[`press_key`](https://zeptap.com/docs/agents/tools#press_key).
