finebi-cli
v0.2.26
Published
Command-line tools for FineBI data analysis, exports, and dashboard workflows.
Downloads
1,702
Maintainers
Readme
finebi-cli
finebi-cli is the publishable CLI package in this monorepo. It provides command-line access to FineBI data analysis, exports, and dashboard workflows.
Quick Start
npm install -g finebi-cli
finebi-cli init
finebi-cli search-public-dataset -k "Sales"Package contents
- CLI executable:
finebi-cli - Published files:
dist,README.md,.env.example
Configuration
The CLI reads these environment variables:
FINEBI_BASE_URLFINE_ACCESS_TOKEN
You can create them with finebi-cli init or by writing a .env file manually.
By default:
finebi-cli initwrites to~/.finebi-cli/.env- the CLI reads
.envin this order:- current working directory
~/.finebi-cli/.env- package-local development fallbacks
This means:
- user-level config works from any directory
- a project-local
.envcan still override it when needed
There are two common setup patterns:
- Standalone CLI usage
finebi-cli initThis writes config to ~/.finebi-cli/.env, and the CLI can then be used from any directory.
- Running inside a host such as OpenClaw
- the user can configure
FINEBI_BASE_URLandFINE_ACCESS_TOKENin the host tool's.env - if the host injects those variables into the
finebi-cliprocess, the CLI will use them automatically - in that case,
finebi-cli initis optional rather than required
Release checks
Before publishing this package, run:
pnpm test
pnpm typecheck
pnpm build
pnpm packRelease note
finebi-cliconsumesfinebi-querydata-sdkas a normal npm dependency at publish time.- In this workspace the dependency is declared as
workspace:*, butpnpm packandpnpm publishrewrite it to the current published SDK version range. - If the CLI depends on a new SDK release, publish
finebi-querydata-sdkfirst and then publishfinebi-cli.
Available CLI commands
initget-entry-treeget-published-subject-resourcessearch-my-datasetssearch-my-dashboardsget-publick-datasets-listsearch-public-datasetpreview-dataset-dataget-widget-dataresolve-dashboard-widgetsexport-dashboard-excelexport-dashboard-pdfexport-dashboard-imageget-dashboard-user-infoget-dashboards-by-subjectget-dashboard-design-configure
Run finebi-cli <command> --help for command-specific options.
resolve-dashboard-widgets
List all data widgets in a dashboard with their widgetId and display name:
finebi-cli resolve-dashboard-widgets -d <dashboardId>Use the returned widgetId with get-widget-data.
get-widget-data
Basic usage:
finebi-cli get-widget-data -r <dashboardId> -w <widgetId>Optional dashboard-state inputs in the same SDK lifecycle:
finebi-cli get-widget-data \
-r <dashboardId> \
-w <widgetId> \
--filter '{"widgetId":"filterWidget","value":{"type":1,"value":["华东"]}}' \
--linkage '{"widgetId":"sourceWidget","payload":{"dId":"area","fieldId":"field1","text":"华东","value":[{"dId":"area","fieldId":"field1","text":"华东"}]}}'--filterapplies one filter payload before querying the target widget--linkageapplies one linkage payload before querying the target widget
