cosq 0.3.0

A CLI to query your Azure Cosmos DB instances
cosq-0.3.0 is not a library.

Quick Start

# Install (macOS / Linux)
brew install mklab-se/tap/cosq

# Or via cargo
cargo install cosq

# Login to Azure
cosq auth login

# Initialize with a Cosmos DB account
cosq init

# Run a query
cosq query "SELECT * FROM c"

# Output as table or CSV
cosq query "SELECT * FROM c" --output table
cosq query "SELECT * FROM c" --output csv

# Pipe-friendly (JSON to stdout, metadata to stderr)
cosq query "SELECT c.name FROM c" -q | jq '.[].name'

Stored Queries

Save and reuse parameterized queries as .cosq files:

# Create a stored query (opens in editor)
cosq queries create recent-users

# List all stored queries
cosq queries list

# Run a stored query (interactive parameter prompts)
cosq run recent-users

# Run with parameters from the command line
cosq run recent-users -- --days 7

# Browse and pick a query interactively
cosq run

See INSTALL.md for all installation methods, shell completions, and platform-specific instructions.

Development

cargo build              # Build
cargo test               # Run tests
cargo clippy             # Lint
cargo fmt                # Format

License

MIT