# libtmux.Server.list_commands

- **Module:** libtmux
- **Package:** libtmux
- **Language:** Python
- **Kind:** method
- **Source:** https://github.com/tmux-python/libtmux/blob/38e368c11117fb4aeb2f082d552cd4f210eae06a/src/libtmux/server.py#L798
- **Page:** https://libtmux.org/en/py/stable/reference/libtmux-server-list_commands/

tmux command: [`list-commands`](/en/tmux/latest/manual/list-commands/)

```
libtmux.Server.list_commands(
    self, command_name: str | None = None
) -> list[str]
```

List tmux commands via [`$ tmux list-commands`](/en/tmux/latest/manual/list-commands/).

## Examples

```python
>>> result = server.list_commands(command_name='send-keys')
>>> len(result) >= 1
True
```

## Parameters

- `command_name` (`str | None`): Filter to a specific command.

## Returns

list[str]
    Command listing lines.

## In other ports

### List the commands this tmux understands

- TypeScript: [`server.Server.listCommands`](/en/ts/latest/reference/server-server-listcommands/) (method)
- Go: [`tmux.Server.ListCommands`](/en/go/latest/reference/tmux-server-listcommands/) (method)
- Java: [`io.github.libtmux.Commands.Commands.list`](/en/java/latest/reference/io-github-libtmux-commands-commands-list/) (method)
- C#: [`LibTmux.Server.GetCommandsAsync`](/en/csharp/latest/reference/libtmux-server-getcommandsasync/) (method)
- C++: [`libtmux::Server::commands`](/en/cxx/latest/reference/libtmux-server-commands/) (method)
