Data & Execution Commands
This page covers data onboarding, modeling, metrics, execution, and AI-related capabilities. It aligns most closely with the hbi-data, hbi-data-modeling, hbi-pipeline, hbi-notebook, hbi-data-alert, and hbi-data-agent skills. Each command family includes a minimal runnable example and representative output so you can start with a concrete command immediately.
HQL Expressions
Commands on this page — including data-model query, metric, and measure — make extensive use of HQL (Hengshi Query Language) expressions for aggregations, calculated fields, and query conditions. HQL supports aggregation functions (SUM, AVG, COUNT), time functions (YEAR, MONTH, PERIODCOMPARE), and conditional logic. See the full HQL Function Reference.
In Sense 7.0, role syntax is supported only in data packages with automatic modeling (
modelingType=AUTO):{{dataset_id}}[role].{field}. Roles have no meaning in manual modeling (MANUAL) or other contexts; do not rely on them to distinguish relationships.rolecontains 1–64 UTF-16 code units of Unicode letters, numbers, or underscores. It distinguishes roles for the same physical field; it does not ask the CLI to infer roles or plan joins, and the server validates applicability.
connection
Purpose: manage data connections, browse schemas/tables, and test connectivity.
Common subcommands:
- connection lifecycle:
typeslistshowtestcreatedeleteupdate - internal auth rules:
auth-rulesauth-rule-getauth-rule-createauth-rule-updateauth-rule-delete - inheritance control:
auth-inherit-getauth-inherit-update - browsing and query:
browsequery
Minimal runnable example:
hbi connection list --output jsonRepresentative output:
[
{
"id": 39774,
"title": "analytics-db",
"accessCount": 273,
"options": {
"type": "postgresql",
"maxConnNum": 10,
"metaConfig": {
"dbMajorVersion": 13,
"dbMinorVersion": 11,
"dbProductName": "PostgreSQL"
}
},
"createdAt": "2022-10-27 13:54:24",
"visible": true
}
]Common next steps:
- Show connection details:
hbi connection show 39774 --output json - Test connectivity:
hbi connection test 39774 - Browse schemas/tables:
hbi connection browse 39774 --output json
Browse by schema/path:
# List schema/path levels only
hbi connection browse 39774 --schemas --output json
# List every table under the exact public schema
hbi connection browse 39774 --schema public --output json
# Repeat --schema for a multi-level path; --query filters only within the selected subtree
hbi connection browse 39774 --schema hive --schema default --query orders --output yamlEach --schema supplies one path segment. Repeat it to preserve segment order. Do not join a multi-level path as catalog.schema, because segment names can contain dots. Combining --schema with --query uses AND semantics. Without --schema, --query keeps its existing fuzzy name filter.
dataset
Purpose: manage datasets, fields, granularities, previews, and import/export.
Common subcommands:
- lifecycle:
listshowupdatereplacedeleteduplicateimport - preview and state:
previewstatusschedulelineageexport - knowledge enhancement:
knowledgeexample - creation paths:
createcreate-from-fileuploadcreate-custom-sqlcreate-apicreate-reference - transformation flows:
create-unioncreate-fusioncreate-aggregatecreate-pivotcreate-unpivot - fields and expressions:
fieldsexpression-rewritecolumn-createcolumn-updatecolumn-delete - field supplements:
column-valuescolumn-geocolumn-geo-rolecolumn-geo-role-reset - granularities:
granularity-listgranularity-creategranularity-updategranularity-delete
Minimal runnable example:
hbi dataset list --app 4812 --output jsonRepresentative output:
[
{
"id": 3,
"title": "Sales Order Detail",
"appId": 4812,
"connectionId": 39774,
"createdAt": "2025-01-10 09:00:00",
"updatedAt": "2026-05-20 16:30:00",
"status": "ready"
}
]Common next steps:
- Preview rows:
hbi dataset preview --app 4812 --dataset 3 --limit 10 --output json - Show fields:
hbi dataset fields --app 4812 --dataset 3 --output json - Show dataset status:
hbi dataset status --app 4812 --dataset 3 --output json
data-model
Purpose: manage data models and joins.
Sense 7.0 AUTO data apps
First inspect the top-level modelingType with hbi app show <app_id> --output json. Treat a missing or null value in an older response as MANUAL. A MANUAL model continues to use the relation dataset IDs exposed by its relation model. An AUTO data app queries all physical datasets and their fields, uses their real dataset IDs, and excludes extension datasets.
Charts and metrics in an AUTO data package can reference any dataset in the package. In a MANUAL data package, they can reference only the main table and related tables in an existing data model. The server still validates and infers AUTO cross-dataset relationships through common dimensions.
For an AUTO query, a bare field first matches the base dataset. If it does not match the base and exactly one other physical dataset matches, the CLI qualifies it with that physical ID. When several candidates exist, write {{dataset_id}}.{field} explicitly. Existing dataset or role qualifications are retained, and the server validates scope. AUTO does not use or accept client-side join planning; manual join writes do not apply to this mode.
Data Agent / headless ChatBI uses the same hbi data-model query path. When selecting an AUTO data package's scope in ChatBI, choose physical datasets, not relation datasets with options.type=extend; do not expand manual relations with context --relation / --delta or create manual joins. For AUTO, hbi chatbi model-candidates lists only role=physical_dataset candidates, and both the candidate list and dataset context return modelingType and AUTO guidance. Read context separately for relevant physical datasets within the current conversation's authorized scope, then query with their real physical IDs. Do not write or override datasetIds in queries, compose, or subsequent authoring; the server derives it. The ability to reference datasets in the same package does not expand delegated scope or user permissions.
Use data-model query --capability --output json to inspect the effective modeling mode and available physical references. Server connectivity errors, including 10390 and 10391, remain on the existing API error surface.
Common subcommands:
listshowpreviewquerylineagetreesuggest-joinsjoin-addjoin-listjoin-delete
Minimal runnable example:
hbi data-model query --app 4812 --dataset 3 "SUM({amount})" --output jsonRepresentative output:
{
"result": [
{
"SUM({amount})": 1234567.89
}
],
"executionTime": 234
}Common next steps:
- Group by dimension:
hbi data-model query --app 4812 --dataset 3 "SUM({amount})" --by "group({region})" --output json - Show the model tree:
hbi data-model tree --app 4812 --dataset 3 --output json - Ask for suggested joins:
hbi data-model suggest-joins --app 4812 --dataset 3 --output json
metric
Purpose: manage atomic metrics.
Common subcommands:
createdeleteupdatelistshowquery
Minimal runnable example:
hbi metric list --app 4812 --dataset 3 --output jsonRepresentative output:
[
{
"id": 101,
"name": "Total Sales",
"expression": "SUM({amount})",
"datasetId": 3,
"createdAt": "2025-02-10 10:00:00"
}
]Common next steps:
- Show metric details:
hbi metric show --app 4812 --dataset 3 c1 --output json - Query metric data:
hbi metric query --app 4812 --dataset 3 c1 --output json
measure
Purpose: manage business measures.
Common subcommands:
createdeleteupdatelistshowquery
Minimal runnable example:
hbi measure list --app 4812 --dataset 3 --output jsonThe final argument to measure show can be a measure field name such as m1 or a display label such as Monthly Paid Sales. For a label, the CLI requires an exact match within the selected dataset. If the label matches more than one measure, the command lists the candidate field names so you can retry with one of them. measure update and measure delete continue to accept field names only.
hbi measure show --app 4812 --dataset 3 "Monthly Paid Sales" --output jsonWhen creating or updating a business measure, you can also define its filters and time axis. An update can additionally replace or clear its analysis dimensions:
-w, --where <HQL>: an HQL filter expression; repeat the option to combine multiple expressions withAND.-D, --dimension <FIELD_OR_LABEL>: replace the analysis dimensions. Repeat the option or use a comma-separated value. Field names take precedence; labels use exact matching.--clear-dimensions: clear all analysis dimensions. This option conflicts with--dimension.--time-dimension <FIELD>: the field used as the time axis.--time-granularity <GRANULARITY>: the time granularity. Supported values areyear,qoy,quarter,moy,month,week,dom,dow, andday.
--time-dimension and --time-granularity must be provided together. When measure update explicitly sets filters or a time axis, the measure uses that custom analysis context instead of its existing dataset granularity configuration.
In Sense 7.0, role semantics in metric expressions and HQL formulas such as --where apply only to AUTO data packages, for example {{2}}[buyer].{amount}; roles have no meaning in other contexts. measure --dimension and --time-dimension write stored field keys: for a cross-dataset field, use explicit {{dataset_id}}.{field} without a [role] suffix. They do not auto-resolve bare fields across datasets.
hbi measure create --app 4812 --dataset 3 \
--label "Monthly Paid Sales" \
--expression "SUM({amount})" \
--where "{status} = 'paid'" \
--time-dimension order_date \
--time-granularity month
hbi measure update --app 4812 --dataset 3 m1 \
--dimension region \
--dimension "Product Category,Order Date" \
--where "{amount} > 0" \
--time-dimension order_date \
--time-granularity day
hbi measure update --app 4812 --dataset 3 m1 --clear-dimensionsRepresentative output:
[
{
"id": 201,
"name": "Monthly Sales Growth Rate",
"expression": "PERCENTCHANGE(SUM({amount}), month({date}))",
"datasetId": 3,
"createdAt": "2025-03-15 11:00:00"
}
]Common next steps:
- Show measure details:
hbi measure show --app 4812 --dataset 3 m1 --output json - Search measures:
hbi measure query --app 4812 --query "sales" --output json
pipeline
Purpose: manage pipeline flows and nodes.
Common subcommands:
- pipeline lifecycle:
listshowcreateupdatedeleteduplicate - runtime state:
statuserrorsschedule - node read/write entrypoints:
nodeedit
Minimal runnable example:
hbi pipeline list --output jsonRepresentative output:
[
{
"id": 450,
"title": "Daily Aggregation",
"createdAt": "2025-04-01 08:00:00",
"updatedAt": "2026-05-25 10:00:00",
"status": "success"
}
]Common next steps:
- Show pipeline details:
hbi pipeline show 450 --output json - Show runtime status:
hbi pipeline status 450 --output json - Edit nodes:
hbi pipeline edit add 450 --help
edit is the most common deeper entrypoint, with:
addremoveconnect
notebook
Purpose: manage notebooks, paragraphs, and execution-related resources.
Common subcommands:
- notebook lifecycle:
listshowcreateupdatedelete - paragraphs:
paragraphsadd-paragraphupdate-paragraphexecutedelete-paragraph - connections:
connectionsadd-connectionauthorize-connectionrevoke-connectionremove-connection - other:
schedulelanguages
Minimal runnable example:
hbi notebook list --output jsonRepresentative output:
[
{
"id": 350,
"title": "Data Analysis Notes",
"createdAt": "2025-05-10 14:00:00",
"updatedAt": "2026-06-01 09:30:00"
}
]Common next steps:
- Show notebook details:
hbi notebook show 350 --output json - List paragraphs:
hbi notebook paragraphs 350 --output json - Execute one paragraph:
hbi notebook execute 350 para_123
data-alert
Purpose: manage data alerts.
Common subcommands:
listshowcreateupdatedeleteenabledisablevalidate
Minimal runnable example:
hbi data-alert list 4812 --output jsonRepresentative output:
[
{
"id": 520,
"title": "Daily Sales Alert",
"enabled": true,
"createdAt": "2025-06-01 10:00:00"
}
]Common next steps:
- Show alert details:
hbi data-alert show 4812 520 --output json - Enable the alert:
hbi data-alert enable 4812 520 - Disable the alert:
hbi data-alert disable 4812 520 --dry-run
survey
Purpose: manage data-entry form templates and the data submitted through them.
Common subcommands:
listshowcreateupdatedeletesetting getsetting update(only the entry switchstatusmay change:OPEN/CLOSED)data(query submitted rows per template; supports--offset/--limit/--order-by/--order-type)
Minimal examples:
hbi survey list --output json
hbi survey show 12 --output json
hbi survey setting get 12 --output json
hbi survey data 12 --limit 20 --order-by createdAt --order-type desc --output jsonMultiple choice control (checkboxInput):
options.itemsmust be a non-empty, duplicate-free array of strings without leading or trailing spaces; option text may contain commas.options.styleTypeischeckboxorselect;options.layoutisverticalorhorizontal.- Submitted values are a string array; a JSON array string is also accepted. Values are stored as a JSON array string, for example
["R&D","Operations"]. - Batch import uses the same format for multiple choice columns; an empty selection is stored as
NULL.
Typical next actions:
- Change the entry switch:
hbi survey setting update 12 --value '{"status":"CLOSED"}' --output json - Inspect the control definition:
hbi survey show 12 --output json
data-agent
Purpose: manage Data Agent / ChatBI backend configuration.
Common subcommands:
configpromptvector
Minimal runnable example:
hbi data-agent config get --output jsonRepresentative output:
{
"enabled": true,
"model": "gpt-4",
"basePrompt": "You are a data analysis assistant",
"updatedAt": "2026-05-30 16:00:00"
}Common next steps:
- List prompts:
hbi data-agent prompt list --output json - Show vector status:
hbi data-agent vector status --output json
Where to drill down next
| Scenario | Start with |
|---|---|
| data connections, schema browsing, and connectivity checks | connection |
| dataset lifecycle, preview, fields, and granularities | dataset |
| joins and model queries | data-model |
| pipeline resources | pipeline |
| node add/remove/connect operations | pipeline edit |
| notebooks, paragraphs, and connections | notebook |
| alert definitions and enable/disable actions | data-alert |
| Data Agent config, prompts, and vector state | data-agent |
When you need exact flags and examples, use that command tree's --help in the terminal.