https://github.com/dusktreader/ksec
A tool for showing k8s secrets from kubectl
https://github.com/dusktreader/ksec
Last synced: 4 months ago
JSON representation
A tool for showing k8s secrets from kubectl
- Host: GitHub
- URL: https://github.com/dusktreader/ksec
- Owner: dusktreader
- License: mit
- Created: 2024-11-01T00:24:39.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-11-05T18:00:05.000Z (over 1 year ago)
- Last Synced: 2025-10-10T23:44:03.839Z (8 months ago)
- Language: Python
- Size: 514 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.md
Awesome Lists containing this project
README



# ksec
The `ksec` tool simply decodes secrets from kubectl to make it easier for the user to
view them. It can parse output from kubectl in either JSON or YAML (if you install with
the `yaml` extra).

## Quickstart
1. Preferred method with [uv](https://docs.astral.sh/uv/):
```bash
uv tool install ksec
```
2. With pipx:
```bash
pipx install ksec
```
3. With pip:
```bash
pip install ksec
```
## Example usage
```bash
$ kubectl get secret my-secret -o json | ksec
{
"SOME_ID": "cd31d8f5-9bf7-40a1-aced-a7faddd199ce",
"SOME_KEY": "17153263835190001925"
}
```
## Getting help
Simply run `ksec --help`:
```
$ ksec --help
Usage: ksec [OPTIONS] [SEARCH]
Display decoded kubernetes secrets printed by kubectl.
Example usage:
kubectl get secret my-secret -o json | ksec
╭─ Arguments ─────────────────────────────────────────────────────────────────────────────────────╮
│ search [SEARCH] Match a named secret data item using fuzzy search [default: None] │
╰─────────────────────────────────────────────────────────────────────────────────────────────────╯
╭─ Options ───────────────────────────────────────────────────────────────────────────────────────╮
│ --mode -m [JSON|YAML] Set the format that should be processed from stdin. │
│ YAML mode requires installation with the yaml flag. │
│ [default: JSON] │
│ --full -f Include all the metadata for the secrets, not just │
│ the data │
│ --ephemeral -e Show the output in a temporary buffer that will be │
│ cleared upon exit. │
│ --install-completion Install completion for the current shell. │
│ --show-completion Show completion for the current shell, to copy it or │
│ customize the installation. │
│ --help Show this message and exit. │
╰─────────────────────────────────────────────────────────────────────────────────────────────────╯
```
## License
Distributed under the MIT License. See `LICENSE` for more information.