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
AskTable
Go to console

Integrations and development

Use the CLI in terminals and scripts

Ask questions from the command line, call AskTable in scripts, or let desktop AI assistants use AskTable through the CLI.

The AskTable CLI is the official command-line tool (npm package @datamini/asktable-cli, command asktable). It suits asking questions in a terminal, script automation, and letting desktop AI assistants such as Codex and WorkBuddy use AskTable through the AskTable Skill.

This page is written for CLI 0.0.18. The CLI and server are released separately; keep both reasonably current. If an older version lacks a command, rely on asktable --help.

Install

Requires Node.js 18 or later.

npm install --global @datamini/asktable-cli
asktable --version

Sign in

asktable auth login

This opens the browser by default; choose AskTable Cloud or a private deployment and confirm authorization to use AskTable as yourself. For private deployments, specify the API address with --server:

asktable --server https://asktable.example.com/api auth login

Browser authorization shows the agents you can use across organizations and projects and supports automatic agent selection (see below).

  • asktable auth whoami --json asks the server to confirm the current identity, project, and role. auth status shows only local configuration and does not prove the credential is valid.
  • Configuration is saved in ~/.config/asktable/config.json. Precedence: command options (--api-key, --server, --project, --org) > environment variables (ASKTABLE_API_KEY, ASKTABLE_API_URL, ASKTABLE_PROJECT_ID, ASKTABLE_ORG_ID) > configuration file > default service https://api.asktable.com. Private deployments must specify the service address.
  • asktable auth logout signs out; --local clears only local credentials. Keys in environment variables still take effect and must be removed from the runtime environment.

Ask questions

asktable query "What were sales this month?" --json
  • Without specifying an agent, AskTable chooses an agent you can use based on the question. Automatic selection requires browser authorization; with an API key, specify one with --data-agent <id>.
  • Specify an agent: --data-agent <id>. Use asktable discover to see the projects you can access, agent purposes, and edit permissions at once, or asktable data-agent list --json.
  • Add a definition for this question: --context "Sales are amount paid minus refunds", used only for this analysis.
  • Run mode: --reasoning-mode fast or deep (default deep).
  • Data identity for system integration keys: --role <role_id> --role-variable dept_id=D001. Personal keys and browser authorization always use your own data role and cannot override it.

query checks for results every second and waits up to 120 seconds. After a timeout, view the original conversation with asktable conv get <conversation_id> instead of resubmitting the same question.

Follow-ups and clarifications

Continue with the returned conversation_id:

asktable query "By calendar month, using payment time" --conversation <conversation_id> --json

When the status is clarifying, the agent is waiting for more information:

  • With one clarifying question, answer directly with --conversation.

  • With several clarifying questions, answer each with --clarify-answers. question_index and selected_options are both zero-based indexes, and free text goes in custom_text:

    asktable query "Answer clarifying questions" --conversation <conversation_id> \
      --clarify-answers '[{"question_index":0,"selected_options":[1]},{"question_index":1,"custom_text":"East China only"}]'

When automatic selection needs more information before choosing an agent, keep the original question, put the extra details in --context, and ask again.

A status of warning, error, or paused means the turn did not complete normally; check the conversation details. When reusing a conversation, creation options such as --data-agent and --role are not reapplied.

Manage resources

Read the existing configuration before changing it, and read it back with the corresponding get command afterwards. Rely on asktable <command> --help for available commands:

ResourceCommands
Data sourcesds list/get/create/update/delete, ds test-connection, ds upload
Metadatads meta get/preview/sync/export/import, ds field edit, ds table edit
Training setsds training list/create/update/delete
Agentsdata-agent list/usage/get/create/update/delete
Business documentsdata-agent document list/get/create/update/delete <agent_id>
Skillsskill list/get/create/update/delete
Scheduled tasksdata-agent schedule list/get/create/update/delete/trigger/logs
Roles, policiesrole ..., policy ...
Conversationsconv list/get/update/delete/compact/cancel/artifacts, conv share get/create/delete
Projects, members, organizationsproject ..., member ..., organization members

Key points:

  • --datasources and --skills in data-agent update replace the whole list; they do not append.
  • --desc is required for business documents; use --content-file for long bodies, which takes precedence over --content.
  • After a data source --wait finishes, still read back the sync status and errors.
  • Delete commands ask for confirmation by default; add --yes when certain.
  • Add --json for structured output; some write commands still print prompt lines, so check the output of each command in scripts.

Scheduled tasks

asktable data-agent schedule create <agent_id> --name "Daily report" --cron "0 1 * * *" --prompt "Analyze yesterday's orders"
asktable data-agent schedule update <agent_id> <schedule_id> --action-id <action_id> --enabled true

New tasks are disabled. The notification method (--action-id, your Action in the current project) and enabling can only be set with update. Cron expressions are interpreted in UTC. Scheduled task commands match the server from CLI 0.0.14; upgrade older versions.

Let desktop AI assistants use AskTable

asktable get-skill > asktable-skill.md

get-skill outputs the AskTable Skill bundled with the CLI; install it into your assistant's skill directory according to its rules. The “Agent integrations” page also provides copy-ready installation guidance. After upgrading the CLI, export and update the installed skill again.

After installation, the desktop assistant can:

  • Confirm the sign-in target and find the projects and agents you can use.
  • Pass statistical rules you give for this question (such as “sales are amount paid minus refunds”) to AskTable along with the question.
  • After your confirmation, save rules and field explanations for long-term reuse into an agent you can edit.
  • Submit usage problems or feature suggestions when you explicitly ask. No separate feedback credentials are needed; it confirms the content with you before submitting.

The AskTable Skill is usage guidance for desktop assistants, different from analysis skills in agents.

Known limitations

  • Embed commands: data-agent embed still uses the old API path, which does not match the server's current embed management API and may return 404. Manage embeds in the web app.
  • The CLI has removed the old ats, glossary, and project preference commands.
  • query no longer supports --datasources; the data scope is determined by the agent.

Common issues

SymptomCauseAction
Not signed in or no API key configuredNo usable credentialauth login, or set ASKTABLE_API_KEY
auth status shows signed in, but calls failThe credential was revoked or expired, or the service address is wrongCheck with auth whoami and sign in again
401Authentication failedCheck the credential and service address; do not keep changing resources
403No permission; being able to use an agent does not mean reading its full configurationCheck with auth whoami and can_manage in data-agent usage
404The resource does not exist, is not in the current project, or the command uses an old APICheck the project and resource; for embed commands see known limitations
Automatic agent selection fails without --data-agentUsing an API key, or the question matches no agentSpecify --data-agent
Asked to answer clarifications one by one--clarify-answers was not usedAnswer each as above
120-second timeoutThe analysis takes longerView the original conversation with conv get
Requests go to CloudThe private deployment service address is not setSet --server or ASKTABLE_API_URL