# server.Server.cmd

- **Module:** server.Server
- **Package:** libtmux
- **Language:** TypeScript
- **Kind:** method
- **Source:** https://github.com/libtmux/libtmux-ts/blob/3fe1ca654b81b8cbf4a13b777a001a3298c87a6f/packages/libtmux/src/server.ts#L1040
- **Page:** https://libtmux.org/en/ts/latest/reference/server-server-cmd/

```
server.Server.cmd(command: : string, args: : readonly string[] = [], options: : CmdOptions) -> Promise<readonly string[]>
```

Run a tmux command this package does not model.

tmux has many more commands than any wrapper types. Rather than leaving a
caller to build their own subprocess — and reproduce the socket, the
environment, the deadline, and the error handling — this runs one through
the same path every other operation uses.

Failure raises {@link TmuxCommandError} like any other command, carrying
tmux's own stderr.

## Example

```ts
await server.cmd("list-keys", ["-T", "copy-mode"]);
```
