Skip to main content

Kubernetes secrets pretty printer

Project description

Python Version from PEP 621 TOML PyPI - Version GitHub Actions Workflow Status

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).

asciicast

Quickstart

  1. Preferred method with uv:
uv tool install ksec
  1. With pipx:
pipx install ksec
  1. With pip:
pip install ksec

Example usage

$ 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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ksec-0.5.1.tar.gz (514.9 kB view details)

Uploaded Source

Built Distribution

ksec-0.5.1-py3-none-any.whl (4.7 kB view details)

Uploaded Python 3

File details

Details for the file ksec-0.5.1.tar.gz.

File metadata

  • Download URL: ksec-0.5.1.tar.gz
  • Upload date:
  • Size: 514.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.4.30

File hashes

Hashes for ksec-0.5.1.tar.gz
Algorithm Hash digest
SHA256 c2e6b6153c92ec396b78ea41d47ed1dfb3e979a8b9634c604fd77eeca52a8e87
MD5 71c3dcf73f5416d7606d0b5001fdc938
BLAKE2b-256 1f2d0670abd73a19bb05353487c82ba047c3b462a92bb90d9e65fbfd807e8b30

See more details on using hashes here.

File details

Details for the file ksec-0.5.1-py3-none-any.whl.

File metadata

  • Download URL: ksec-0.5.1-py3-none-any.whl
  • Upload date:
  • Size: 4.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.4.30

File hashes

Hashes for ksec-0.5.1-py3-none-any.whl
Algorithm Hash digest
SHA256 af0184dc96d6d8ed4947ceafc10922320b11a51c70970dbbeadd59b95b84a70a
MD5 fa06195a76676238bf5c9bb83229cb80
BLAKE2b-256 b6d287baf5e9f9d5df8d06f3e5a67f0dc2716f2418ec51e86c5c6befb8ef0413

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page