rtk-ai/rtk

feat: add Azure CLI (az) filter support

Open

#1,208 创建于 2026年4月11日

在 GitHub 查看
 (3 评论) (0 反应) (0 负责人)Rust (2,914 fork)batch import
area:clieffort-largeenhancementhelp wantedpriority:medium

仓库指标

Star
 (48,085 star)
PR 合并指标
 (平均合并 11天 1小时) (30 天内合并 45 个 PR)

描述

Description

RTK supports aws for cloud CLI filtering but not az (Azure CLI). Azure CLI commands produce verbose JSON output that is highly compressible.

Use Case

Common az commands in CI/CD and development workflows:

Command Typical Output What's Needed
az pipelines build list --top 3 -o json ~500 lines / 21 KB Build ID, name, result, status
az devops invoke --area build --resource timeline 1000+ lines Failed task names + log IDs
az devops invoke --area build --resource logs 50-500 lines Log content (timestamps strippable)
az account get-access-token ~10 lines Just the token value
az cosmosdb keys list ~10 lines Just the key values

Impact

From rtk discover in a .NET monorepo environment:

  • az cosmosdb: 80 missed commands
  • az pipelines / az devops invoke: additional high-frequency usage in CI diagnosis workflows

Filtering Opportunities

  1. JSON output compression: az defaults to JSON. Most commands return deeply nested objects where only a few fields matter. Schema-mode or field extraction (like rtk json --schema) would work well.
  2. Timeline API: Returns every task/job/phase in a build — only failed records with their logId matter.
  3. Log output: Lines are prefixed with 28-char timestamps (2026-02-23T21:56:47.0126790Z) that can be stripped. Tail-only (last N lines) is usually sufficient.
  4. Token/key responses: Compact to just the value.

Suggested Subcommands

rtk az pipelines build list   # Compact build list (ID, name, result, time)
rtk az devops invoke          # Filter timeline/logs (strip noise, show failures)
rtk az account                # Compact token/account info
rtk az cosmosdb               # Compact key/connection string output

Environment

  • rtk 0.35.0 (macOS arm64)
  • az 2.x (Azure CLI)
  • Claude Code with PreToolUse hook

贡献者指南