npx claudepluginhub oxy-hq/airlayer --plugin airlayerThis skill is limited to using the following tools:
You are compiling a semantic layer query to SQL using the `airlayer` CLI.
Generates SQL queries from natural language for PostgreSQL, MySQL, BigQuery, Snowflake. Reads schemas from diagrams/docs for reports, exploration, business queries.
Guides creation and modification of dbt Semantic Layer YAML configs for semantic models, metrics, dimensions, entities, and time spines in latest or legacy specs.
Inspects semantic layer views, dimensions, measures, and entities in .view.yml files using airlayer CLI. Useful for exploring available schema before building queries.
Share bugs, ideas, or general feedback.
You are compiling a semantic layer query to SQL using the airlayer CLI.
Ensure airlayer is installed:
which airlayer || cargo install --git https://github.com/oxy-hq/airlayer
.view.yml files in the project. They are typically under a views/ or semantics/views/ directory.views/).find . -name "*.view.yml" -not -path "*/node_modules/*" -not -path "*/cube/*" 2>/dev/null | head -20
Before building a query, inspect what's available:
airlayer inspect```
This lists all views, dimensions, measures, and entities.
## Build and run the query
Use CLI flags (preferred for LLM tool use):
```bash
airlayer query -d <dialect> \
--dimension <view.dimension> \
--measure <view.measure> \
--filter <view.dimension>:<operator>:<value> \
--order <view.member>:desc \
--limit 100
Or JSON input for complex queries:
airlayer query -d <dialect> -q '{
"dimensions": ["view.dimension"],
"measures": ["view.measure"],
"filters": [{"member": "view.dim", "operator": "equals", "values": ["val"]}],
"order": [{"id": "view.measure", "desc": true}],
"limit": 100
}'
$ARGUMENTS
Pick the dialect based on the project's database:
postgres (default), mysql, bigquery, snowflake, duckdb, clickhouse, databricks, redshift, sqlite, domoIf the project has a config.yml with database definitions, use -c config.yml instead of -d.
equals, notEquals, contains, notContains, startsWith, notStartsWith, endsWith, notEndsWith, gt, gte, lt, lte, set, notSet, inDateRange, notInDateRange, beforeDate, beforeOrOnDate, afterDate, afterOrOnDate, onTheDate
--segments view.segment_name (predefined filter conditions)--through entity_name (disambiguate multi-path joins)"time_dimensions": [{"dimension": "view.date_col", "granularity": "month", "date_range": ["2024-01-01", "2024-12-31"]}]"date_range": ["last 7 days"] or ["this month"]"ungrouped": true for raw rows without aggregationairlayer prints the generated SQL to stdout and params to stderr. Show the SQL to the user.