{"id":37401135,"url":"https://github.com/whywaita/keex","last_synced_at":"2026-01-16T05:44:20.133Z","repository":{"id":304864427,"uuid":"1020293752","full_name":"whywaita/keex","owner":"whywaita","description":"keex - Kubernetes Environment Extractor","archived":false,"fork":false,"pushed_at":"2026-01-13T04:14:02.000Z","size":26618,"stargazers_count":0,"open_issues_count":5,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-01-13T04:14:22.475Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/whywaita.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":["whywaita"]}},"created_at":"2025-07-15T16:32:06.000Z","updated_at":"2026-01-13T04:13:48.000Z","dependencies_parsed_at":"2026-01-05T01:01:42.724Z","dependency_job_id":null,"html_url":"https://github.com/whywaita/keex","commit_stats":null,"previous_names":["whywaita/kenv","whywaita/keex"],"tags_count":22,"template":false,"template_full_name":null,"purl":"pkg:github/whywaita/keex","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/whywaita%2Fkeex","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/whywaita%2Fkeex/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/whywaita%2Fkeex/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/whywaita%2Fkeex/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/whywaita","download_url":"https://codeload.github.com/whywaita/keex/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/whywaita%2Fkeex/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28477388,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-16T03:13:13.607Z","status":"ssl_error","status_checked_at":"2026-01-16T03:11:47.863Z","response_time":107,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-01-16T05:44:20.050Z","updated_at":"2026-01-16T05:44:20.118Z","avatar_url":"https://github.com/whywaita.png","language":"Go","funding_links":["https://github.com/sponsors/whywaita"],"categories":[],"sub_categories":[],"readme":"# keex - Kubernetes Environment Extractor\n\n[![Test](https://github.com/whywaita/keex/actions/workflows/test.yml/badge.svg)](https://github.com/whywaita/keex/actions/workflows/test.yml)\n[![codecov](https://codecov.io/gh/whywaita/keex/branch/main/graph/badge.svg)](https://codecov.io/gh/whywaita/keex)\n[![Go Report Card](https://goreportcard.com/badge/github.com/whywaita/keex)](https://goreportcard.com/report/github.com/whywaita/keex)\n\nkeex is a CLI tool that extracts environment variables from Kubernetes manifests and formats them for use with `docker run` or shell commands.\n\n## Motivation\n\nWhen developing or debugging containerized applications, you often need to run the same container locally with the exact same environment variables as in your Kubernetes cluster. Manually copying environment variables from Kubernetes manifests is tedious and error-prone, especially when dealing with:\n\n- Multiple environment variables across different manifests\n- Values from ConfigMaps and Secrets\n- Complex deployments with many containers\n\nkeex solves this by automatically extracting all environment variables from your Kubernetes resources and formatting them for immediate use.\n\n## Quick Examples\n\n### Running a container locally with the same environment as in Kubernetes\n\n```bash\n# Extract env vars from a deployment and run locally\n$ keex extract -f examples/deployment.yaml --mode docker\n-e APP_ENV=\"production\" -e LOG_LEVEL=\"info\" -e DB_HOST=\"db.example.com\" -e DB_PORT=\"5432\" -e DB_USER=\"\u003cdb-secret:username\u003e\" -e DB_PASS=\"\u003cdb-secret:password\u003e\" -e API_KEY=\"\u003capi-secret:key\u003e\" -e CONFIG_PATH=\"\u003capp-config:config-path\u003e\"\n\n# Use it with docker run\n$ docker run $(keex extract -f examples/deployment.yaml --mode docker) myapp:latest\n\n# Or from a live cluster (with actual secret values resolved)\n$ kubectl get deployment myapp -o yaml | keex extract -f - --mode docker | xargs docker run myapp:latest\n```\n\n### Debugging with local tools using production environment\n\n```bash\n# Export Kubernetes env vars to your shell\n$ keex extract -f examples/deployment.yaml --mode env\nAPP_ENV=\"production\" LOG_LEVEL=\"info\" DB_HOST=\"db.example.com\" DB_PORT=\"5432\" DB_USER=\"\u003cdb-secret:username\u003e\" DB_PASS=\"\u003cdb-secret:password\u003e\" API_KEY=\"\u003capi-secret:key\u003e\" CONFIG_PATH=\"\u003capp-config:config-path\u003e\"\n\n# Evaluate in your shell\n$ eval $(keex extract -f examples/deployment.yaml --mode env)\n\n# Now run your app locally with production config\n$ go run main.go\n# or\n$ python app.py\n```\n\n### Comparing environments between different deployments\n\n```bash\n# Extract and save environment from staging\n$ keex extract -f staging-deployment.yaml \u003e staging.env\n\n# Extract and save environment from production  \n$ keex extract -f prod-deployment.yaml \u003e prod.env\n\n# Compare the differences\n$ diff staging.env prod.env\n3c3\n\u003c DB_HOST=\"staging-db.example.com\"\n---\n\u003e DB_HOST=\"prod-db.example.com\"\n```\n\n## Features\n\n- Extract environment variables from Deployment, StatefulSet, DaemonSet, Job, CronJob, and Pod resources\n- Automatically resolve Secret and ConfigMap references when kubeconfig is available\n- Support for multiple output formats (docker, env)\n- Specify target container in multi-container pods\n- Optional redaction of sensitive values\n- Read manifests from file or stdin\n\n## Installation\n\n### Standalone CLI\n\n```bash\ngo install github.com/whywaita/keex/cmd/keex@latest\n```\n\nOr build from source:\n\n```bash\ngit clone https://github.com/whywaita/keex.git\ncd keex\ngo build -o keex cmd/keex/*.go\n```\n\n### kubectl Plugin\n\nkeex can also be used as a kubectl plugin, allowing you to extract environment variables directly from live Kubernetes resources:\n\n```bash\n# Install the kubectl plugin\ngo install github.com/whywaita/keex/cmd/kubectl-eex@latest\n\n# Or build from source\ngit clone https://github.com/whywaita/keex.git\ncd keex\nmake install-plugin\n```\n\nOnce installed, you can use it with kubectl:\n\n```bash\n# Extract env vars from a live deployment\nkubectl eex deployment/myapp\n\n# Extract from a specific container\nkubectl eex deployment/myapp -c app\n\n# Different output formats\nkubectl eex deployment/myapp --format docker\nkubectl eex deployment/myapp --format shell --export\nkubectl eex deployment/myapp --format dotenv \u003e .env\nkubectl eex deployment/myapp --format compose\n\n# Extract from other resource types\nkubectl eex statefulset/database\nkubectl eex pod/mypod-xyz123\nkubectl eex job/migrate-db\nkubectl eex cronjob/backup\n```\n\n## Usage\n\n### Basic Usage\n\n```bash\n# Extract environment variables from a deployment\nkeex extract -f deployment.yaml\n\n# Extract from a live cluster\nkubectl get deployment myapp -o yaml | keex extract -f -\n```\n\n### Output Modes\n\n**Docker mode** - Format for `docker run`:\n```bash\nkeex extract -f deployment.yaml --mode docker\n# Output: -e DB_HOST=db.example.com -e DB_USER=admin -e DB_PASS=secret ...\n```\n\n**Environment mode** - Format for shell export:\n```bash\nkeex extract -f deployment.yaml --mode env\n# Output: DB_HOST=\"db.example.com\" DB_USER=\"admin\" DB_PASS=\"secret\" ...\n```\n\n### Advanced Examples\n\n**Working with multi-container pods:**\n```bash\n# Target a specific container by name\nkeex extract -f pod.yaml --container app\nkeex extract -f pod.yaml --container sidecar\n```\n\n**Security and sensitive data:**\n```bash\n# Redact secret values in output (useful for sharing configs)\nkeex extract -f deployment.yaml --redact\n# Output: DB_HOST=\"db.example.com\" DB_PASS=\"***REDACTED***\" ...\n\n# Resolve actual values from ConfigMaps and Secrets\nkeex extract -f deployment.yaml --context production --namespace backend\n```\n\n**Integration with other tools:**\n```bash\n# Create an env file for docker-compose\nkeex extract -f deployment.yaml --mode env \u003e .env\n\n# Pass environment to local development server\nkeex extract -f deployment.yaml --mode env | grep -E \"^API_|^DB_\" \u003e local.env\nsource local.env \u0026\u0026 npm run dev\n\n# Quick environment debugging\nkeex extract -f deployment.yaml | grep DATABASE\n```\n\n## Command Line Options\n\n```\nUsage:\n  keex extract [flags]\n\nFlags:\n  -f, --file string        Manifest file path (\"-\" for stdin)\n      --mode string        Output mode: docker|env (default \"env\")\n      --container string   Target container name\n      --context string     kubeconfig context (default: current)\n      --namespace string   Kubernetes namespace (default: manifest/ns)\n      --redact             Mask secret values in output\n  -h, --help               Show help\n```\n\n## Requirements\n\n- Go 1.24.4 or higher\n- Access to Kubernetes cluster (optional - only needed for secret/configmap resolution)\n- Valid kubeconfig file (optional - secrets/configmaps will show placeholders without it)\n\n## Development\n\nRun tests:\n```bash\ngo test ./...\n```\n\nBuild:\n```bash\ngo build -o keex cmd/keex/*.go\n```\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwhywaita%2Fkeex","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwhywaita%2Fkeex","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwhywaita%2Fkeex/lists"}