{"id":19150618,"url":"https://github.com/night-crawler/kgv","last_synced_at":"2025-05-07T05:23:51.783Z","repository":{"id":72429190,"uuid":"600782894","full_name":"night-crawler/kgv","owner":"night-crawler","description":"Curses-based terminal UI for Kubernetes (k8s Global View)","archived":false,"fork":false,"pushed_at":"2023-04-22T13:51:36.000Z","size":231,"stargazers_count":10,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-19T18:34:05.419Z","etag":null,"topics":["cursive-rs","kubernetes","rust","terminal","tui"],"latest_commit_sha":null,"homepage":"","language":"Rust","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/night-crawler.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}},"created_at":"2023-02-12T15:35:02.000Z","updated_at":"2024-08-08T16:46:20.000Z","dependencies_parsed_at":"2023-09-17T13:15:43.640Z","dependency_job_id":null,"html_url":"https://github.com/night-crawler/kgv","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/night-crawler%2Fkgv","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/night-crawler%2Fkgv/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/night-crawler%2Fkgv/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/night-crawler%2Fkgv/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/night-crawler","download_url":"https://codeload.github.com/night-crawler/kgv/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252819379,"owners_count":21809014,"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","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":["cursive-rs","kubernetes","rust","terminal","tui"],"created_at":"2024-11-09T08:12:34.570Z","updated_at":"2025-05-07T05:23:51.763Z","avatar_url":"https://github.com/night-crawler.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# KGV\n\n[![Rust](https://github.com/night-crawler/kgv/actions/workflows/rust.yml/badge.svg?branch=main)](https://github.com/night-crawler/kgv/actions/workflows/rust.yml)\n[![MIT licensed](https://img.shields.io/badge/license-MIT-blue.svg)](./LICENSE)\n\n`KGV` is Kubernetes Global View or an acronym for GVK. It's a Terminal UI for observing and manipulating Kubernetes\nresources.\n\n## Features\n\n1. [rhai](https://rhai.rs/)-based data extraction for table views. Write a small script to extract the data for each\n   column for a given GVK. Data extraction is parallel.\n2. Rhai module support. Use imports and reuse the code.\n3. Detail view templates are defined as Handlebars HTML templates, rendered against the resource context, and then\n   converted to ASCII using [cursive-markup](https://docs.rs/cursive-markup/latest/cursive_markup/).\n4. Live reloading support for the rhai engine and templates.\n5. Live updates for the detail, YAML, and list views.\n6. Collecting initial GVK resource names is cached. Startup on overprovisioned or overloaded k8s installations is\n   faster.\n7. Multiple window support. Open multiple windows (logs, list views, list details views, or just details views) and\n   switch between them. Switching is instant.\n8. Custom user dirs support. Specify your modules and templates dirs with CMD arguments.\n\n## Screenshots\n\n\u003cdiv\u003e\n\u003cimg src=\"https://user-images.githubusercontent.com/1235203/229350812-c026d3ec-b90b-4b90-85b2-ea8fb91b7f30.png\" width=\"48%\" alt=\"Table View: Pods\" /\u003e\n\u003cimg src=\"https://user-images.githubusercontent.com/1235203/229350859-c73aacb7-bd94-4188-bb5e-2728fb02e02a.png\" width=\"48%\" alt=\"Table View: Pod Containers\" /\u003e\n\u003cimg src=\"https://user-images.githubusercontent.com/1235203/229351196-a56c36b2-0cb2-4ab0-9f58-04bf49375687.png\" width=\"48%\" alt=\"Handlebars HTML Detail View\" /\u003e\n\u003cimg src=\"https://user-images.githubusercontent.com/1235203/229350893-72da2ac5-d723-49b8-8034-4c175d62348e.png\" width=\"48%\" alt=\"YAML View\" /\u003e\n\u003cimg src=\"https://user-images.githubusercontent.com/1235203/229350909-4dcfe45d-c822-4afc-bc52-70173958875e.png\" width=\"48%\" alt=\"Window Switcher View\" /\u003e\n\u003cimg src=\"https://user-images.githubusercontent.com/1235203/229350941-c635eb76-f40f-46b8-a28c-cf8005b8f9f1.png\" width=\"48%\" alt=\"GVK Switcher View\" /\u003e\n\u003cimg src=\"https://user-images.githubusercontent.com/1235203/229350970-85d2fae1-3b23-413b-91fd-027fb76222af.png\" width=\"48%\" alt=\"Logs View\" /\u003e\n\u003cimg src=\"https://user-images.githubusercontent.com/1235203/229350996-ca319ac7-f06b-4685-92e1-4fb06d1fc961.png\" width=\"48%\" alt=\"Menu\" /\u003e\n\u003cimg src=\"https://user-images.githubusercontent.com/1235203/233785084-7f37e1db-bb14-4e63-9ce2-fb98917a56f8.png\" width=\"48%\" alt=\"Port Forwarding Dialog\" /\u003e\n\u003cimg src=\"https://user-images.githubusercontent.com/1235203/233785230-38c42c40-2aa5-4ff8-99d7-52aa1884cb2b.png\" width=\"48%\" alt=\"Port Forwarding View\" /\u003e\n\u003c/div\u003e\n\n### Minor features\n\n- Rhai debugs are transferred to the main debug window\n- Handlebars template includes and inheritance support\n- YAML partial code extractors for Handlebars (use `to_yaml` helper)\n\n## Hotkeys\n\n- `~`: Show Debug Console\n- `Esc`: Close the current window\n- `Ctrl+s`: execute `kubectl exec -it`\n- `Alt+=`: Show windows view\n- `Ctrl+p`: Dump rhai object to temp\n- `F5`: Refresh the view (clears deleted items)\n- `Ctrl+y`: Show Resource YAML view\n- `Ctrl+/`: Show a list of registered GVKs\n- `Ctrl+k`: Delete current selected resource\n- `Ctrl+l`: Show logs for the selected resource\n- `Ctrl+f`: Show Port Forwarding dialog for the selected pod\n- `Ctrl+g`: Show active Port Forwards\n\n## Run\n\n```shell\nRUST_BACKTRACE=1 cargo run -- --module-dirs ./default_config/modules --extractor-dirs ./default_config/views/list  --detail-template-dirs ./default_config/views/detail\n```\n\n## Adding new Resource / GVK support\n\n1. Describe the Resource List view YAML. Top-level sections are:\n    - `resource`: there you describe Group, Version, Kind\n    - `imports`: automatically prepend for each column evaluator script these lines\n    - `pseudo_resources`: an extractor for nested resource list (return a list of `PseudoResource` items; for `Pod`\n      pseudo-resource is a container)\n    - `events`: show either a pseudo resource table or an HTML detail template\n    - `columns`: a list of column evaluators with column names\n    - `details`: for HTML-based views specify a root template and rhai helpers\n2. If you need an HTML detail view, describe templates. Includes and template inheritance is supported.\n3. When writing column evaluators, use `Ctrl+P` hotkey to extract currently selected resource as a rhai object.\n\n## TODO\n\n- [ ] Resource multiselect (i.e., to delete multiple resources at once)\n- [ ] Resource kill options support\n- [x] Faster Log view\n- [ ] Better shell selector (now it uses `sh` always)\n- [x] Port Forwarding\n- [ ] Configurable hotkeys\n- [ ] rhai-based context extractors for rendering with support for multiple resources (when you need to solve N+1\n  problem for resource detail view and show some dependencies)\n- [ ] Log mirroring to a file\n- [ ] Prepare more detail and list views for more GVKs\n- [x] Support for popular CRDs (helm, GitOps, etc)\n- [ ] Solve a problem with panics handler breaking the terminal\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnight-crawler%2Fkgv","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnight-crawler%2Fkgv","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnight-crawler%2Fkgv/lists"}