AskTable
sidebar.freeTrial

AskTable CLI: Let AI Assistants Help You Manage Data

AskTable Team
AskTable Team 2026-03-18

AskTable CLI: Let AI Assistants Help You Manage Data

What We Released

AskTable now supports command-line tools (CLI), enabling AI assistants like Claude Code and Cursor to directly operate your data sources, query data, and manage permissions.

One-sentence understanding: In the AI Agent era, CLI is the standard interface between AI and data analysis capabilities.


Value to You

1. Give AI Assistants Data Analysis Capabilities

When you say "Help me check last month's sales data" in Claude Code, AI can directly call AskTable CLI to complete the query, without you manually opening web pages, logging in, and entering questions.

2. Automate Your Data Workflow

  • Automatically generate yesterday's data reports every morning
  • Automatically verify data quality before deployment
  • Regularly sync data source metadata

3. Manage Data Permissions with Code

Batch create roles and configure permission policies through scripts, goodbye to manual clicking.


How to Get Started

Step 1: Installation and Authentication

Installation

npm install -g @datamini/asktable-cli

After installation, you can use the asktable command anywhere.

Configure Authentication (Recommended)

asktable auth login
# Enter your API Key, configuration will be saved locally

Or use environment variables:

export ASKTABLE_API_KEY="your-api-key"
export ASKTABLE_API_URL="https://cloud.asktable.com"

Step 2: Basic Operations

View Your Data Sources

asktable ds list

Query Data

asktable query <bot_id> "What product had the highest sales last month"

Query results are automatically downloaded as CSV files, saved in the /tmp/asktable/ directory.

Upload New Data

# Create data source
asktable ds create --name "Sales Data" --engine excel

# Upload file
asktable ds upload <datasource-id> sales.xlsx

# Sync metadata
asktable ds meta sync <datasource-id> --wait

Common Scenarios

Scenario 1: Quick Data Query

# Create Bot (bind data source)
asktable bot create --name "Sales Assistant" --datasource <datasource-id>

# Query
asktable query <bot-id> "Sales ranking by department"

Query results are automatically saved as CSV, you can directly open with Excel or continue processing.

Scenario 2: Configure Data Permissions

# Create policy: Employees can only see their own data
asktable policy create \
  --name "Employee Self-Check" \
  --permission allow \
  --datasources <datasource-id> \
  --rows-filter '{"*.*.employee_id": "{{employee_id}}"}'

# Create role and bind policy
asktable role create --name "Regular Employee" --policies <policy-id>

# Query with role
asktable query <bot-id> "My overtime situation" \
  -r <role-id> \
  -V employee_id=59114541

Scenario 3: Automated Data Sync

# Scheduled script: Sync data source metadata daily
#!/bin/bash
asktable ds meta sync <datasource-id> --wait
echo "Metadata sync complete: $(date)"

For AI Agent Use

If you're using AI assistants like Claude Code and Cursor, let them directly call AskTable CLI.

Example Conversation:

You: Help me check the top 5 products with highest sales last month

Claude Code:
$ asktable query <bot-id> "Top 5 products with highest sales last month" --json

Results saved to /tmp/asktable/xxx.csv
Top 5 products are:
1. Product A - ¥1,234,567
2. Product B - ¥987,654
...

Key Parameters:

  • --json: Output JSON format, easy for AI to parse
  • --yes: Skip delete confirmation, avoid AI getting stuck
  • --wait: Wait for async operations to complete

Complete Command Reference

Data Source Management

asktable ds list                    # List all data sources
asktable ds get <id>                # View details
asktable ds create --name <name> --engine <engine>
asktable ds upload <id> <file>      # Upload Excel/CSV
asktable ds meta sync <id> --wait   # Sync metadata

Query

asktable query <bot-id> "<question>" [-r <role-id>] [-V key=value]

Roles and Permissions

asktable role list                  # List all roles
asktable role create --name <name> --policies <id1,id2>
asktable policy create --name <name> --permission allow --datasources <ids>

Bot Management

asktable bot list                   # List all Bots
asktable bot create --name <name> --datasource <id>

Conversation Management

asktable chat create --bot <id> [-r <role-id>]
asktable chat send <chat-id> "<question>"

For complete command documentation, refer to: AskTable CLI Documentation


Summary

AskTable CLI allows you to:

  • Complete data queries with one command
  • Let AI assistants directly operate your data
  • Automate data workflows with scripts
  • Manage data permissions with code

Get Started Now:

asktable auth login
asktable ds list

Questions? Feel free to submit Issues on GitHub or join our community discussion.

cta.readyToSimplify

sidebar.noProgrammingNeededsidebar.startFreeTrial

cta.noCreditCard
cta.quickStart
cta.dbSupport