# Commands Overview


```bash
tdx <command> [options] [arguments]
```

## Command Categories

### Data Commands

| Command | Aliases | Description |
|  --- | --- | --- |
| [tdx database](/treasure-code/commands/database) | `db` | Database management commands |
| [tdx table](/treasure-code/commands/table) | - | Table management commands |
| `tdx show [table]` | - | Show table contents (SELECT * with limit) |
| `tdx describe [table]` | `desc` | Describe table schema |
| [tdx query](/treasure-code/commands/query) | - | Execute SQL queries with streaming results |
| [tdx job](/treasure-code/commands/job) | - | Manage query jobs |
| [tdx workflow](/treasure-code/commands/workflow) | `wf` | Manage Digdag workflows |


### CDP Commands

| Command | Aliases | Description |
|  --- | --- | --- |
| [tdx segment](/treasure-code/commands/segment) | `sg` | Manage CDP segments and audiences |
| [tdx parent-segment](/treasure-code/commands/parent-segment) | `ps` | Manage parent segment configurations |
| [tdx cas](/treasure-code/commands/cas) | - | Composable Audience Studio (zero-copy CDP on your CDW) |
| [tdx journey](/treasure-code/commands/journey) | - | Manage CDP Journey Orchestration |
| `tdx activations <segment>` | - | List activations for a segment |
| [tdx engage](/treasure-code/commands/engage) | - | Manage Engage campaigns, email templates, and workspaces |
| [tdx connection](/treasure-code/commands/connection) | `connections` | Data connection management (for activations/exports) |


### AI Commands

| Command | Description |
|  --- | --- |
| [tdx agent](/treasure-code/commands/agent) | File-based agent sync (pull/push YAML/Markdown) |
| [tdx chat](/treasure-code/commands/chat) | Quick AI chat interaction |
| [tdx llm](/treasure-code/commands/llm) | Manage LLM projects, agents, and chat sessions |
| [tdx claude](/treasure-code/commands/claude) | Launch Claude Code with TD LLM backend |
| [tdx mcp](/treasure-code/commands/mcp) | Start MCP server for AI coding assistants |


### Context Commands

| Command | Description |
|  --- | --- |
| `tdx use [resource] [value]` | Set session-level context (database, parent_segment, llm_project, profile, engage_workspace) |
| `tdx profiles` | List all available profiles |
| `tdx auth` | Authentication management |
| [tdx user](/treasure-code/commands/user) | User management commands |
| [tdx policy](/treasure-code/commands/policy) | Access control policies and permissions |


### Utility Commands

| Command | Aliases | Description |
|  --- | --- | --- |
| `tdx api [endpoint]` | - | Make raw HTTP requests to TD APIs |
| [tdx upgrade](/treasure-code/commands/upgrade) | - | Upgrade tdx to the latest version |


Plural Forms
Use plural forms as aliases for list commands: `tdx databases`, `tdx tables`, `tdx segments`, `tdx jobs`, etc.

## Global Options

Available for all commands:

### Output Format Options

| Option | Description |
|  --- | --- |
| `--format <format>` | Output format (table, json, jsonl, tsv) |
| `--table` | Output in table format (horizontal layout) |
| `--json` | Output in JSON format |
| `--jsonl` | Output in JSON Lines format |
| `--tsv` | Output in TSV format |
| `--output <file>` | Save output to file |
| `--limit <rows>` | Maximum rows to display (default varies by command) |
| `--color` | Force ANSI color output |
| `--no-color` | Disable ANSI color output |


### Profile and Site Options

| Option | Description | Default |
|  --- | --- | --- |
| `-p, --profile <name>` | Profile to use (overrides active profile) | - |
| `--site <site>` | TD site/region (us01, jp01, eu01, ap02; aliases: us, jp, aws) | us01 |


### Context Override Options

| Option | Description |
|  --- | --- |
| `--parent-segment <name>` | Parent segment to use (overrides context) |
| `--llm-project <name>` | LLM project to use (overrides context) |
| `--session <id>` | Session ID (defaults to `TDX_SESSION` env var or parent PID) |


Database Option
`-d, --database` (and its alias `--in`) is available on commands that use databases: `query`, `show`, `describe`, `table list`, `job schedule create`, and `job schedule update`.

### Logging and Debugging

| Option | Description |
|  --- | --- |
| `-v, --verbose` | Enable verbose logging |
| `--debug` | Enable debug logging (shows HTTP requests/responses) |
| `--trace` | Enable trace logging (ultra-verbose) |


### Directory Option

| Option | Description |
|  --- | --- |
| `-C, --directory <path>` | Change to directory before executing command |


This option is useful for running tdx against different project directories without changing your shell's current directory. Similar to `git -C`.


```bash
# Run tdx in a different project directory
tdx -C /path/to/project databases

# Use project config from another directory
tdx -C ../other-project segment list
```

### Other Options

| Option | Description | Default |
|  --- | --- | --- |
| `--timeout <seconds>` | Set operation timeout | 30 |
| `--dry-run` | Preview operation without executing | - |
| `-y, --yes` | Skip confirmation prompts | - |