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 as yourself or a system integration, and maintain AskTable resources within your permissions.

AskTable CLI is the official command-line tool, published as the npm package @datamini/asktable-cli with the command name asktable. Use it for terminal queries, scripts, and external AI assistants. Business users can also start a conversation directly in the web app.

This page uses CLI 0.0.10 as its command baseline and checks it against Server v4.2.48-1026. The CLI and server are released independently. A command's existence does not establish compatibility with every server version; see the known schedule and embed limitations below.

Before you start

  • Environment: Node.js 18 or later.
  • Credentials: create a key under “Agent integrations” in the main navigation. Choose “Personal Key” to act as yourself or let an external Agent act for you. Choose “System Integration Key” for a trusted business system; this option is available only to project owners and admins.
  • Connection details: copy the service URL and current project ID from the same page. A key is shown in full only when created.
  • Confirm which Agent you will call, its connected data sources, and your data permissions.

Steps

Install and check the version

Install the specific version to reproduce this page's commands:

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

Read the relevant subcommand help, such as asktable data-agent --help and asktable query --help. After upgrading the CLI, check its help and bundled Skill again.

Log in and confirm your server identity

Interactive login asks for an API key and Server URL. After successful validation, it saves them to ~/.config/asktable/config.json under api_key and api_url:

asktable auth login
asktable auth status
asktable auth whoami --json

auth status displays local connection settings and does not prove that the credential is still valid. auth whoami calls the server and returns information including the current project_id, user_id, project_role, and API role ak_role. Check the project before proceeding, and do not print the key.

IdentityHow to identify itConfiguration permissions
Personal keyHas a user_id and acts as you in the current projectA MEMBER can create and manage their own Agents, skills, and schedules; an OWNER or ADMIN can govern project configuration. ak_role=asker alone does not mean a personal key cannot configure resources
System integration admin keyHas no user identity and has API role adminUsed for project infrastructure such as data sources, metadata, roles, and policies, and for Agent calls. It cannot read or modify personal Agent, skill, business document, channel credential, or schedule configuration
System integration asker keyHas no user identity and has API role askerSuitable for querying through existing Agents; it cannot manage personal configuration

asktable auth logout removes the local configuration file. Subsequent commands still use a key if one remains in the environment.

Inject credentials into scripts

Set these variables in the CI or script runtime:

export ASKTABLE_API_KEY='YOUR_API_KEY'
export ASKTABLE_API_URL='https://<your AskTable site>'
asktable auth whoami --json

Interactive login is unnecessary in this case. Inject real credentials through the runtime's secret management so they do not remain in shell history or a code repository.

For regular API commands, precedence is: global --api-key / --server options → ASKTABLE_API_KEY / ASKTABLE_API_URL environment variables → local configuration file → default service https://api.asktable.com. Set the service URL explicitly for a private deployment.

Choose an available Agent and ask your first question

Start with the usage summaries:

asktable data-agent list --json
asktable data-agent usage <agent_id> --json

The summary's can_manage field indicates configuration access. Permission to use an Agent does not grant access to its full configuration; data-agent get <agent_id> checks configuration permissions separately.

A new query conversation requires --data-agent:

asktable query "What are this month's sales?" \
  --data-agent <agent_id> \
  --json

Data access is the intersection of the Agent's scope and your current data permissions. --datasources cannot replace an Agent or expand its data scope. Personal keys use the member's current data role binding; --role / --role-variable cannot override it.

A trusted backend can specify a data role and role variables for a system integration key. Repeat the variable option for multiple variables:

asktable query "What are this month's sales?" \
  --data-agent <agent_id> \
  --role <role_id> \
  --role-variable dept_id=D001 \
  --json

query creates a conversation, sends the question, and polls the result. It polls at one-second intervals for up to 120 attempts, then reports the conversation ID and a 120s timeout. Inspect that conversation before submitting the same question again.

Answer clarification questions and continue the conversation

JSON output includes conversation_id, status, and the assistant response. Continue with the same ID:

asktable query "Use calendar months and payment time" \
  --conversation <conversation_id> \
  --json
asktable conv get <conversation_id> --json

clarifying means the Agent is waiting for more information; answer using the original conversation ID. Inspect warning, error, and paused states instead of treating them as normal completion.

When reusing a conversation, creation options such as --data-agent, --datasources, and --role are not applied again. Legacy conversations without an Agent cannot receive further queries through the current public message API. Select an Agent and create a new conversation.

Maintain resources within your permissions

Read existing configuration before changing it, then verify with the corresponding get command. Common commands include:

GoalCommand
Inspect data sourcesasktable ds list, asktable ds get <id>
Create, update, or delete data sourcesasktable ds create, asktable ds update <id>, asktable ds delete <id>
Test a prospective connectionasktable ds test-connection --engine <engine> --config '<connection JSON>'; it does not take a data source ID
Upload filesasktable ds upload <id> <file>; use ds create --file <file> to create a source and upload
Read, preview, or sync metadataasktable ds meta get <id>, preview <id>, sync <id>
Export or import metadataasktable ds meta export <id>, asktable ds meta import <id> <file>
Edit field descriptions, visibility, or value indexesasktable ds field edit <id> with --schema, --table, --field, and the relevant options
Edit table descriptionsasktable ds table edit <id> --schema <schema> --table <table> --desc <text>
Manage training question/SQL pairsasktable ds training list/create/update/delete; supply data source and example IDs as shown in help
Manage Agentsasktable data-agent list/usage/get/create/update/delete
Manage business documentsasktable data-agent document list/get/create/update/delete; the first positional argument is the Agent ID
Manage skillsasktable skill list/get/create/update/delete
Manage roles and policiesasktable role list/get/create/update/delete, asktable policy list/get/create/update/delete
Manage conversationsasktable conv list/get/update/delete; lists support --query, --status, --created-by-me, and --sort
Compact, cancel, or inspect result dataasktable conv compact <id>, cancel <id>, artifacts <id>
Read, create, or revoke a conversation shareasktable conv share get/create/delete <id>; confirm the data that can become publicly accessible before sharing
Inspect model groups or project informationasktable model-group list, asktable project get/update

