Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

6 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

kusto-cli

Standalone, agent-friendly Go CLI for Kusto workflows. It provides human-readable subcommands and also includes a advanced API explorer for advanced automation.

It runs as a self-contained Go binary with standard environment and Azure CLI authentication options.

Install

Homebrew

brew tap sozercan/repo
brew install kusto-cli

Prebuilt binaries

Prebuilt archives for Linux, macOS, and Windows are published on the GitHub Releases page. Each release includes checksums.txt.

From source

go build -o bin/kusto-cli ./cmd/kusto-cli

Quick start

Use the public sample endpoint for examples:

Cluster URI: https://help.kusto.windows.net
Database:    Samples

Run a query:

kusto-cli --service-uri https://help.kusto.windows.net --database Samples query 'StormEvents | count'

List databases:

kusto-cli --service-uri https://help.kusto.windows.net --database Samples databases list

Describe a table:

kusto-cli --service-uri https://help.kusto.windows.net --database Samples tables describe StormEvents

Sample rows:

kusto-cli --service-uri https://help.kusto.windows.net --database Samples tables sample StormEvents 5

Run as an stdio service:

kusto-cli --service-uri https://help.kusto.windows.net --database Samples serve

Authentication

kusto-cli is non-interactive by default. It resolves a bearer token in this order when --auth auto is used:

  1. KUSTO_ACCESS_TOKEN
  2. az account get-access-token --resource https://kusto.kusto.windows.net

Check auth:

kusto-cli auth status

Common commands

Command Description
kusto-cli query '<kql>' Run a KQL query
kusto-cli command '.show tables' Run a management command
kusto-cli databases list List databases
kusto-cli tables list List tables
kusto-cli tables describe <table> Describe a table
kusto-cli tables sample <table> [size] Sample rows from a table
kusto-cli entities list <type> List entities by type
kusto-cli services list List configured services
kusto-cli deeplink '<kql>' Build a web explorer deeplink
kusto-cli queryplan '<kql>' Show query plan
kusto-cli diagnostics Run diagnostics
kusto-cli api tools List API tools
kusto-cli api schema <tool> Show API tool schema
kusto-cli api call <tool> '<json>' Call a API tool

Output

Direct commands support:

-o json
-o table
-o tsv

Example:

kusto-cli --service-uri https://help.kusto.windows.net --database Samples -o table query 'StormEvents | count'

Safety flags

Flag Description
--allow-write Allow write-capable operations such as inline ingestion and non-.show management commands
--dry-run Preview write-capable direct calls without executing
--no-input Reserved for non-interactive consistency
--force Reserved for confirmation consistency

Documentation

Development

make test-short
make vet
make build-static

License

MIT

About

πŸ“Š Standalone agent-friendly CLI for Kusto workflows

Resources

Contributing

Stars

Watchers

Forks

Releases

Contributors

Languages