Quick Start
Get up and running with Strata CLI in minutes.
Prerequisites
- Ruby 3.4.4+ installed
- Git installed
Install
gem install strata-cli
Workflow
1. Initialize a Project
Create a new Strata project directory with configuration files.
strata init PROJECT_NAME
PROJECT_NAME— Name of your project (creates a directory with this name)
Example:
strata init sales-analytics
# Creates a new project directory called "sales-analytics"
cd sales-analytics
2. Add a Datasource
Connect your project to a database.
strata datasource add ADAPTER
ADAPTER— Database type:postgres,snowflake,mysql,duckdb,athena,trino,sqlserver,druid
Example:
strata datasource add postgres
# Prompts for connection details and adds a PostgreSQL datasource
3. Test Datasource Connection
Verify the datasource connects successfully.
strata datasource test DATASOURCE_KEY
DATASOURCE_KEY— The key you assigned when adding the datasource
Example:
strata datasource test warehouse
# Tests connection to the datasource named "warehouse"
4. Create a Table Model
Generate a semantic table model from a physical database table.
strata create table PATH/TABLE_NAME
PATH— Folder path within models/ (e.g.,common,store,catalog)TABLE_NAME— Name for the semantic table model
Example:
strata create table common/customers
# Creates models/common/tbl.customers.yml
5. Create a Relationship
Define how tables join together.
strata create relation PATH/RELATION_NAME
PATH— Folder path within models/RELATION_NAME— Name for the relationship file
Example:
strata create relation store/sales
# Creates models/store/rel.sales.yml
6. Audit the Model
Validate your semantic model before deployment.
strata audit
Example:
strata audit
# Checks YAML syntax, table definitions, relationships, and datasource connectivity
7. Deploy
Push your semantic model to the Strata server.
strata deploy
Example:
strata deploy
# Uploads validated model to your Strata server instance
Command Reference
| Command | Syntax | Description |
|---|---|---|
| init | strata init PROJECT_NAME | Initialize a new project |
| datasource add | strata datasource add ADAPTER | Add a datasource connection |
| datasource test | strata datasource test DATASOURCE_KEY | Test datasource connectivity |
| datasource tables | strata datasource tables DATASOURCE_KEY | List tables in datasource |
| datasource meta | strata datasource meta DATASOURCE_KEY TABLE | Show table schema |
| create table | strata create table PATH/TABLE_NAME | Create a semantic table model |
| create relation | strata create relation PATH/RELATION_NAME | Create a relationship file |
| table list | strata table list | List defined table models |
| audit | strata audit | Validate semantic model |
| deploy | strata deploy | Deploy to Strata server |
Next Steps
- Tutorial — Hands-on walkthrough with TPC-DS
- CLI Reference — Detailed command documentation
- Concepts — Understand the semantic layer