{"id":22528527,"url":"https://github.com/robinovitch61/kl","last_synced_at":"2025-10-09T09:07:14.348Z","repository":{"id":257665634,"uuid":"859021307","full_name":"robinovitch61/kl","owner":"robinovitch61","description":"An interactive Kubernetes log viewer for your terminal.","archived":false,"fork":false,"pushed_at":"2025-07-08T01:42:42.000Z","size":9352,"stargazers_count":336,"open_issues_count":3,"forks_count":5,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-08-03T23:45:35.667Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/robinovitch61.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-09-18T00:04:19.000Z","updated_at":"2025-07-27T10:37:06.000Z","dependencies_parsed_at":"2024-10-28T02:48:45.407Z","dependency_job_id":"6163342e-e03a-4972-8ca1-a53ab4fc58e1","html_url":"https://github.com/robinovitch61/kl","commit_stats":null,"previous_names":["robinovitch61/kl"],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/robinovitch61/kl","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robinovitch61%2Fkl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robinovitch61%2Fkl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robinovitch61%2Fkl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robinovitch61%2Fkl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/robinovitch61","download_url":"https://codeload.github.com/robinovitch61/kl/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robinovitch61%2Fkl/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279001179,"owners_count":26083021,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-09T02:00:07.460Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":"2024-12-07T07:02:32.912Z","updated_at":"2025-10-09T09:07:14.319Z","avatar_url":"https://github.com/robinovitch61.png","language":"Go","funding_links":[],"categories":["Go","Tools and Libraries"],"sub_categories":["Command Line Tools"],"readme":"# kl\n\n\u003cp\u003e\n    \u003ca href=\"https://github.com/robinovitch61/kl/releases\"\u003e\u003cimg src=\"https://shields.io/github/v/release/robinovitch61/kl.svg\" alt=\"Latest Release\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://pkg.go.dev/github.com/robinovitch61/kl?tab=doc\"\u003e\u003cimg src=\"https://godoc.org/github.com/golang/gddo?status.svg\" alt=\"GoDoc\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://github.com/robinovitch61/kl/actions\"\u003e\u003cimg src=\"https://github.com/robinovitch61/kl/workflows/build/badge.svg\" alt=\"Build Status\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\nAn interactive Kubernetes log viewer for your terminal.\n\n\u003cimg src=\"./demo/demo.gif\" alt=\"gif demo of kl\"/\u003e\n\n* View logs across multiple containers, pods, namespaces, and clusters\n* Select containers interactively or auto-select by pattern matching against names, labels, and more\n* See cluster changes in real time\n* Navigate logs from multiple containers interleaved by timestamp\n* Search logs by exact string or regex pattern. Show or hide surrounding context\n* Zoom in and flip through single formatted logs one by one\n* Archive and share: save logs to a local file or copy a log to your clipboard\n\nComparable to:\n\n* [kubectl logs](https://kubernetes.io/docs/reference/kubectl/generated/kubectl_logs/) supercharged\n* [k9s](https://k9scli.io/) but specializing in logs\n* [stern](https://github.com/stern/stern) \u0026 [kail](https://github.com/boz/kail) but multi-cluster and with an interactive\n  interface\n\n## Usage\n\n[Install](#Installation) and run `kl` in a terminal. See `kl --help` for all options.\n\nExamples:\n\n```shell\n# Use the current kubernetes context, defaulting to `default`\nkl\n\n# Use context `my-context`, all namespaces\nkl --context my-context -A\n\n# Use contexts `my-context` \u0026 `other-context`, namespaces `default` \u0026 `other-ns` in each context\nkl --context my-context,other-context -n default,other-ns\n\n# Auto-select containers with a pod owner (e.g. deployment) containing the word `nginx`\nkl --mown nginx\n\n# Auto-select containers with the exact name `my-container`, limited to 10 containers\nkl --mc \"^my-container$\" --limit 10\n\n# Auto-select containers that have labels app=flask and either tier=stage or tier=prod\nkl -l 'app=flask,tier in (stage, prod)'\n\n# Ignore containers with the exact name of `my-sidecar`\nkl --ic \"^my-sidecar$\"\n\n# Start focused on logs, ordered by timestamp descending, showing logs from 10 minutes ago onwards\nkl --mc \"^my-container$\" -d --logs-view --since 10m\n```\n\nPress `?` in any view to see keyboard shortcuts specific to the current view and across the application.\n\n| Key            | Action                                          |\n|----------------|-------------------------------------------------|\n| enter          | in container selection view, toggle logs        |\n| R              | deselect all containers and clear logs          |\n| ↓/j            | down one line                                   |\n| ↑/k            | up one line                                     |\n| d              | down half page                                  |\n| u              | up half page                                    |\n| f              | down full page                                  |\n| b              | up full page                                    |\n| g              | go to top (will follow logs if descending)      |\n| G              | go to bottom (will follow logs if ascending)    |\n| l              | focus on logs view                              |\n| L              | focus on logs view in fullscreen                |\n| enter          | zoom in to single log view for selected log     |\n| shift+\u003cmotion\u003e | scroll on single log view                       |\n| esc            | back to all logs view when viewing single log   |\n| s              | focus on container selection view               |\n| S              | focus on container selection view in fullscreen |\n| F              | toggle fullscreen                               |\n| /              | edit exact match filter                         |\n| r              | edit regex filter                               |\n| enter          | when filtering, apply filter                    |\n| esc            | discard applied filter                          |\n| n              | next filter match                               |\n| N              | previous filter match                           |\n| x              | toggle showing only the logs matching filter    |\n| w              | toggle line wrap                                |\n| ←/→/h/l        | pan left/right when not wrapped                 |\n| o              | reverse timestamp ordering                      |\n| p              | pause/resume log stream                         |\n| t              | change timestamp format                         |\n| c              | change container name format                    |\n| 0-9            | change time from which logs begin               |\n| ctrl+s         | save focused view to local file                 |\n| ctrl+y         | in single log view, copy to clipboard           |\n| ?              | show/hide help                                  |\n\n## Installation\n\nThe following installation options are available:\n\n```shell\n# homebrew\nbrew install robinovitch61/tap/kl\n\n# upgrade using homebrew\nbrew update \u0026\u0026 brew upgrade kl\n\n# nix-shell\n# ensure NUR is accessible (https://github.com/nix-community/NUR)\nnix-shell -p nur.repos.robinovitch61.kl\n\n# nix flakes\n# ensure flake support is enabled (https://nixos.wiki/wiki/Flakes#Enable_flakes_temporarily)\nnix run github:robinovitch61/nur-packages#kl\n\n# arch linux\n# PKGBUILD available at https://aur.archlinux.org/packages/kl-bin\nyay -S kl-bin\n\n# with go (https://go.dev/doc/install)\ngo install github.com/robinovitch61/kl@latest\n\n# windows with winget\nwinget install robinovitch61.kl\n\n# windows with scoop\nscoop bucket add robinovitch61 https://github.com/robinovitch61/scoop-bucket\nscoop install kl\n\n# windows with chocolatey\nchoco install kl\n```\n\nYou can also download [prebuilt releases](https://github.com/robinovitch61/kl/releases) and move the unpacked\nbinary to somewhere in your `PATH`.\n\n## Development\n\n`kl` is written with tools from [Charm](https://charm.sh/).\n\n[Feature requests and bug reports are welcome](https://github.com/robinovitch61/kl/issues/new/choose).\n\nRunning the app with the environment variable `KL_DEBUG=1` will create or append to a `kl.log` file in your current\ndirectory with debug logs.\n\nTo manually build the project:\n\n```shell\ngit clone git@github.com:robinovitch61/kl.git\ncd kl\ngo build  # outputs ./kl executable\n```\n\nRun an example flask + postgres + nginx setup in a local [k3d](https://k3d.io/) cluster for testing locally:\n\n```sh\nk3d cluster create test\nk3d cluster create test2\nkubectl --context k3d-test apply -f ./dev/deploy.yaml\nkubectl --context k3d-test2 create namespace otherns\nkubectl --context k3d-test2 apply -f ./dev/deploy.yaml -n otherns\n\n# view both clusters and all namespaces in kl\nkl --context k3d-test,k3d-test2 -A\n\n# access the application's webpage\nkubectl --context k3d-test2 -n otherns port-forward services/frontend-service 8080:80\nopen http://localhost:8080\n\n# browser console one-liner to click button every second to generate logs\nsetInterval(() =\u003e { document.getElementsByTagName(\"button\")[0].click(); }, 1000);\n\n# or make requests directly to flask from the terminal\nkubectl --context k3d-test2 port-forward services/flask-service 5000:5000\ncurl http://localhost:5000/status\n```\n\nTo run with profiling available, set the environment variable `KL_PPROF_SERVER=1`, run the app, then run e.g.\n\n```shell\n# web ui for memory profile\ngo tool pprof -http=:8080 \"http://localhost:6060/debug/pprof/heap\"\n\n# web ui for cpu profile\ngo tool pprof -http=:8080 \"http://localhost:6060/debug/pprof/profile?seconds=15\"\n\n# explore memory profile in terminal\ngo tool pprof \"http://localhost:6060/debug/pprof/heap\"\n\u003e top\n\u003e peek ...\n\u003e traces ...\n\n# explore cpu profile in terminal\ngo tool pprof \"http://localhost:6060/debug/pprof/profile?seconds=15\"\n\u003e top\n\u003e peek ...\n\u003e traces ...\n```\n\n## Manually Specify the `kl` Version at Build Time\n\nIf necessary, you can manually specify the output of `kl --version` at build time as follows:\n\n```shell\ngo build -ldflags \"-X github.com/robinovitch61/kl/cmd.Version=vX.Y.Z\"\n```\n\nIn this case, you're responsible for ensuring the specified version matches what is being built.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobinovitch61%2Fkl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frobinovitch61%2Fkl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobinovitch61%2Fkl/lists"}