sql-cli 1.60.0

SQL query tool for CSV/JSON with both interactive TUI and non-interactive CLI modes - perfect for exploration and automation
Documentation
# SQL-CLI Configuration File
# Copy this file to:
#   ~/.config/sql-cli/config.toml  (Linux/Mac)
#   %APPDATA%\sql-cli\config.toml  (Windows)

[redis_cache]
# Enable Redis cache (can be overridden by SQL_CLI_CACHE env var)
enabled = false

# Redis connection URL (can be overridden by SQL_CLI_REDIS_URL env var)
redis_url = "redis://127.0.0.1:6379"

# Default cache duration in seconds when CACHE is specified without a value
# or when no CACHE directive is present in the query
default_duration = 600  # 10 minutes

# Cache duration rules based on URL patterns
# Pattern matching uses simple glob syntax (* for wildcards)
# These override the default_duration for matching URLs
[redis_cache.duration_rules]
# Production APIs - cache for 1 hour
"*.bloomberg.com/*" = 3600
"*prod*" = 3600
"*production*" = 3600

# Staging/UAT - cache for 5 minutes
"*staging*" = 300
"*uat*" = 300

# Historical data endpoints - cache for 24 hours
"*/historical/*" = 86400
"*/archive/*" = 86400
"*/trades/20*" = 43200  # Yesterday's trades - 12 hours

# Real-time/volatile data - short cache
"*/realtime/*" = 60
"*/live/*" = 30
"*/prices/*" = 120

# Specific endpoints
"api.barclays.com/trades" = 7200  # 2 hours for Barclays trades
"api.jpmorgan.com/fx" = 1800      # 30 minutes for JPM FX

[web]
# Default timeout for web requests in seconds
timeout = 30

# Maximum response size in MB
max_response_size = 100

# ============================================================================
# TOKEN MANAGEMENT
# ============================================================================
[tokens]
# Auto-refresh tokens before they expire
auto_refresh = false

# Default token lifetime in seconds (1 hour)
default_lifetime = 3600

# Token definitions with refresh commands
# Each token variable (e.g., ${JWT_TOKEN}) needs a command that outputs the token

[tokens.tokens.JWT_TOKEN]
description = "UAT environment JWT token"
# Command that outputs token to stdout
refresh_command = "~/.config/sql-cli/get_uat_token.sh"
lifetime = 3600  # 1 hour

[tokens.tokens.JWT_TOKEN_PROD]
description = "Production environment JWT token"
refresh_command = "~/.config/sql-cli/get_prod_token.sh"
lifetime = 7200  # 2 hours

# More examples:

# Azure CLI token
# [tokens.tokens.AZURE_TOKEN]
# description = "Azure access token"
# refresh_command = "az account get-access-token --resource https://api.example.com --query accessToken -o tsv"
# lifetime = 3600

# OAuth2 client credentials flow
# [tokens.tokens.OAUTH_TOKEN]
# description = "OAuth2 bearer token"
# refresh_command = "curl -s -X POST https://auth.example.com/oauth/token -d 'client_id=xxx&client_secret=yyy&grant_type=client_credentials' | jq -r .access_token"
# lifetime = 3600

# Custom script that handles all auth logic
# [tokens.tokens.CUSTOM_TOKEN]
# description = "Custom auth token"
# refresh_command = "/opt/bin/get-auth-token --env=prod --format=raw"
# lifetime = 1800