# session.Session.cmd

- **Module:** session.Session
- **Package:** libtmux
- **Language:** TypeScript
- **Kind:** method
- **Source:** https://github.com/libtmux/libtmux-ts/blob/3fe1ca654b81b8cbf4a13b777a001a3298c87a6f/packages/libtmux/src/session.ts#L414
- **Page:** https://libtmux.org/en/ts/latest/reference/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"]);
```
