# cldkctl console

The console command allows you to execute commands inside a running container of a Kubernetes pod. This is useful for debugging or inspecting the state of your containerized application directly from the terminal. It opens an interactive shell session or executes a specific command within a container of a running pod — similar to running: kubectl exec -it \<pod-name> -- /bin/sh

## Usage

```
cldkctl console [pod name] [flags]
```

## Steps

Follow the steps below to run and view the result of this command:

1. Retrieve the list of running pods in your project to identify the target pod name.

```
./cldkctl get pod
```

2. Run the console command with the desired pod name:

```
./cldkctl console [pod-name]
```

3. Specify the container name if the pod has multiple containers:

```
./cldkctl console [pod-name] --container [container-name]
```

4. Define the namespace if the pod is in a non-default namespace:

```
./cldkctl console [pod-name] --namespace [namespace-name]
```

5. Once executed, the CLI opens an interactive terminal session inside the container. You can run shell commands directly from within the container environment.

## Flags

{% hint style="info" %}
This command supports [global flags.](/cloudeka-api-list/global-flags.md) Refer to the Global Flags section for details
{% endhint %}

| Flag                   | Description                                                            |
| ---------------------- | ---------------------------------------------------------------------- |
| -c, --container string | Specify the container name (default: the first container in the list). |
| -h, --help             | Help for the console command.                                          |
| -n, --namespace string | Specify the Kubernetes namespace to scope the operation.               |
| -p, --project string   | Specify the project ID.                                                |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.cloudeka.ai/cloudeka-api-list/command-reference/cldkctl-console.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
