https://github.com/danield137/ku
An ultra light-weight Kusto client.
https://github.com/danield137/ku
Last synced: about 1 month ago
JSON representation
An ultra light-weight Kusto client.
- Host: GitHub
- URL: https://github.com/danield137/ku
- Owner: danield137
- License: mit
- Created: 2026-04-08T21:06:41.000Z (about 2 months ago)
- Default Branch: main
- Last Pushed: 2026-04-08T23:41:41.000Z (about 2 months ago)
- Last Synced: 2026-04-09T01:20:13.421Z (about 2 months ago)
- Language: Rust
- Size: 41 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ku
Slim Kusto CLI — query Azure Data Explorer from the command line and save results as KDF files.
No Kusto SDK. No heavy dependencies. Just HTTP + JSON + Azure CLI auth.
## Install
### From crates.io (requires Rust toolchain)
```bash
cargo install kusto-query
```
### From source
```bash
git clone https://github.com/danield137/ku.git
cd ku
cargo install --path .
```
### Prebuilt binaries
Download from [GitHub Releases](https://github.com/danield137/ku/releases) — available for Linux, macOS, and Windows.
## Usage
```
ku --cluster --database --query --output
ku --cluster --database --query --adaptive-output
```
### Options
| Flag | Description |
|------|-------------|
| `--cluster ` | Kusto cluster URL |
| `--database ` | Database name |
| `--query ` | KQL query |
| `--output ` | Always write KDF file |
| `--adaptive-output ` | Write KDF only if result is large; print small results inline |
| `--head ` | Print first N rows (default: 5 with `--adaptive-output`) |
| `-pp`, `--pretty-print` | Use padded table format instead of CSV |
| `-h`, `--help` | Print help |
### Examples
Query and save to file:
```bash
ku --cluster https://help.kusto.windows.net --database Samples \
--query "StormEvents | count" --output result.kdf
```
Adaptive output — small results print inline, large ones save to file:
```bash
ku --cluster https://help.kusto.windows.net --database Samples \
--query "StormEvents | summarize count() by State" --adaptive-output states.kdf
```
Preview first 3 rows with pretty-print:
```bash
ku --cluster https://help.kusto.windows.net --database Samples \
--query "StormEvents | take 100" --output events.kdf --head 3 -pp
```
## Requirements
- [Azure CLI](https://learn.microsoft.com/en-us/cli/azure/install-azure-cli) — `ku` uses `az account get-access-token` for authentication
- You must be logged in: `az login`
## KDF Format
KDF (Kusto Data Frame) is a JSON file containing the Kusto V2 PrimaryResult frame. It preserves column names, types, and all row data exactly as returned by Kusto.
## License
MIT