Skip to main content

CLI Reference

CLI commands

Authentication

wren auth login

Prompts for Organization ID, API Key, and optional API endpoint. Credentials are stored in ~/.wrenai/wrenrc.yaml.

wren auth status

Show current login status.

wren auth logout

Remove the saved credentials.

DBT import

Plan support

DBT integration is available on Essential / Business plans and above.

warning

Updating replaces the current MDL in your Wren AI project with those generated from your dbt models. Any manual changes made in Wren AI will be overwritten.

Create a new Wren AI project from a dbt project:

wren dbt create

Update an existing linked project (referenced in .wrenconfig):

wren dbt update --dbt-path /path/to/dbt-project

Skip confirmation:

wren dbt update --dbt-path /path/to/dbt-project --yes

Metadata Sync

Sync table and column descriptions from YAML files to your Wren AI project.

wren metadata sync --config /path/to/config-file.yaml

Or use interactive mode:

wren metadata sync --project-id <project-id> 

Skip confirmation:

wren metadata sync --config /path/to/config-file.yaml  --yes 

DBT project Configuration files

.wrenconfig (project-level)

Created by wren dbt create in the root of your dbt project. Used by wren dbt update to locate and update the linked Wren AI project.

Typical contents:

# .wrenconfig
wren_project:
id: "783" # Wren AI Cloud Project ID
last_synced: "2025-10-09T10:28:07.006Z" # Last sync time

Notes:

  • Commit this file to your dbt repository so collaborators can run wren dbt update.

wrenrc.yaml (user-level)

Written to ~/.wrenai/wrenrc.yaml after wren auth login. Stores your local authentication and defaults.

Typical contents:

# ~/.wrenai/wrenrc.yaml
wren_profiles:
org_id: "5" # Your Organization ID
apikey: osk-xxx # Your API key
endpoint: https://cloud.getwren.ai/api/ # API endpoint

Notes:

  • This file is user-specific; do not commit it.

Metadata configuration files

metadata-config.yaml

The metadata-config.yaml file defines how the wren metadata sync command scans and interprets your local YAML files to synchronize metadata (such as table and column descriptions) with your Wren AI project.

Typical contents:

# metadata-config.yaml

# Path or glob pattern to locate your metadata files.
# Can point to a single file, a directory, or use glob patterns.
file_path: "./metadata/*.yaml"

# (Optional) Limit included files when scanning a directory.
include_patterns:
- "*.yaml"
- "*.yml"

# (Optional) Exclude specific files or patterns.
exclude_patterns:
- "*.backup.yaml"
- "deprecated_*.yaml"

# Wren AI target project to sync with.
target_project_id: "123"

# Mapping rules for how metadata is extracted from YAML files.
description_property_name: "purpose" # Field for table description
columns_property_name: "columns" # Field listing columns
column_description_property_name: "description" # Field for column descriptions

table_name_property: "metadata.schema_name"

Example metadata YAML (referenced by metadata-config.yaml)

# customers.yaml
metadata:
schema_name: test.customers
purpose: Customer data table

columns:
- name: customer_id
type: string
description: "Unique customer identifier."

- name: customer_name
type: string
description: "Customer’s full name."

- name: customer_address
type: string
description: Customer address

TL;DR Using the above metadata-config.yaml and customers.yaml as an example:

the CLI will:

  • Scan all files matching ./metadata/*.yaml.
  • Read the example file (customers.yaml) that matches the glob pattern.
  • Extract table name from metadata.schema_name (as defined by table_name_property in metadata-config.yaml) → test.customers.
  • Read table description from the purpose (as defined by description_property_name in metadata-config.yaml) field → "Customer data table".
  • Find columns under the columns(as defined by columns_property_name in metadata-config.yaml) list.
  • For each column, map the description(as defined by column_description_property_name in metadata-config.yaml) field as the column description (e.g., "Unique customer identifier.").