@bolineyecare/cli
v0.2.0
Published
Unified Bolin command-line interface for external services
Downloads
254
Maintainers
Readme
Bolin CLI
bolin is the unified command-line entry for Bolin external services.
bolin agent is the HTTP/SSE client for Bolin Agent Service, while
bolin knowledge bridges external knowledge sources into RAGFlow.
Install
Node.js 22 or newer is required.
npm install --global @bolineyecare/cli
bolin agent --helpUsage
bolin agent configure --endpoint https://agents.example.com --key bas_xxx
bolin agent invoke <agent-id> "分析当前告警"
bolin agent invoke <agent-id> --session <session-id> "继续分析日志"
bolin agent invoke <agent-id> --stream "执行巡检"
bolin agent status <invocation-id>
bolin agent cancel <invocation-id>
bolin agent session close <session-id>
bolin agent invoke <agent-id> --input-file request.json --output json --request-id workflow-step-1Output
All domains share the same presentation contract:
- The default
humanoutput is a compact operational summary. --verboseadds diagnostic identifiers and item-level details without changing the command result.--output humanexplicitly selects the default human presentation.--output jsonwrites the complete machine-readable result to stdout.- Interactive progress and verbose stream context use stderr, so redirected JSON and streamed response content remain clean.
Agent synchronous commands use the shared summary layout. Streaming Agent
invocations still write response text directly to stdout; --verbose adds the
invocation context on stderr instead of mixing it into the response.
WeCom Drive to RAGFlow
In WeCom Desktop, open the member-created source space, select its top-level contents, and choose Download and sync. Keep WeCom running until the local sync finishes, then configure that local directory:
export BOLIN_WECOM_SYNC_DIR='/absolute/path/to/the/synced/folder'
export BOLIN_RAGFLOW_ENDPOINT=https://rag.bolineyecare.com
export BOLIN_RAGFLOW_API_KEY=ragflow-xxx
export BOLIN_RAGFLOW_DATASET_ID=dataset_xxx
bolin knowledge configure wecom-ragflow --profile production
bolin knowledge sync wecom-ragflow --profile production --dry-run
bolin knowledge sync wecom-ragflow --profile productionThis path does not require a WeCom Corp ID, app Secret, or space ID. WeCom Desktop keeps the source directory current; the CLI recursively hashes its ordinary local files, uploads changed content to the configured RAGFlow dataset, starts parsing, and waits for terminal parse status. An unchanged content hash is skipped. A changed file replaces its old RAGFlow document only after the new version parses successfully.
When stderr is connected to a terminal, sync shows live Files and Parsing
progress followed by a compact human summary. Use --verbose for per-file
details. Use --output human to select the default presentation explicitly;
--output json remains the complete machine-readable result on stdout.
Source deletions are not propagated. Symbolic links and local metadata files
such as .WeDrive are skipped. See
docs/bolin-cli/wecom-ragflow.md for
setup, limits, and operational behavior.
Configuration is stored as versioned, profile-aware JSON-compatible YAML at
~/.config/bolin/config.yaml. Existing flat Agent configuration remains
readable and is migrated on the next configure operation. BOLIN_ENDPOINT and
BOLIN_SERVICE_KEY override saved Agent values. Exit codes are stable: 0 success,
1 service/general failure, 2 usage/configuration, 3 authentication or
authorization, 4 not found, 5 conflict/quota, and 6 network failure.
The service key is written to a user-only configuration file. Do not commit the file, paste the key into logs, or pass production keys through shell history.
Development
From packages/bolin-cli in the Agent Toolkit repository:
pnpm install
pnpm test
pnpm run release:checkrelease:check builds the TypeScript sources, runs the command-level tests, and
uses npm 12 to show the exact package contents without publishing them.
