rtk-ai/rtk
在 GitHub 查看Feature request: rtk wrapper for az aks (command invoke + get-credentials)
Open
#1,592 创建于 2026年4月29日
area:clieffort-mediumenhancementhelp wantedpriority:medium
仓库指标
- Star
- (48,085 star)
- PR 合并指标
- (平均合并 11天 1小时) (30 天内合并 45 个 PR)
描述
Real-world numbers from 30 days of Claude Code transcripts (686 sessions scanned, paired Bash tool_use → tool_result by tool_use_id):
| Subcommand | Calls | Est. tokens | Avg/call |
|---|---|---|---|
| az aks command (invoke) | 61 | 18,668 | 306 |
| az aks get-credentials | 81 | 16,072 | 198 |
| (other az aks) | 51 | 3,530 | 69 |
| Total az aks | 193 | 38,270 | 198 |
Two surprise findings vs my prior assumptions:
az aks command invokeis the largest bloat source — it streams full kubectl/helm output through, but the wrapper layer adds JSON envelope metadata (exitCode,properties.logs,properties.provisioningState) that's redundant when stdout already carries the result.az aks get-credentialsreturns a multi-line warning prelude ("Merged 'X' as current context...", deprecation notices about kubelogin auth) on every call — ~200 tokens of noise per invocation, 81 invocations = ~16K tokens of pure preamble.
Suggested wrapper behavior:
- For
az aks command invoke: strip the JSON envelope, emit onlyproperties.logsto stdout (or pass-through with--rtk-raw) - For
az aks get-credentials: strip preamble, emit only the finalMerged ... as current contextline - For
az aks show: dropaddonProfiles[]entries withenabled: false, dropagentPoolProfiles[].tagsif empty
A generic ARM JSON pruner (filed separately as #1590) would cover ~30% of az aks show savings as a fallback. Happy to defer the show-side trimming until that lands.
Methodology note: numbers come from scanning ~/.claude/projects/**/*.jsonl transcripts, pairing Bash tool_use blocks with their tool_result by tool_use_id, stripping any rtk prefix to count like-for-like, and estimating tokens at 4 chars/token.