# session.Session.cmd

- **Module:** session.Session
- **Package:** @libtmux/libtmux
- **Language:** TypeScript
- **Kind:** method
- **Source:** https://github.com/libtmux/libtmux-ts/blob/2cb93308200da38a26b59876618116850f110607/packages/libtmux/src/session.ts#L407
- **Page:** https://libtmux.org/reference/ts/session-session-cmd/

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

Run a tmux command this package does not model, addressed at this session.

The first argument is the tmux command name and nothing else — this does
not parse a command line, so arguments go in the array:

The session's id is sent as the target; pass `target` to address something
else, or `null` for a command that takes none.

## Example

```ts
await session.cmd("rename-session", ["--", "renamed"]);
```
