一键导入
kusto-cli
Microsoft Kusto.Cli for KQL queries against Azure Data Explorer and Microsoft Fabric Eventhouse — connection strings, headless execution, CSV export
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Microsoft Kusto.Cli for KQL queries against Azure Data Explorer and Microsoft Fabric Eventhouse — connection strings, headless execution, CSV export
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
The Code reporting discipline AND the reporting-system operations command. Discipline half — the "one spine" rule (every reportable unit of work lands one Weekly Work Tracker row, Source-tagged), field mapping, Bridge auto-mirror tie-in. Operations half (proposal 07) — /reporting status (registry tail, trust metrics, drift, next scheduled runs, log locations), /reporting run <pipeline>, /reporting heal. Use when finishing reportable work, when asked "how should I report this" / "log this for the report", at session end to capture unreported work, or for pipeline ops — "/reporting", "reporting status", "is reporting healthy", "run the health check", "why is a report row missing/stale".
Generate the weekly FourthOS sponsor update package for Carly (VP) and Christian (CTO). Pulls live portfolio data from the FourthOS Notion cockpit, refreshes the Notion Update Package page, renders a progressive-disclosure HTML artifact set (Tier 1 briefing dashboard, Tier 2 teaching deep-dive), stages it UNLISTED to the ai-enablement-decks GitHub Pages site, and notifies Dave to review before promoting it live. Use when asked to generate, build, preview, or promote the FourthOS weekly sponsor update, or when the CCv3-FourthOS-Weekly scheduled task runs. Triggers on "fourthos weekly", "sponsor update", "Carly update", "Christian update", "weekly portfolio update".
Run a feature through the full tri-model Game Plan pipeline — rostered roles (Claude hub, Grok builder/researcher, Codex reviewer/fixer), a workroom disk bus, and human gates. Use when the user types /game-plan [feature], says "run the game plan on X", "full crew on this", "roster this feature", or wants a multi-milestone feature built with cross-model build/review separation. Opt-in orchestrator on top of /workroom; for one-shot tasks use /grok or /codex directly, for trivial edits use neither.
Audit and curate the memory system -- identify signal vs noise, score entries, and archive low-quality learnings.
Detect drift between the continuous-claude repo and the active ~/.claude/ directory
Initialize Continuous Claude v3 for a new project with full toolset activation. Creates project CLAUDE.md (interview-driven, 8 sections), ROADMAP.md, knowledge tree, Serena code intelligence, and project registry entry. Use when opening a new project folder for the first time, starting a new project, setting up CCv3 in an existing repo, or the user says "init project", "setup project", "new project", "initialize", "start new project".
| name | kusto-cli |
| description | Microsoft Kusto.Cli for KQL queries against Azure Data Explorer and Microsoft Fabric Eventhouse — connection strings, headless execution, CSV export |
Kusto.Cli.exe is Microsoft's reference command-line tool for sending KQL queries and control commands to a Kusto service (Azure Data Explorer or Microsoft Fabric Eventhouse). It is REPL-first but supports fully headless execution via -execute / -script.
On this machine: C:\tools\kusto-cli\Kusto.Cli.exe, version 14.1.2, .NET Framework 4.7.2 build. Modern Windows 10/11 ships a preinstalled 4.x .NET Framework runtime that is forward-compatible with net472 targets (Win 10 1803/1809 preinstall 4.7.2; Win 11 22H2+ preinstalls 4.8.1) — verify with Get-ItemPropertyValue 'HKLM:\SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full' Release if startup fails. Source NuGet: Microsoft.Azure.Kusto.Tools.
Run Kusto.Cli.exe -help for basics, -verboseHelp for advanced switches. -helpmd and -verboseHelpMd emit MarkDown.
The connection string is the first positional argument. Always wrap in double quotes — PowerShell parses unquoted semicolons as command separators.
| Target | Pattern |
|---|---|
| Microsoft Fabric Eventhouse / KQL DB | "https://<eventhouse-guid>.z<N>.kusto.fabric.microsoft.com/<database>;Fed=true" |
| Azure Data Explorer cluster | "https://<cluster>.<region>.kusto.windows.net/<database>;Fed=true" |
| Public help cluster (Microsoft samples) | "https://help.kusto.windows.net/Samples;Fed=true" or shorthand "@help/Samples" |
Fabric Eventhouse URIs are not constructible. The leading segment is the eventhouse GUID (not the workspace ID) and there is a
.z<N>.zone segment whose value Microsoft assigns. Always copy the URI from the eventhouse's Database details → Copy URI button rather than building one by hand.
Fed=true enables AAD federated auth — opens a browser on first use, caches tokens afterward. Other auth modes (application key, federated certificate, managed identity) are encoded as additional fragments — managed identity uses the SDK auth builders (WithAadSystemManagedIdentity() / WithAadUserManagedIdentity(<clientId>)) or the EmbeddedManagedIdentity=... fragment, not dSTS Federated Security (that is a separate first-party mechanism). Full reference: Kusto connection strings.
Default behavior is REPL. For scripts and CI, always pair -execute: with -keepRunning:false so the process exits.
Single query:
Kusto.Cli.exe "<conn>" -execute:"StormEvents | take 5" -keepRunning:false
Multiple commands run in order:
Kusto.Cli.exe "<conn>" `
-execute:"#save c:\temp\out.csv" `
-execute:"StormEvents | take 100" `
-keepRunning:false
Script file (one command per line; use & at end of line to continue, && to fold):
Kusto.Cli.exe "<conn>" -script:"queries\daily.kql" -scriptQuitOnError:true -keepRunning:false
-scriptml: treats the entire file as a single command — use it when KQL spans multiple lines without & continuation. For very long queries, prefer -script:<file> over piling up -execute: chains; response-file (@<file>) syntax exists in .NET arg parsing but is not in the published Kusto.Cli reference, so don't rely on it.
Default is a console table. No native JSON. Structured export goes through the #save directive, which writes the next query result to a CSV file:
Kusto.Cli.exe "<conn>" -execute:"#save c:\temp\events.csv" -execute:"StormEvents | take 100" -keepRunning:false
For pipelines that need JSON, post-process with PowerShell:
Import-Csv c:\temp\events.csv | ConvertTo-Json -Depth 5
Other output toggles (directives, runtime-only): #csvheaderson|off, #tableon|off, #markdownon|off, #focuson|off, #timeon|off. Set -transcript:<file> to mirror all output to a log.
| Route | Use For |
|---|---|
| Kusto.Cli (this skill) | KQL data queries, batch scripts, CSV export for analysis |
az kusto (Azure CLI) | Management plane only — provisioning clusters, databases, principals. Cannot run KQL. |
| Kusto SDK (Python/.NET) | Production data pipelines, JSON results, programmatic integration |
| Kusto.Explorer / Web UI | Interactive exploration with charts and visualization |
# List tables in the database encoded in the conn string
Kusto.Cli.exe "@help/Samples" -execute:".show tables" -keepRunning:false
# Connect to a cluster URI without a database, then switch context per query
# (use #dbcontext only when the conn string DOESN'T already pin a database)
Kusto.Cli.exe "https://help.kusto.windows.net;Fed=true" `
-execute:"#dbcontext Samples" `
-execute:".show tables" `
-keepRunning:false
# Show cluster diagnostics
Kusto.Cli.exe "<conn>" -execute:".show cluster" -keepRunning:false
# Export query result to CSV (no headers)
Kusto.Cli.exe "<conn>" -execute:"#csvheadersoff" -execute:"#save out.csv" -execute:"<KQL>" -keepRunning:false
# Run a saved script and quit on first error
Kusto.Cli.exe "<conn>" -script:"daily-rollup.kql" -scriptQuitOnError:true -keepRunning:false
# Capture transcript for audit
Kusto.Cli.exe "<conn>" -transcript:"run-$(Get-Date -Format yyyyMMdd-HHmmss).log" -execute:"<KQL>" -keepRunning:false
Fed=true parsed bare in PowerShell becomes a separate command and breaks the call.-keepRunning:false leaves the process waiting on stdin in a non-interactive shell.-help is normal — not an error.#save to CSV, then Import-Csv | ConvertTo-Json if needed.-execute/-script.-executeAndKeepRunning: runs commands then drops into REPL — useful when interactively iterating after a setup query, but never use it in scripts. Local -help output exposes -ekr: as a short alias, but that alias is not in Microsoft's published Kusto.Cli reference; use the long form in any script you commit.-webProxy: and response-file @args.rsp appear in some -help builds but are not in the published reference — don't rely on either in committed scripts.See .claude/rules/kusto-cli-safety.md for the dangerous-command list (.drop, .drop extents, .delete, .purge, .clear, .execute database script, .alter ... policy, .ingest into, .set-or-append, .set-or-replace, function/principal mutations, .cancel). Pure read queries, .show commands, and #save are safe.
databases — general PostgreSQL / SQL query optimization patterns. KQL is its own dialect, but the migration-safety / index-thinking discipline transfers.neonctl — sibling cloud-DB CLI integration; same skill+rule shape if you ever add another KQL-style tool here.Trigger keywords: kusto, Kusto.Cli, KQL, kql query, Azure Data Explorer, ADX, Fabric Eventhouse, Fabric KQL DB, kusto.fabric.microsoft.com, kusto.windows.net, .show tables, StormEvents