{"id":13599167,"url":"https://github.com/imuxin/kubectl-watch","last_synced_at":"2025-10-19T08:22:03.520Z","repository":{"id":58653319,"uuid":"531010878","full_name":"imuxin/kubectl-watch","owner":"imuxin","description":"A kubectl plugin to provide a pretty delta change view of being watched kubernetes resources","archived":false,"fork":false,"pushed_at":"2023-10-25T07:26:15.000Z","size":10548,"stargazers_count":62,"open_issues_count":4,"forks_count":4,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-28T03:24:54.989Z","etag":null,"topics":["delta","diff","kubectl","kubernetes","rust","tui","watch"],"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/imuxin.png","metadata":{"files":{"readme":"README-zh.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":"ROADMAP.md","authors":null}},"created_at":"2022-08-31T09:12:16.000Z","updated_at":"2025-02-16T06:02:16.000Z","dependencies_parsed_at":"2022-09-08T03:42:16.654Z","dependency_job_id":"e9624335-22be-4767-b8e5-24b701228e92","html_url":"https://github.com/imuxin/kubectl-watch","commit_stats":{"total_commits":103,"total_committers":2,"mean_commits":51.5,"dds":0.009708737864077666,"last_synced_commit":"efdf91fd6d00dbf06000d44ea0d77a63de7e4893"},"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imuxin%2Fkubectl-watch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imuxin%2Fkubectl-watch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imuxin%2Fkubectl-watch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imuxin%2Fkubectl-watch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/imuxin","download_url":"https://codeload.github.com/imuxin/kubectl-watch/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248217130,"owners_count":21066633,"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":["delta","diff","kubectl","kubernetes","rust","tui","watch"],"created_at":"2024-08-01T17:01:00.443Z","updated_at":"2025-10-19T08:21:58.479Z","avatar_url":"https://github.com/imuxin.png","language":"Rust","funding_links":[],"categories":["💻 Apps"],"sub_categories":["👨‍💻 System Administration"],"readme":"# kubectl-watch\n\n[English](./README.md)\n\n一个可以监听 kubernetes 资源的变更信息的 kubectl 插件。其中变更的内容通过使用 [delta](https://github.com/dandavison/delta) 或 [difftastic](https://github.com/Wilfred/difftastic) 工具提供漂亮的终端界面展示。\n\n|                  使用 delta 概览                   |                使用 difftastic 概览                |\n| :------------------------------------------------: | :------------------------------------------------: |\n| ![overview-delta.png](./assets/overview-delta.png) | ![overview-difft.png](./assets/overview-difft.png) |\n\n\n## 安装说明\n\n### [推荐] 方式一：使用 Docker 镜像\n\n1. 您需要在环境里预先安装好 Docker，参考 [官网](https://docs.docker.com/engine/install/)；或者安装 containerd，参考 [安装教程](https://github.com/containerd/containerd/blob/main/docs/getting-started.md#installing-containerd) 和 [nerdctl](https://github.com/containerd/nerdctl) 命令行工具。\n2. 拷贝 script 目录下的 kubectl-watch 脚本到环境的 $PATH 其中的一个目录下，比如 `/usr/local/bin`。\n```bash\ncp script/kubectl-watch /usr/local/bin/\nchmod +x /usr/local/bin/kubectl-watch\n```\n\n### 方式二：从 [release assets](https://github.com/imuxin/kubectl-watch/releases) 下载可执行制品。\n### 方式三：使用 [Cargo](https://crates.io/crates/kubectl-watch)进行源码编译安装。\n\n```bash\ncargo install kubectl-watch --locked\n```\n\n## Cmd 帮助\n\n```bash\nUSAGE:\n    kubectl-watch [OPTIONS] [ARGS]\n\nARGS:\n    \u003cRESOURCE\u003e    Support resource 'plural', 'kind' and 'shortname'\n    \u003cNAME\u003e        Resource name, optional\n\nOPTIONS:\n    -A, --all                       If present, list the requested object(s) across all namespaces\n        --diff-tool \u003cDIFF_TOOL\u003e     Diff tool to analyze delta changes [default: delta] [possible values: delta, difft]\n        --export \u003cEXPORT\u003e           A path, where all watched resources will be strored\n    -h, --help                      Print help information\n        --include-managed-fields    Set ture to show managed fields delta changes\n    -l, --selector \u003cSELECTOR\u003e       Selector (label query) to filter on, supports '=', '==', and '!='.(e.g. -l key1=value1,key2=value2)\n    -n, --namespace \u003cNAMESPACE\u003e     If present, the namespace scope for this CLI request\n    -s, --skip-delta                Skip show delta changes view\n        --use-tls                   Use tls to request api-server\n    -V, --version                   Print version information\n```\n\n## 参考实例\n\n监听所有命名空间下的 deployment 资源\n```bash\nkubectl-watch deployment -A\n```\n\n监听某个命名空间下的 depoyment 资源\n```bash\nkubectl-watch deployment -n {namespace}\n```\n\n监听某个命名空间下的某个 depoyment 资源\n```bash\nkubectl-watch deployment -n {namespace} {name}\n```\n\n追加 `--skip-delta` 选项，仅监听变动资源，同 `kubectl get -w`\n```bash\nkubectl-watch {resource} --delta\n```\n\n追加 `--diff-tool difft` 选项来使用 `difftastic` 工具显示变化内容\n```bash\nkubectl-watch {resource} --diff-tool difft\n```\n\n追加 `--export \"/to/your/path\"` 选项，导出监听的资源到本地存储\n```bash\nkubectl-watch {resource} --export \"/to/your/path\"\n```\n\n`managed-fields` 默认是不进行比对的, 追加 `--include-managed-fields` 选项，展示 managed fields 的变化\n```bash\nkubectl-watch {resource} -include-managed-fields\n```\n\n## 致谢\n\n- [delta](https://github.com/dandavison/delta)\n- [difftastic](https://github.com/Wilfred/difftastic)\n- [kube-rs](https://github.com/kube-rs/kube-rs)\n- [rust](https://github.com/rust-lang/rust)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimuxin%2Fkubectl-watch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fimuxin%2Fkubectl-watch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimuxin%2Fkubectl-watch/lists"}