# Discovery commands (/docs/v0.1/cli/discovery)



Every list and inspect command accepts `--format table` or `--format json`.
Table is the default.

## List [#list]

```bash
koshi list-sessions
koshi list-tabs --session <SESSION_ID>
koshi list-panes --session <SESSION_ID>
koshi list-clients --session <SESSION_ID>
```

| Command         | Output                                       |
| --------------- | -------------------------------------------- |
| `list-sessions` | Session ids and names                        |
| `list-tabs`     | Tab ids, names, indexes, and owning sessions |
| `list-panes`    | Pane, tab, and session ids and names         |
| `list-clients`  | Client ids and owning sessions               |

For scripts:

```bash
koshi list-panes --format json
```

## Inspect [#inspect]

```bash
koshi inspect session <SESSION_ID>
koshi inspect tab <TAB_ID>
koshi inspect pane <PANE_ID>
koshi inspect client <CLIENT_ID>
```

`inspect` prints one full record. Add `--format json` for machine-readable
output.

## End a session [#end-a-session]

```bash
koshi kill-session
koshi kill-session <NAME>
```

With no name, `kill-session` works only when exactly one session is running.
Names match exactly.
