# server.Server.listCommands

- **Module:** server
- **Package:** libtmux
- **Language:** TypeScript
- **Kind:** method
- **Source:** https://github.com/libtmux/libtmux-ts/blob/073b9d7dedad900bff6f5ec0ea47794e40225870/packages/libtmux/src/server.ts#L1396
- **Page:** https://libtmux.org/en/ts/latest/reference/server-server-listcommands/

```
listCommands(): Promise<readonly string[]>
```

Every command name the running tmux understands.

## Examples

```ts
const commands = await server.listCommands();
commands.includes("new-window"); // true
```

## tmux command

The tmux commands behind `listCommands`.

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

## tmux C API

The C declarations in tmux that implement these commands.

- [`cmd_list_commands_entry`](/en/tmux/latest/reference/c-variable-cmd_list_commands_entry/) (attribute)
- [`cmd_list_commands`](/en/tmux/latest/reference/c-function-cmd-list-commands-c-cmd_list_commands/) (function)

## In other ports

List the commands this tmux understands

| Language | Equivalent |
| --- | --- |
| Python | [`libtmux.Server.list_commands`](/en/py/latest/reference/libtmux-server-list_commands/) (method) |
| Rust | no equivalent on `Server` |
| Go | [`tmux.Server.ListCommands`](/en/go/latest/reference/tmux-server-listcommands/) (method) |
| Java | [`io.github.libtmux.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) |
| Swift | no equivalent on `Server` |

No equivalent is recorded in Ruby, Lua, PowerShell, Julia, Elixir, Kotlin, Scala or F#.
