# Session Commands

URL: https://tuios.dev/docs/cli-reference/session-commands

> Session Commands: part of the CLI Reference of TUIOS.

This page is one part of `docs/CLI_REFERENCE.md` of the [tuios repository](https://github.com/Gaurav-Gosain/tuios/blob/f32fbfd7faca14e5260a1d711262cb81c49f68a6/docs/CLI_REFERENCE.md). The [CLI Reference](https://tuios.dev/docs/cli-reference) page lists every part.

## Session Commands

Some commands also answer to a short name: `attach` to `a`, `new` to `n`,
`ls` to `list-sessions`, `resurrect` to `restore`, `hosts remove` to `rm`, and
`keybinds` to `keys` or `kb`.

### `tuios resurrect` (Added in v0.8.0)

Restore a session that was saved before a daemon restart, a crash or a reboot
(also `tuios restore`).

```bash
tuios resurrect [session-name] [flags]
```

With no argument, the command lists the sessions saved on disk. A session that
the daemon holds now is marked `live`. With a session name, the daemon restores
that session and the command attaches to it. Each window gets a new shell in its
saved working directory. Running programs and scrollback do not come back.

The daemon restores every saved session when it starts. Use this command when
the daemon started with `--no-restore`, or to bring back one session.

- `--json`: list the saved sessions for a script, with `name`, `windows`,
  `status` (`restorable` or `live`) and `saved_at`.

```bash
# List the sessions that can be restored
tuios resurrect

# Restore one and attach to it
tuios resurrect work
```
