> ## Documentation Index
> Fetch the complete documentation index at: https://www.qovery.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# qovery shell

> Shell access and command execution

## Overview

Connect to an application container and execute commands in running service instances, or open an interactive shell session.

## Usage

```bash theme={null}
qovery shell [flags]
qovery shell <qovery_console_service_url>
```

## Commands

### Interactive Shell (interactive mode)

When run without flags, `qovery shell` prompts you to select your organization, project, environment, and service interactively:

```bash theme={null}
qovery shell
```

### Shell with explicit flags

```bash theme={null}
qovery shell \
  --organization "my-org" \
  --project "my-project" \
  --environment "production" \
  --service "my-api"
```

### Shell into specific pod or container

```bash theme={null}
qovery shell \
  --organization "my-org" \
  --project "my-project" \
  --environment "production" \
  --service "my-api" \
  --pod "pod-name" \
  --container "container-name"
```

### Execute Command

Run a specific command instead of opening an interactive shell:

```bash theme={null}
qovery shell \
  --organization "my-org" \
  --project "my-project" \
  --environment "production" \
  --service "my-api" \
  --command "ls,-la"
```

The `--command` flag is a comma-separated string slice and can be repeated to pass multiple arguments.

### Shell via Console URL

Pass the Qovery Console URL directly:

```bash theme={null}
qovery shell "https://console.qovery.com/organization/<org-id>/project/<project-id>/environment/<env-id>/application/<app-id>"
```

## Options

| Flag             | Shorthand | Description                                                                     |
| ---------------- | --------- | ------------------------------------------------------------------------------- |
| `--organization` |           | Organization Name                                                               |
| `--project`      |           | Project Name                                                                    |
| `--environment`  |           | Environment Name                                                                |
| `--service`      |           | Service Name                                                                    |
| `--pod`          | `-p`      | Pod name to exec into                                                           |
| `--container`    |           | Container name inside the pod                                                   |
| `--command`      | `-c`      | Command to launch inside the pod (string slice, default: `sh`; can be repeated) |
| `--help`         |           | Show help                                                                       |

## Examples

### Debug Application

```bash theme={null}
# Open interactive shell
qovery shell

# With explicit context flags
qovery shell \
  --organization "my-org" \
  --project "my-project" \
  --environment "production" \
  --service "my-api"
```

### Run Database Migrations

```bash theme={null}
qovery shell \
  --organization "my-org" \
  --project "my-project" \
  --environment "production" \
  --service "my-api" \
  --command "npm,run,migrate"
```

### Check Application Files

```bash theme={null}
# List application files
qovery shell \
  --organization "my-org" \
  --project "my-project" \
  --environment "production" \
  --service "my-api" \
  --command "ls,-lah,/app"
```

### Debug Specific Container

```bash theme={null}
qovery shell \
  --organization "my-org" \
  --project "my-project" \
  --environment "production" \
  --service "my-api" \
  --pod "my-api-7d4f9c-xvz" \
  --container "nginx-proxy"
```

## Tips

<Tip>
  Use interactive shell (run `qovery shell` without flags) for exploratory debugging when you don't know the exact service name.
</Tip>

<Tip>
  You can pass the Qovery Console URL as an argument to `qovery shell` to quickly connect to a service.
</Tip>

<Warning>
  Be careful when executing commands in production environments. Changes are not persistent across pod restarts.
</Warning>

## Related Commands

* [`qovery log`](/cli/commands/log) - View application logs
* [`qovery application`](/cli/commands/application) - Manage applications
