Skip to content

CAS Commands

Manage Composable Audience Studio (CAS) resources — zero-copy CDP audiences that run directly on customer Cloud Data Warehouses (Snowflake, Databricks, BigQuery) without moving data into Treasure Data.

Commands

Discovery

CommandDescription
listList composable audiences
descDescribe a composable audience

YAML Sync

CommandDescription
pullPull audience + segments to YAML files
pushPush YAML files to CAS API

Operations

CommandDescription
previewPreview composable segment query on CDW
sg listList composable segments for an audience

Typical Usage

bash
# 1. List composable audiences
tdx cas list

# 2. Pull audience and all segments to YAML files
tdx cas pull "Customer360 Snowflake"
# Creates: cas/customer360-snowflake.yml (audience)
#          cas/high-value-customers.yml (segment)
#          cas/Marketing/newsletter-subs.yml (segment in folder)

# 3. Edit YAML files locally

# 4. Push changes back to CAS API
tdx cas push ./cas/

# 5. Preview a segment query on the CDW
tdx cas preview "High-Value Customers" --audience "Customer360 Snowflake"

Session Context

Set a default composable audience to avoid repeating the name:

bash
tdx use cas "Customer360 Snowflake"

# Now these commands use the context:
tdx cas sg list           # Lists segments for "Customer360 Snowflake"
tdx cas desc              # Describes "Customer360 Snowflake"
tdx cas pull              # Pulls "Customer360 Snowflake"

How It Works

Composable Audiences define customer profiles from tables in your own data warehouse. Unlike Complete CDP audiences (which copy data into Treasure Data), composable audiences query your CDW directly — zero data movement.

Each composable audience has:

  • A master table (the primary customer table in your CDW)
  • Attributes (additional columns joined from other tables)
  • Behaviors (time-series event tables for behavioral segmentation)
  • Segments (filtered subsets using rules/conditions)
  • Activations (exports from segments to external systems)

YAML Format

Audience YAML

yaml
name: Customer360 Snowflake
description: Customer data from Snowflake
timezone: America/New_York
master:
  connection: my-snowflake-connection
  schema: customer_data
  table: customers
  key_column: cdp_customer_id
attributes:
  - name: email_info
    connection: my-snowflake-connection
    schema: customer_data
    table: customers
    join:
      table_key: cdp_customer_id
      master_key: cdp_customer_id
    columns:
      - name: email
        type: string
        column: email_address
behaviors:
  - name: purchase_events
    connection: my-snowflake-connection
    schema: events
    table: purchase_history
    join:
      table_key: customer_id
      master_key: cdp_customer_id
    time_column: event_timestamp
    columns:
      - name: product_id
        type: string
        column: product_sku
      - name: amount
        type: number
        column: purchase_amount

Segment YAML

yaml
type: composable_segment
name: High-Value Customers
description: Customers with > $1000 in purchases
folder: Marketing/Campaigns
rule:
  type: And
  conditions:
    - type: Behavior
      behavior: purchase_events
      aggregation: Sum
      column: amount
      operator: GreaterThanOrEqual
      value: 1000
activations:
  - name: Export to Marketing
    connection: salesforce-connection
    connector_config:
      object: Contact
    columns:
      - name: email
        type: string
    schedule:
      type: daily
      timezone: UTC

Command Reference

list

List all composable audiences.

bash
tdx cas list [options]
OptionDescription
--jsonOutput as JSON
--jsonlOutput as JSON Lines

desc

Describe a composable audience showing master table, attributes, and behaviors.

bash
tdx cas desc [name]

Uses session context if name is omitted (set via tdx use cas or tdx cas pull).

pull

Pull a composable audience and all its segments/activations to local YAML files.

bash
tdx cas pull [name] [options]
OptionDescription
--dir <dir>Target directory for YAML files (default: ./cas/<audience-name>/)
--dry-runShow what would be done without writing files

Uses session context if name is omitted. Also sets composable_audience context for subsequent commands.

The pull command shows diffs for changed files and prompts for confirmation before writing.

push

Push local YAML files to the CAS API.

bash
tdx cas push [target] [options]
OptionDescription
--dry-runShow what would be done without making changes

target can be a file or directory. If omitted, pushes from the current directory. Audience files are pushed first, then segments and activations.

preview

Preview a composable segment query by running it on the CDW.

bash
tdx cas preview <segment_name> [options]
OptionDescription
--audience <name>Composable audience name (or use session context)

sg list

List composable segments for an audience.

bash
tdx cas sg list [audience_name]

If audience_name is omitted, uses the session context set by tdx use cas.

CAS vs Complete CDP

AspectComplete (tdx ps / tdx sg)Composable (tdx cas)
Data locationTD PlazmaDBCustomer's Snowflake/Databricks/BigQuery
Source referencedatabase + tableconnection + schema + table
Query enginePresto/Trino on TDDirect SQL on CDW
Activationssyndications with connectionIdcomposable_activations with CDW-specific export
API prefix/audiences/, /entities/segments//composable_audiences/, /entities/composable_segments/