Skip to content

Commands Reference

Complete reference for all dataspoc-lens CLI commands and their options.

Terminal window
dataspoc-lens --version # Show version
dataspoc-lens --help # Show help

Initialize DataSpoc Lens configuration.

Terminal window
dataspoc-lens init

Creates ~/.dataspoc-lens/ directory with config.yaml and transforms/ subdirectory.

Register a bucket and discover tables.

Terminal window
dataspoc-lens add-bucket <uri>
ArgumentDescription
uriBucket URI: s3://, gs://, az://, or file://

Reads the Pipe manifest or scans for .parquet files and prints discovered tables.

List all tables from registered buckets.

Terminal window
dataspoc-lens catalog [OPTIONS]
OptionDefaultDescription
--detail <table>Show detailed schema for a specific table
--output <format>tableOutput format: table or json

Examples:

Terminal window
dataspoc-lens catalog
dataspoc-lens catalog --detail orders
dataspoc-lens catalog --output json

Execute a SQL query and print results.

Terminal window
dataspoc-lens query <sql> [OPTIONS]
Argument / OptionDefaultDescription
sqlSQL query to execute
--export, -eExport results to file (format from extension: .csv, .json, .parquet)
--outputtableOutput format: table or json

Examples:

Terminal window
dataspoc-lens query "SELECT * FROM orders LIMIT 10"
dataspoc-lens query "SELECT * FROM orders" --export results.csv
dataspoc-lens query "SELECT COUNT(*) FROM orders" --output json

Launch the interactive SQL shell.

Terminal window
dataspoc-lens shell

No options. See Interactive Shell for details on dot commands and features.

Ask a question in natural language and get SQL results.

Terminal window
dataspoc-lens ask <question> [OPTIONS]
Argument / OptionDefaultDescription
questionNatural language question
--debugfalseShow the prompt sent to the LLM
--export, -eExport results to file (.csv, .json, .parquet)
--outputtableOutput format: table or json

Examples:

Terminal window
dataspoc-lens ask "What are the top 10 customers by revenue?"
dataspoc-lens ask "Monthly order trends" --debug
dataspoc-lens ask "Average order value by status" --export report.csv
dataspoc-lens ask "Total revenue" --output json

Install and configure Ollama for local AI (free, no API key needed).

Terminal window
dataspoc-lens setup-ai

Open an interactive notebook with tables pre-mounted.

Terminal window
dataspoc-lens notebook [OPTIONS]
OptionDefaultDescription
--marimofalseUse Marimo instead of JupyterLab

Examples:

Terminal window
dataspoc-lens notebook
dataspoc-lens notebook --marimo

Run SQL transforms in order.

Terminal window
dataspoc-lens transform run

Executes all numbered .sql files in ~/.dataspoc-lens/transforms/ in order. See SQL Transforms for details.

List available transform files.

Terminal window
dataspoc-lens transform list

Manage local cache of remote Parquet data.

Terminal window
dataspoc-lens cache [TABLE] [OPTIONS]
Argument / OptionDefaultDescription
tableTable name to cache
--listfalseList cached tables
--refreshfalseForce re-download of cached data
--clearfalseClear cached data (all or specific table)
--outputtableOutput format: table or json

Examples:

Terminal window
dataspoc-lens cache orders # Cache the orders table
dataspoc-lens cache --list # List all cached tables
dataspoc-lens cache --list --output json # List cached tables as JSON
dataspoc-lens cache orders --refresh # Force re-download
dataspoc-lens cache --clear # Clear all cached data
dataspoc-lens cache orders --clear # Clear specific table cache

Start the MCP server for AI agent integration.

Terminal window
dataspoc-lens mcp

See MCP Server for configuration details.

Activate DataSpoc ML with a license key.

Terminal window
dataspoc-lens ml activate [KEY]

Without a key, displays information about DataSpoc ML and how to purchase a license.

Show DataSpoc ML license status.

Terminal window
dataspoc-lens ml status

Train a model via DataSpoc ML.

Terminal window
dataspoc-lens ml train --target <column> --from <table>
OptionDescription
--targetTarget column name for prediction
--fromTable name or path to training data

Generate predictions via DataSpoc ML.

Terminal window
dataspoc-lens ml predict --model <name> --from <table>
OptionDescription
--modelModel name to use for predictions
--fromTable name or path to input data

List trained ML models.

Terminal window
dataspoc-lens ml models

Explain a trained model via DataSpoc ML.

Terminal window
dataspoc-lens ml explain --model <name>
OptionDescription
--modelModel name to explain