Skip to main content

Overview

Connect to an application container and execute commands in running service instances, or open an interactive shell session. With --ephemeral, open the shell in a temporary pod or container instead.

Usage

Commands

Interactive Shell (interactive mode)

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

Shell with explicit flags

Shell into specific pod or container

Execute Command

Run a specific command instead of opening an interactive shell:
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:

Ephemeral Shell

--ephemeral opens the shell in a temporary pod or in a temporary container, instead of the application container. It requires Qovery CLI v1.162.1 or later. Choose where the shell runs with --mode:

Clone mode

The new pod uses the same image, environment variables, secrets, volumes, service account, security context and node placement as the service. It runs sleep infinity instead of the service entrypoint, so your application does not start in it and the pod receives no traffic. The pod gets the same CPU and memory as the service. Use --cpu and --memory to give it more, for example for a heavy script or a data migration. Each flag sets both the request and the limit:
The pod is deleted when you exit the shell, and after 24 hours at most. The CLI waits up to 5 minutes for it to start.
Clone mode works for applications and containers without persistent storage. It fails with No deployment found for service on services that use persistent storage.

Debug mode

Qovery adds a debian:stable-slim container to the newest running pod of the service. The container shares the process namespace of the application container, so tools like ps and top show the application processes. The CLI waits up to 2 minutes for the container to start. --cpu and --memory do not apply in this mode and are ignored.
Kubernetes cannot remove a debug container from a pod. The container stays in the pod until the pod is replaced, for example by the next deployment. If you open another debug shell on the same pod, Qovery reuses the existing container.

Permissions

Clone mode requires the same permissions as qovery shell. Debug mode requires admin access to the cluster. Both are recorded in the audit logs.

Options

Examples

Debug Application

Run Database Migrations

Check Application Files

Run a Script Without Touching Production Pods

Debug Specific Container

Tips

Use interactive shell (run qovery shell without flags) for exploratory debugging when you don’t know the exact service name.
You can pass the Qovery Console URL as an argument to qovery shell to quickly connect to a service.
Be careful when executing commands in production environments. Changes are not persistent across pod restarts.