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 --helpRead 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 --jsonauth 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.
| Identity | How to identify it | Configuration permissions |
|---|---|---|
| Personal key | Has a user_id and acts as you in the current project | A 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 key | Has no user identity and has API role admin | Used 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 key | Has no user identity and has API role asker | Suitable 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 --jsonInteractive 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> --jsonThe 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> \
--jsonData 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 \
--jsonquery 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> --jsonclarifying 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:
| Goal | Command |
|---|---|
| Inspect data sources | asktable ds list, asktable ds get <id> |
| Create, update, or delete data sources | asktable ds create, asktable ds update <id>, asktable ds delete <id> |
| Test a prospective connection | asktable ds test-connection --engine <engine> --config '<connection JSON>'; it does not take a data source ID |
| Upload files | asktable ds upload <id> <file>; use ds create --file <file> to create a source and upload |
| Read, preview, or sync metadata | asktable ds meta get <id>, preview <id>, sync <id> |
| Export or import metadata | asktable ds meta export <id>, asktable ds meta import <id> <file> |
| Edit field descriptions, visibility, or value indexes | asktable ds field edit <id> with --schema, --table, --field, and the relevant options |
| Edit table descriptions | asktable ds table edit <id> --schema <schema> --table <table> --desc <text> |
| Manage training question/SQL pairs | asktable ds training list/create/update/delete; supply data source and example IDs as shown in help |
| Manage Agents | asktable data-agent list/usage/get/create/update/delete |
| Manage business documents | asktable data-agent document list/get/create/update/delete; the first positional argument is the Agent ID |
| Manage skills | asktable skill list/get/create/update/delete |
| Manage roles and policies | asktable role list/get/create/update/delete, asktable policy list/get/create/update/delete |
| Manage conversations | asktable conv list/get/update/delete; lists support --query, --status, --created-by-me, and --sort |
| Compact, cancel, or inspect result data | asktable conv compact <id>, cancel <id>, artifacts <id> |
| Read, create, or revoke a conversation share | asktable conv share get/create/delete <id>; confirm the data that can become publicly accessible before sharing |
| Inspect model groups or project information | asktable 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 \
--jsonAfter 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.mdInstall 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:
| Feature | Path used by CLI 0.0.10 | Current server management path | Current approach |
|---|---|---|---|
| Schedules | /v1/data-agents/{agent_id}/schedules | /v1/schedules | Use scheduled tasks in the web app |
| Embed configuration | /v1/data-agents/{agent_id}/embeds | /v1/embeds | Use 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
| Item | Value or default | Where to change it |
|---|---|---|
| Node.js | 18 or later | Local environment |
| Command baseline | CLI 0.0.10, checked against Server v4.2.48-1026 | Check the two version lines independently |
| Configuration file | ~/.config/asktable/config.json | auth login / auth logout |
| Configuration precedence | Global options > environment variables > file > default service | --api-key / --server or environment variables |
| Default service | https://api.asktable.com | --server or ASKTABLE_API_URL |
| New queries | Require an Agent and follow current identity and data permissions | query --data-agent <id> |
| Query waiting | One-second intervals, at most 120 polls | No wait-limit option |
| JSON output | Use --json; some write commands still include message lines, so stdout is not necessarily a single JSON value | Check each automation command and read back the result |
| Deletion | Interactive confirmation by default; use --yes when deletion is already confirmed | Delete command option |
| System integration keys | Even admin does not grant personal configuration management | Agent integrations and resource authorization |
Troubleshooting
| Symptom | Condition | Action |
|---|---|---|
| API key is not configured | The current command has no credential | Run auth login or inject ASKTABLE_API_KEY |
| Local login is shown but calls fail | auth status has settings, but auth whoami fails | Check the service URL, key revocation or expiration, and project membership |
| 401 response | Authentication failed | Check the key, URL, and expiration; do not probe by changing resources |
| 403, or an available Agent's full configuration cannot be read | Usage and configuration permissions differ, or a system integration key is in use | Check auth whoami and the summary's can_manage; use the appropriate personal identity and resource permission |
| 404 response | Resource, access scope, or API path does not match | Check versions, the command, and visible resources; see the schedule and embed limitations above |
| 422 or parameter error | The server rejected request parameters | Follow the specific error and check required arguments; a new query requires --data-agent |
clarifying response | The Agent needs more business information | Answer using the original conversation_id |
| Query reports a 120s timeout | The polling limit was reached | Inspect the original conversation with conv get <conversation_id> before deciding what to do next |
warning, error, or paused response | The turn did not complete normally | Inspect conversation details and errors; do not treat it as a successful answer |
| Data remains unavailable after sync waiting ends | sync_status is not successful, or sync errors exist | Read the source details, resolve the specific error, and sync again |
| A private deployment request reaches the cloud | The effective service URL is still the default | Set ASKTABLE_API_URL or global --server, then confirm the project with auth whoami |
Next steps
- Let an MCP-compatible AI client call AskTable directly: MCP
- Integrate queries into a business system: OpenAPI
- Prepare interpretable data and business rules: Connect data sources, Table and field descriptions, Business documents