# Tab commands (/docs/v0.4/cli/tabs)



`--tab` and `--session` take a generated name or a printed id. A value that
reads as an id is used as an id and never looked up as a name.

<Callout>
  These verbs take `--remote <SERVER>` to act on a session on another machine.
  See [Remote commands](/docs/v0.4/cli/remote).
</Callout>

## `new-tab` [#new-tab]

```bash
koshi new-tab
koshi new-tab --session <NAME_OR_ID>
koshi new-tab --client <CLIENT_ID>
```

Creates one tab with one shell pane. Output contains the tab id first, then the
root pane id. `--client` names the attached terminal that switches to the new
tab. With several terminals attached, name a client when the command needs to
change one terminal's view.

## `close-tab` [#close-tab]

```bash
koshi close-tab
koshi close-tab --tab <NAME_OR_ID>
koshi close-tab --tab <NAME_OR_ID> --session <NAME_OR_ID> --force
```

Closing a tab closes every pane and process inside it. Closing the last tab
ends the session. `--force` skips the normal close guard.

## Cycle tabs [#cycle-tabs]

```bash
koshi next-tab
koshi previous-tab
koshi next-tab --client <CLIENT_ID>
```

Cycling changes one client's view. `--client` chooses the attached terminal.

## Focus one tab [#focus-one-tab]

```bash
koshi focus-tab --index 0
koshi focus-tab --tab <NAME_OR_ID>
koshi focus-tab --tab <NAME_OR_ID> --client <CLIENT_ID>
```

`--index` is zero-based. Use either `--index` or `--tab`.

## Reorder [#reorder]

```bash
koshi move-tab --index 0
koshi move-tab --tab <NAME_OR_ID> --index 2
```

Moves the chosen tab to a zero-based index without changing its pane layout.
The order belongs to the session, so every attached terminal sees the move.
