
sidebar.wechat

sidebar.feishu
sidebar.chooseYourWayToJoin

sidebar.scanToAddConsultant
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.
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.
Batch create roles and configure permission policies through scripts, goodbye to manual clicking.
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"
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
# 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.
# 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
# Scheduled script: Sync data source metadata daily
#!/bin/bash
asktable ds meta sync <datasource-id> --wait
echo "Metadata sync complete: $(date)"
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 completeasktable 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
asktable query <bot-id> "<question>" [-r <role-id>] [-V key=value]
asktable role list # List all roles
asktable role create --name <name> --policies <id1,id2>
asktable policy create --name <name> --permission allow --datasources <ids>
asktable bot list # List all Bots
asktable bot create --name <name> --datasource <id>
asktable chat create --bot <id> [-r <role-id>]
asktable chat send <chat-id> "<question>"
For complete command documentation, refer to: AskTable CLI Documentation
AskTable CLI allows you to:
Get Started Now:
asktable auth login
asktable ds list
Questions? Feel free to submit Issues on GitHub or join our community discussion.
sidebar.noProgrammingNeeded
sidebar.startFreeTrial