# server.Server.cmd

- **Module:** server.Server
- **Package:** @libtmux/libtmux
- **Language:** TypeScript
- **Kind:** method
- **Source:** https://github.com/libtmux/libtmux-ts/blob/2cb93308200da38a26b59876618116850f110607/packages/libtmux/src/server.ts#L974
- **Page:** https://libtmux.org/reference/ts/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"]);
```
