# Open a shell

> Open the computer's shell from your local terminal

> Nevia is in beta and open to selected teams. Public launch in Dec 2026. The CLI installs with `curl -fsSL https://get.nevia.cloud | sh`, and the MCP server is at https://api.nevia.cloud/mcp. A person signs in once in the browser.
> Setup, sign-in and requesting access: [SKILL.md](https://nevia.cloud/SKILL.md). When Nevia fits and when it doesn't: [why.md](https://nevia.cloud/why.md).

> For the complete documentation index, see [llms.txt](https://nevia.cloud/llms.txt). This page's HTML version: https://nevia.cloud/docs/computers/shell

You need the [CLI installed and signed in](https://nevia.cloud/docs/get-started/quickstart.md) and a
[selected workspace](https://nevia.cloud/docs/workspaces/select.md) where you have the admin or editor role.
Use the `demo` computer from [Create a computer](https://nevia.cloud/docs/computers/create.md), with an
image that includes `sh`.

## Check the computer

```bash
nevia status demo
```

The state must be `ready`, with no pending transition. If the computer is sleeping,
[wake it first](https://nevia.cloud/docs/computers/lifecycle.md). Shell does not wake a computer.

## Open the shell

```bash
nevia shell demo
```

Nevia runs the image's `SHELL`, or `/bin/sh` when the image sets none, and allocates a
terminal for you. Type a few commands:

```sh
echo hello
pwd
```

You see `hello` and the working directory inside the computer. Run `exit` to close the
shell and return to your local terminal. The CLI exits with the shell's status.

The shell runs with the image `ENTRYPOINT` cleared, so it starts the same way on an
image whose `ENTRYPOINT` is an application rather than a shell. To run the image's own
command, or another program, use [`nevia exec`](https://nevia.cloud/docs/computers/exec.md).

## Run commands from a script

`nevia shell` needs a terminal on both stdin and stdout, and refuses to start without
one, since a shell is an interactive session by definition. For commands from a pipe or a script, use `nevia exec`, which
streams stdin with `-i`:

```bash
printf 'uname -a
id
' | nevia exec demo -i --entrypoint '' -- sh
```

Or run one command directly:

```bash
nevia exec demo --entrypoint '' -- sh -c 'uname -a; id'
```

## Set environment variables

The shell gets the computer's stored env, with secrets and variables at their current
values. Add `-e KEY=value` to set or override a variable for this shell only:

```bash
nevia shell demo -e LOG_LEVEL=debug
```

Use `-e secrets.NAME` or `-e variables.NAME` to take a value from the workspace. For the
full rules, see [Computer environment variables](https://nevia.cloud/docs/reference/computer-env.md).

## Session lifetime

Each shell is a session with its own URL. See
[Interactive sessions](https://nevia.cloud/docs/workspaces/secrets-and-variables.md#interactive-sessions)
for what a session URL can reach.

Sessions expire after one hour. Set another duration, up to 12 hours, with `--ttl`:

```bash
nevia shell demo --ttl 2h
```

A shell cut at its expiry reports the TTL it ran with. Closing the terminal does not
stop a process the shell left running in the computer.

[`nevia shell`](https://nevia.cloud/docs/reference/cli/shell.md) lists the command options.
