Skip to content

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. role contains 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: types list show test create delete update
  • internal auth rules: auth-rules auth-rule-get auth-rule-create auth-rule-update auth-rule-delete
  • inheritance control: auth-inherit-get auth-inherit-update
  • browsing and query: browse query

Minimal runnable example:

bash
hbi connection list --output json

Representative output:

json
[
  {
    "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:

bash
# 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 yaml

Each --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: list show update replace delete duplicate import
  • preview and state: preview status schedule lineage export
  • knowledge enhancement: knowledge example
  • creation paths: create create-from-file upload create-custom-sql create-api create-reference
  • transformation flows: create-union create-fusion create-aggregate create-pivot create-unpivot
  • fields and expressions: fields expression-rewrite column-create column-update column-delete
  • field supplements: column-values column-geo column-geo-role column-geo-role-reset
  • granularities: granularity-list granularity-create granularity-update granularity-delete

Minimal runnable example:

bash
hbi dataset list --app 4812 --output json

Representative output:

json
[
  {
    "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:

  • list show preview query
  • lineage tree
  • suggest-joins
  • join-add join-list join-delete

Minimal runnable example:

bash
hbi data-model query --app 4812 --dataset 3 "SUM({amount})" --output json

Representative output:

json
{
  "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:

  • create delete update
  • list show
  • query

Minimal runnable example:

bash
hbi metric list --app 4812 --dataset 3 --output json

Representative output:

json
[
  {
    "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:

  • create delete update
  • list show
  • query

Minimal runnable example:

bash
hbi measure list --app 4812 --dataset 3 --output json

The 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.

bash
hbi measure show --app 4812 --dataset 3 "Monthly Paid Sales" --output json

When 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 with AND.
  • -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 are year, qoy, quarter, moy, month, week, dom, dow, and day.

--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.

bash
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-dimensions

Representative output:

json
[
  {
    "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: list show create update delete duplicate
  • runtime state: status errors schedule
  • node read/write entrypoints: node edit

Minimal runnable example:

bash
hbi pipeline list --output json

Representative output:

json
[
  {
    "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:

  • add
  • remove
  • connect

notebook ​

Purpose: manage notebooks, paragraphs, and execution-related resources.

Common subcommands:

  • notebook lifecycle: list show create update delete
  • paragraphs: paragraphs add-paragraph update-paragraph execute delete-paragraph
  • connections: connections add-connection authorize-connection revoke-connection remove-connection
  • other: schedule languages

Minimal runnable example:

bash
hbi notebook list --output json

Representative output:

json
[
  {
    "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:

  • list show
  • create update delete
  • enable disable
  • validate

Minimal runnable example:

bash
hbi data-alert list 4812 --output json

Representative output:

json
[
  {
    "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:

  • list show
  • create update delete
  • setting get setting update (only the entry switch status may change: OPEN / CLOSED)
  • data (query submitted rows per template; supports --offset / --limit / --order-by / --order-type)

Minimal examples:

bash
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 json

Multiple choice control (checkboxInput):

  • options.items must be a non-empty, duplicate-free array of strings without leading or trailing spaces; option text may contain commas.
  • options.styleType is checkbox or select; options.layout is vertical or horizontal.
  • 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:

  • config
  • prompt
  • vector

Minimal runnable example:

bash
hbi data-agent config get --output json

Representative output:

json
{
  "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 ​

ScenarioStart with
data connections, schema browsing, and connectivity checksconnection
dataset lifecycle, preview, fields, and granularitiesdataset
joins and model queriesdata-model
pipeline resourcespipeline
node add/remove/connect operationspipeline edit
notebooks, paragraphs, and connectionsnotebook
alert definitions and enable/disable actionsdata-alert
Data Agent config, prompts, and vector statedata-agent

When you need exact flags and examples, use that command tree's --help in the terminal.

User Manual for Hengshi Analysis Platform