New Agents are private by default. CLI 0.0.10 has no Agent sharing settings command; share an Agent in the web app. Conversation sharing and Agent sharing are separate operations.

Use --domain-knowledge and --analysis-preferences for an Agent's domain knowledge and analysis preferences, each limited to 1,024 characters. Capability options are --python, --chart, --clarification, and --web-search, each taking an explicit true or false. On update, the CLI reads current configuration and preserves unspecified switches. The old --memory-enabled option is no longer available.

--datasources and --skills replace their entire binding lists; they do not append. A business document requires --desc. For long content, use --content-file, which takes precedence over --content:

asktable data-agent document create <agent_id> \
  --title "Sales calculation rules" \
  --desc "Sales calculation, time attribution, and refund handling" \
  --content-file ./sales-rules.md \
  --json

After a data source creation or sync command finishes waiting with --wait, read sync_status and any errors. Waiting ending does not establish sync success. Training examples use --question, --sql, and optional --active true|false; the training example --role option is no longer available. Skill templates and project skills are separate resources; skill list does not return a built-in flag.

Install usage instructions for an external AI assistant

get-skill prints the instructions bundled with the current CLI to standard output. It does not install or update an external assistant's Skill automatically:

asktable get-skill > asktable-skill.md

Install the file in the Skill directory according to your assistant's rules. After updating the CLI, export and replace the installed copy again. Updating the package alone does not change a saved instruction file. “Agent integrations” in the main navigation also provides AskTable Skill installation guidance.

These instructions help an external assistant confirm identity, clarify business definitions, store knowledge in the appropriate place, and verify results. They differ from skills attached to AskTable Agents. Store domain knowledge, business documents, and reusable analysis methods in their respective AskTable settings.

The bundled instructions also cover Bug and feature feedback. Submit only when the user explicitly requests it. Linear access or credentials are separate from the AskTable key; without them, retain a draft and do not claim submission.

Current compatibility limitations

CLI 0.0.10 retains the data-agent schedule and data-agent embed command groups, but their management API paths do not match Server v4.2.48-1026:

FeaturePath used by CLI 0.0.10Current server management pathCurrent approach
Schedules/v1/data-agents/{agent_id}/schedules/v1/schedulesUse scheduled tasks in the web app
Embed configuration/v1/data-agents/{agent_id}/embeds/v1/embedsUse embed settings in the web app

If either group returns 404 on this server, do not keep changing resource IDs or credentials. CLI 0.0.10 does not yet provide corresponding top-level schedule or embed commands. A web feature does not establish that the CLI supports it.

The CLI also removed the old ats, glossary, and project preference commands. Review existing scripts against --help. Server upgrades can also change permissions and resource boundaries, so updating the CLI does not justify keeping the old admin/asker assumptions.

Key constraints

ItemValue or defaultWhere to change it
Node.js18 or laterLocal environment
Command baselineCLI 0.0.10, checked against Server v4.2.48-1026Check the two version lines independently
Configuration file~/.config/asktable/config.jsonauth login / auth logout
Configuration precedenceGlobal options > environment variables > file > default service--api-key / --server or environment variables
Default servicehttps://api.asktable.com--server or ASKTABLE_API_URL
New queriesRequire an Agent and follow current identity and data permissionsquery --data-agent <id>
Query waitingOne-second intervals, at most 120 pollsNo wait-limit option
JSON outputUse --json; some write commands still include message lines, so stdout is not necessarily a single JSON valueCheck each automation command and read back the result
DeletionInteractive confirmation by default; use --yes when deletion is already confirmedDelete command option
System integration keysEven admin does not grant personal configuration managementAgent integrations and resource authorization

Troubleshooting

SymptomConditionAction
API key is not configuredThe current command has no credentialRun auth login or inject ASKTABLE_API_KEY
Local login is shown but calls failauth status has settings, but auth whoami failsCheck the service URL, key revocation or expiration, and project membership
401 responseAuthentication failedCheck the key, URL, and expiration; do not probe by changing resources
403, or an available Agent's full configuration cannot be readUsage and configuration permissions differ, or a system integration key is in useCheck auth whoami and the summary's can_manage; use the appropriate personal identity and resource permission
404 responseResource, access scope, or API path does not matchCheck versions, the command, and visible resources; see the schedule and embed limitations above
422 or parameter errorThe server rejected request parametersFollow the specific error and check required arguments; a new query requires --data-agent
clarifying responseThe Agent needs more business informationAnswer using the original conversation_id
Query reports a 120s timeoutThe polling limit was reachedInspect the original conversation with conv get <conversation_id> before deciding what to do next
warning, error, or paused responseThe turn did not complete normallyInspect conversation details and errors; do not treat it as a successful answer
Data remains unavailable after sync waiting endssync_status is not successful, or sync errors existRead the source details, resolve the specific error, and sync again
A private deployment request reaches the cloudThe effective service URL is still the defaultSet ASKTABLE_API_URL or global --server, then confirm the project with auth whoami

Next steps