Metadata-Version: 2.4
Name: kube-envx
Version: 0.3.0
Summary: Extract environment variables from Kubernetes resources in dotenv format
License-File: LICENSE
Author: ohmycoffe
Author-email: ohmycoffe1@gmail.com
Requires-Python: >=3.10
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Requires-Dist: questionary (>=2.1.1,<3.0.0)
Requires-Dist: typer (>=0.16.0,<0.17.0)
Description-Content-Type: text/markdown

# kube-kenvx

[![Python](https://img.shields.io/badge/python-3.10+-blue.svg)](https://www.python.org/)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)

Extract and export environment variables from Kubernetes Deployments and Argo WorkflowTemplates — interactively or scripted.

![demo](https://github.com/user-attachments/assets/4c492cd0-87ab-4c97-90b5-fa5e3a43db82)

## Installation

**pipx**:

```bash
pipx install git+https://github.com/ohmycoffe/kube-envx.git
```

**Poetry** (development):

```bash
poetry install
```

## Usage

Run without arguments for fully interactive mode:

```bash
kenvx
```

Or pass options directly to skip individual prompts:

```bash
kenvx --kind deployment --namespace my-namespace --name my-service
```

### Options

| Option | Default | Description |
|---|---|---|
| `--kind` | — | `deployment` or `workflowtemplate`. Prompted if omitted. |
| `--namespace` | — | Kubernetes namespace. Prompted if omitted. |
| `--name` | — | Resource name. Prompted if omitted. |
| `--output` | `env` | Output format: `env` or `json`. |
| `-v` / `-vv` | — | Verbosity: info / debug. |

### Environment variables

| Variable | Description |
|---|---|
| `ENVX_NAMESPACE` | Default namespace, overridden by `--namespace`. |

## Examples

Export env vars for a deployment to a dotenv file:

```bash
kenvx --kind deployment --name my-service --namespace prod > .env
```

Extract WorkflowTemplate env vars as JSON:

```bash
kenvx --kind workflowtemplate --name my-workflow --namespace argo --output json
```

## Requirements

- Python 3.10+
- [`kubectl`](https://kubernetes.io/docs/tasks/tools/) configured with cluster access

## License

MIT — see [LICENSE](LICENSE).

