# Koshi 0.2.0 — Discovery commands (/docs/v0.2/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 <NAME_OR_ID>
koshi list-panes --session <NAME_OR_ID>
koshi list-clients --session <NAME_OR_ID>
```

| Command         | Output                                                       |
| --------------- | ------------------------------------------------------------ |
| `list-sessions` | Session ids and names                                        |
| `list-tabs`     | Tab ids and names, and the id and name of the owning session |
| `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 <NAME_OR_ID>
koshi inspect tab <NAME_OR_ID>
koshi inspect pane <PANE_ID>
koshi inspect client <CLIENT_ID>
```

`inspect` prints one full record. Add `--format json` for machine-readable
output. `inspect pane` shows a pane's command in full, arguments included.

## Names and ids [#names-and-ids]

Session and tab arguments take either the generated name or the printed id. An
id is never re-read as a name. A name that several targets share is refused,
and the error lists every matching id. Pane and client arguments take ids only.

## Ending a session [#ending-a-session]

`koshi kill-session` lives on [Session commands](/docs/v0.2/cli/sessions),
beside `attach` and `detach`.

## Reading running state [#reading-running-state]

For the whole picture — every session's tabs, panes, and clients at once, or a
tab's solved rectangles — use
[`koshi debug`](/docs/v0.2/cli/debug).
