Skip to content
AskTable

Documentation feedback

Current pageCLI/en/integrations/cli

0 / 5,000

Your feedback will be sent to the maintenance team.

Go to console
Go to console

Configuration and administration

Use the CLI in terminals and scripts

Query data in a terminal or manage AskTable resources through scripts.

Guide · Module: integrations · Developers · Deployment: Not specified · Confirmed product versions: Not specified · Source: Existing documentation

AskTable CLI is the official command-line tool, published as the npm package @datamini/asktable-cli with the command name asktable. It calls AskTable's REST API using a project API-Key without depending on a browser, making it suitable for scripts, pipelines, and bulk maintenance. Business users can simply use web Conversations without learning the CLI.

Before you begin

  • Environment: Node.js 18 or later.
  • Credentials: a project API-Key. Use asker for questions only; request admin only to create data sources or change Agents or permissions.
  • Creation location: left main navigation → “Settings” → “API-Key” → “Create API-KEY”; select the type in the dialog. The full value is shown only once, on creation.
  • Entry: a local terminal.

Steps

Install

npm install --global @datamini/asktable-cli

After installation, the asktable command is available; asktable --help lists all command groups.

Log in

Interactive login asks for the API Key and Server URL in sequence:

asktable auth login

For noninteractive use, pass the global options directly:

asktable auth login --api-key YOUR_API_KEY --server https://<your-AskTable-site>

After successful login, configuration is written to the current user's ~/.config/asktable/config.json with keys api_key and api_url. Use asktable auth status to view the active Key (only its first 5 characters plus ***) and Server; asktable auth logout clears local configuration.

Use environment variables in CI

Inject the Key through environment variables instead of writing it to a file:

export ASKTABLE_API_KEY='YOUR_API_KEY'
export ASKTABLE_API_URL='https://<your-AskTable-site>'

Priority from highest to lowest is: command-line --api-key / --server → environment variables ASKTABLE_API_KEY / ASKTABLE_API_URL → configuration file → built-in default https://api.asktable.com. Private deployments must explicitly specify Server, or requests go to Cloud.

Ask your first question

query is the only entry point for questions. Without a specified conversation, it creates a conversation, sends a message, polls until analysis finishes, and outputs the answer and conversation_id:

asktable query "Your data question" \
  --data-agent <agent_id> \
  --json

Use either --data-agent or --datasources; --datasources accepts multiple comma-separated data source IDs:

asktable query "Your data question" --datasources ds_xxxxxxxx --json

Polling runs every 1 second, waiting up to 120 seconds; a timeout reports Conversation <id> response timed out (120s).

Follow up in the same conversation

Pass the previous output's conversation_id to follow up in the same conversation:

asktable query "Your follow-up question" \
  --conversation <conversation_id> \
  --json

For row-level permissions, pass a role and role variables; variable options can be repeated:

asktable query "Your data question" \
  --data-agent <agent_id> \
  --role <role_id> \
  --role-variable dept_id=D001 \
  --json

Maintain resources in bulk as needed

Common command groups:

GoalCommand
View data sourcesasktable ds list, asktable ds get <id>
Create/update/delete data sourcesasktable ds create, asktable ds update <id>, asktable ds delete <id>
Test connections, upload filesasktable ds test-connection <id>, asktable ds upload
Sync metadataasktable ds meta sync <id>, asktable ds meta preview <id>
Export/import metadataasktable ds meta export <id>, asktable ds meta import <id>
Change field descriptions, visibility, AI value indexesasktable ds field edit <id>
Change table descriptionsasktable ds table edit <id>
Manage training question-answer pairsasktable ds training list <id>, create, update, delete
Manage data Agentsasktable data-agent list/get/create/update/delete
Manage skillsasktable skill list/get/create/update/delete
Manage rolesasktable role list/get/create/update/delete
Manage policiesasktable policy list/get/create/update/delete
View historical conversationsasktable conv list, asktable conv get <id>, asktable conv delete <id>
View available project model groupsasktable model-group list
View project informationasktable project get, asktable project update

Delete commands ask for confirmation by default; --yes skips it. Refer to asktable --help and each subcommand's --help for full options.

Install CLI instructions for an AI coding assistant

asktable get-skill prints an instruction file teaching an AI coding assistant to use asktable:

asktable get-skill

Save the output as a Markdown file in the coding assistant's skill directory to drive these commands with natural language. “Skill” here means CLI instructions for the coding assistant, distinct from an Agent's Skills, which describe analysis methods.

The same guidance is available on the web: the top of “Settings” → “API-Key” has a collapsible “Use in AI Agent” section containing this instruction, ready to copy and send to an Agent.

Key constraints

ItemValue or defaultWhere to change it
Node.js version18 or laterLocal environment
Configuration file path~/.config/asktable/config.jsonNo UI switch
Configuration priority--api-key/--server > ASKTABLE_API_KEY/ASKTABLE_API_URL > configuration file > https://api.asktable.comCommand options or environment variables
Default Serverhttps://api.asktable.comOverride with --server or ASKTABLE_API_URL
query wait limit120 seconds (polling once per second)No UI switch
--jsonOff by default, producing human-readable text; enabling produces structured JSONCommand options
Delete commandsConfirmation required by default; --yes skips itCommand options
Project API-Key typesasker asks questions only; admin manages all resources“Settings” → “API-Key”

Troubleshooting

SymptomIdentifying conditionResolution
Every command says no API Key is configured and asks you to run asktable auth loginasktable auth status shows Logged outRun asktable auth login first, or add --api-key
Login fails with an invalid API Keyauth login receives a non-2xx response when probing with this KeyConfirm the Key was not deleted and has no extra spaces; create a new one on “API-Key”
401 errorResponse status is 401Change the Key; it may have been deleted or belong to another project
404 errorResponse status is 404The command's ID is incorrect or the resource was deleted; confirm the ID with list
422 errorResponse status is 422Parameters are incorrect; fix required fields according to the response
query reports a conversation response timeout (120s)Conversation remains streaming or pending for 120 secondsOpen it on the web to see whether it is stuck; split a large question or use a faster model group
query ends with [Status: warning], [Status: error], or [Status: paused]Conversation did not end normallyCheck details with asktable conv get <conversation_id>, or open it on the web
Private deployment commands go to CloudServer in asktable auth status is https://api.asktable.comUse --server or ASKTABLE_API_URL to point to your site

Next steps