Skip to main content

Kubernetes secrets pretty printer

Project description

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:
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.4.0.tar.gz (15.8 kB view details)

Uploaded Source

Built Distribution

ksec-0.4.0-py3-none-any.whl (4.5 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for ksec-0.4.0.tar.gz
Algorithm Hash digest
SHA256 06925c62b3dbc418636d75c83a629e2cc13aabbfafc795baf3aa7a91d3b11e5c
MD5 4ebc2bd983c5bd4917edcdd1cf789636
BLAKE2b-256 6196f908c4c783c0ab123e86f438d3bb2db93fe466d5e16ebe1ac80eb6f9bf2a

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for ksec-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6a77e7d6de55c304e1ecaa90bfcbdeae22929f7ddcd1ca05c0b6f7d24f00c6db
MD5 0ebf782ee5eedf5dfb38c59a9869b208
BLAKE2b-256 a5da5e7f3e4a22380cd686d7925feb55143b93fcbf334c5af633ca94fc4e7076

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