Skip to content
Last updated

TDX Commands (Server-Side CLI)

WebDesktop

Skip the terminal. The full tdx CLI runs inside Studio's server-side sandbox, so you can query databases, manage segments, and validate configurations without leaving the chat — with the same commands you already use locally.

Note

TDX commands execute in an isolated sandbox execution environment — not on your local machine. Your Treasure AI credentials are managed server-side and are not stored in the browser. Network access is restricted to Treasure AI APIs and authorized endpoints.

Objective

Run tdx CLI commands through the AI for precise, on-demand control over your Treasure AI resources — complementing the AI's autonomous multi-step workflows.

Prerequisites

  • Signed in to Treasure AI Studio (Getting Started)
  • Web or Desktop only — TDX commands are not available on Mobile

Running TDX Commands

Ask the AI to run any tdx command on your behalf. The command executes in the server-side sandbox, and the output appears inline in the conversation as a tool call result.

You: Run tdx databases to show me what's available

AI: [Runs tdx databases in the sandbox]
    You have 12 databases. Here are the most recently updated...

When to Use Direct Commands

  • Quick lookups. Ask the AI to run tdx databases or tdx tables mydb to check what data is available.
  • Precise control. When you know the exact command, tell the AI to run it directly — it skips the reasoning phase and executes immediately.
  • Validation. Ask the AI to run tdx sg validate segment.yaml or tdx journey validate journey.yaml to validate configurations.
  • Debugging. Ask the AI to run tdx api --type td /v3/job/list to inspect raw API responses.

When to Let the AI Choose Commands

For multi-step workflows — "explore the customer database, find the most useful tables, and build an audience segment of high-value users" — let the AI handle the commands. It chains together the right sequence of calls, interprets the results, and continues working.

Available TDX Commands

The full tdx CLI is available in the sandbox. Here are the most commonly used command groups:

Data Commands

CommandDescriptionExample
tdx databasesList all databasestdx databases
tdx tables <db>List tables in a databasetdx tables mydb
tdx describe <db.table>Show table schema (columns and types)tdx describe mydb.users
tdx show <db.table>Preview table contents (SELECT * with limit)tdx show mydb.users
tdx query "<sql>"Run a Trino SQL querytdx query "SELECT * FROM mydb.users LIMIT 10"
tdx job listList recent query jobstdx job list

CDP Commands

CommandDescriptionExample
tdx segment listList CDP audience segmentstdx segment list
tdx sg validate <file>Validate a segment YAML filetdx sg validate segment.yaml
tdx parent-segment listList parent segmentstdx parent-segment list
tdx journey listList journeystdx journey list
tdx journey validate <file>Validate a journey YAML filetdx journey validate journey.yaml
tdx activations <segment>List activations for a segmenttdx activations parent/child

AI Commands

CommandDescriptionExample
tdx agentsList agents in current projecttdx agents
tdx llm projectsList LLM projectstdx llm projects

Context & Utility Commands

CommandDescriptionExample
tdx statusShow auth status and current contexttdx status
tdx use database <db>Set the active database for the sessiontdx use database mydb
tdx api <endpoint>Make a raw API requesttdx api --type td /v3/job/list
Pro Tip

Use plural forms as aliases for list commands: tdx databases = tdx database list, tdx tables mydb = tdx table list mydb, tdx segments = tdx segment list.

Output Formats

By default, tdx outputs results in a human-readable table format. You can control the output format with flags:

FlagFormatUse Case
--tableTable (default)Human-readable display
--jsonJSONStructured data for AI processing
--jsonlJSON LinesStreaming/line-by-line processing
--tsvTSVTab-separated for spreadsheet import

When the AI runs tdx commands on your behalf, it may use --json to get structured output that is easier to process programmatically.

Server-Side Execution Environment

All tdx commands execute in an isolated server-side sandbox, not on your local machine. This means:

  • Your Treasure AI credentials are managed server-side and are not stored in the browser
  • Network access is restricted to Treasure AI APIs and authorized endpoints
  • Filesystem scope is limited to the chat session's working directory
  • No local side effects — nothing is installed on or read from your computer

See Security & Permissions for details on the sandbox execution environment.

Differences from Treasure Studio Labs

FeatureTreasure Studio LabsTreasure AI Studio
Execution environmentLocal machine (your terminal)Server-side sandbox
Command paletteCmd+Shift+P for actionsNot available in GA
MCP toolsConnected via local MCP serverNot available in GA (MCP is post-GA)
Technical Note

In Treasure Studio Labs, tdx commands executed directly on your local machine using your local tdx installation. In Treasure AI Studio, the same commands execute in the server-side sandbox using a managed tdx installation. The command syntax is identical — the execution environment has changed.

Verification

  • Ask the AI to run tdx status and see your auth status and region
  • Ask the AI to run tdx databases and see a list of your Treasure AI databases
  • Expand the tool call to see the full command and raw output

Troubleshooting

IssueSolution
Command returns "not found" or empty outputVerify your Treasure AI account has the expected databases and resources. Ask the AI to run tdx status to confirm authentication and region are correct
Output is truncatedLarge outputs are trimmed to fit the chat. Ask the AI to run the command with --format json for complete output, or ask it to summarize the results

Next Steps