HENGSHI CLI
Overview
HENGSHI CLI is the official command-line tool from HENGSHI and the unified command entrypoint for both humans and AI agents. It turns actions that used to live in UI clicks, ad-hoc scripts, or private API calls into stable, reviewable, and automatable command workflows.
Its current coverage includes:
- Data connections and dataset onboarding
- HQL / HE queries and data preview
- Dashboard, report, and element creation / configuration
- Permission lookup, grant, and revoke flows
- System configuration, environment checks, and operational tasks
- Agent execution workflows powered by official skills
NOTE
Starting with 2.0.0, the public command name is hbi, and this documentation uses hbi plus HBI_* as the primary namespace. To avoid confusion, this page does not document legacy naming/compatibility details; follow the behavior of your installed package and upgrade scripts if you still have older names in your environment.
The bridge between HENGSHI SENSE and agents
HENGSHI CLI does not replace the HENGSHI SENSE UI. Its role is to turn core HENGSHI SENSE capabilities into a stable command interface that people and agents can call, review, and reuse. It works for direct terminal users as well as OpenClaw, CI jobs, and automation scripts.
In that chain, the common split looks like this:
| Layer | Role | Typical responsibility |
|---|---|---|
| Human | Task owner and reviewer | Provide intent, approve boundaries, review outcomes |
| Agent / automation flow | Orchestration layer | Break work into steps, sequence actions, and decide which command to call next |
| HENGSHI CLI + skills | Bridge and execution layer | Translate HENGSHI SENSE capabilities into structured commands, outputs, and --dry-run previews |
| HENGSHI SENSE backend | Capability layer | Actually perform connection, query, modeling, authorization, and delivery actions |
If you are designing reusable workflows for OpenClaw or other agents, CLI is usually the bridge itself: it connects agent-side orchestration with real HENGSHI SENSE capabilities instead of forcing the agent to guess UI paths or assemble private APIs on its own.
What problems CLI is good at solving
| Scenario | What CLI brings |
|---|---|
| Letting an agent perform BI delivery tasks | One command model and one output contract instead of “every agent invents its own API calls” |
| Putting risky changes into review flows | --dry-run lets you inspect changes before execution |
| Returning results to humans or downstream systems | json / yaml / table outputs are easier to read, record, and post-process |
| Building repeatable operational workflows | Local terminals, CI, background services, and agent runtimes can all reuse the same commands |
| Surfacing out-of-browser changes back into the UI | SSE and the Autopilot indicator provide a realtime feedback bridge |
Command surface at a glance
HENGSHI CLI is not a single-purpose tool. It is a command tree aligned with the main BI delivery chain.
| Command domain | What it covers | Example |
|---|---|---|
app | Applications, spaces, portals, shared dimensions | hbi app list --area personal-area --root |
dataset | Dataset onboarding and listing | hbi dataset list --app 4812 --output json |
data-model | HQL / HE querying and data preview | hbi data-model query --app 4812 --dataset 3 "SUM({amount})" |
dashboard | Dashboards, reports, and themes | hbi dashboard create --app 4812 "Regional Sales Cockpit" |
element | Charts, filters, containers, buttons, iframes, and more; supports custom titles and content recognition (link/email/image) flags | hbi element chart create --dashboard 2048 --app 4812 --dataset 3 table --identify-link true --identify-email true --identify-image true |
connection | Data source connection management | hbi connection list |
authorize | Unified authorization API | hbi authorize grant app 42 --user 123:editor --dry-run |
preferences | System configuration inspection and previewed updates | hbi preferences everest --output json |
HQL expression support
The --dimension, --measure, and --where flags accept HQL (HENGSHI Query Language) expressions, not just plain field names.
- Time bucketing: Prefer calendar HQL functions (e.g.,
day(),month(),trunc_month()) over string-slicing patterns likesubstring/date_format - Cross-period functions: HQL also provides
moy(),dom(),dow(),doy(),woy(),qoy()for cross-period time aggregation — semantically equivalent to the UI options like "Month (cross-year)" and "Day (cross-month)" - Expression validation: Use
hbi dataset expression-rewriteto validate and rewrite expressions
See element chart create --dimension for details.
Official skills and agent execution
CLI is delivered together with official bundled skills. Official skills are typically organized by capability domain; when documenting them, prefer showing both the skill names and the responsibility summary:
hbi-core: authentication, configuration, output, and terminology ruleshbi-data,hbi-data-modeling,hbi-pipeline,hbi-notebook: connections, datasets, modeling, execution, and metric workflowshbi-dashboard,hbi-dashboard-taste,hbi-app: dashboard planning, page layout, element configuration, and app surfaceshbi-permission,hbi-user-mgmt: access lookup, grant/revoke flows, and user/organization governancehbi-workflow: cross-domain orchestration and sequencing control
The purpose of these skills is not to replace CLI. They encode execution experience such as which state should be read first, which actions must go through --dry-run, and how results should be returned to people or other systems.
Recommended reading path
If you are new to HENGSHI CLI, read in this order:
- Installation & Upgrade
- Authentication & Connection
- Agent Integration & Skills
- Common Workflows
- Command Reference
- Realtime Sync & Autopilot
- Troubleshooting & FAQ
Recommendation
If your goal is to let an agent execute stable actions instead of typing commands manually, start with Agent Integration & Skills and Common Workflows.