# command.CommandChain.command_count

- **Module:** command.CommandChain
- **Package:** libtmux
- **Language:** Rust
- **Kind:** method
- **Source:** https://github.com/libtmux/libtmux-rs/blob/f0e37052c232636b61d095817046e6bfc8f2ca40/crates/libtmux/src/command.rs#L377
- **Page:** https://libtmux.org/en/rs/latest/reference/command-commandchain-command_count/

```
command.CommandChain.command_count(self) -> usize
```

Return the number of commands in the chain, always at least one.

## Example

```rust
use libtmux::{Command, CommandChain};

let chain = CommandChain::new(Command::new("list-panes"));
assert_eq!(chain.command_count(), 1);
```
