# `bl text` commands > Auto-generated from `packages/cli/src/commands.ts`. Do not edit by hand. > Regenerate: `pnpm --filter bailian-cli run generate:reference`. Index: [index.md](index.md) ## Commands in this group | Command | Authentication | Description | | ------------------- | -------------- | ------------------------------------------------------------------ | | `bl text chat` | API Key | Send a text model request (OpenAI compatible, DashScope) | | `bl text translate` | API Key | Translate text with Qwen-MT (Chat Completions translation_options) | ## Command details ### `bl text chat` | Field | Value | | ------------------ | ------------------------------------------------------------------- | | **Name** | `text chat` | | **Description** | Send a text model request (OpenAI compatible, DashScope) | | **Authentication** | API Key | | **Usage** | `bl text chat (--message \| --messages-file ) [flags]` | #### Flags | Flag | Type | Required | Description | | --------------------------------- | ------- | -------- | ------------------------------------------------------------------------------------- | | `--api ` | string | no | API to call (default: chat) | | `--model ` | string | no | Model ID (default: qwen3.8-max) | | `--message ` | array | no | Message text (repeatable, prefix role: to set role); or use --messages-file | | `--messages-file ` | string | no | Messages array for one request (use - for stdin) | | `--system ` | string | no | System prompt | | `--max-tokens ` | number | no | Maximum tokens to generate (default: 4096) | | `--temperature ` | number | no | Sampling temperature (0.0, 2.0] | | `--top-p ` | number | no | Nucleus sampling threshold | | `--enable-search ` | boolean | no | Enable built-in web search (Chat Completions API only; default: true for qwen3.8-max) | | `--stream` | switch | no | Stream response tokens (default: on in TTY) | | `--tool ` | array | no | Tool definition as JSON or file path (repeatable) | | `--enable-thinking [true\|false]` | boolean | no | Set thinking/reasoning mode; bare flag means true (model support is service-defined) | | `--thinking-budget ` | number | no | Max tokens for thinking (default: 4096) | | `--batch` | switch | no | Single synchronous Batch Chat request (non-streaming) | | `--prime` | switch | no | Use Prime mode with a workspace-scoped endpoint | | `--workspace-id ` | string | no | Workspace ID for the default Prime endpoint (or set BAILIAN_WORKSPACE_ID) | | `--api-key ` | string | no | API key | | `--base-url ` | string | no | API base URL | #### Notes - --batch sends one synchronous Batch Chat request, non-streaming even in TTY; cannot combine with --prime, --api responses or --stream. --message/--messages-file supply one request's conversation context, not independent file requests. File inference uses batch create/get/download: create returns a task ID without waiting for completion. Explicit realtime/international/Token Plan hosts are rejected; explicit Batch/custom proxy URLs retain existing credentials. No automatic fallback or POST replay. - Batch Chat total request timeout defaults to 300s; --timeout must be 60–3600s. - Prime mode requires an explicit model and currently supports only the Chat Completions API. - Prime endpoint: configured --base-url, DASHSCOPE_BASE_URL, or profile base_url takes precedence; otherwise workspace is resolved from --workspace-id, BAILIAN_WORKSPACE_ID, then config workspace_id. - --enable-search maps to the Chat Completions enable_search parameter and requires a model with built-in web search support; whitelisted models (qwen3.8-max) enable it by default unless --enable-search false is passed; for the Responses API use --tool '{"type":"web_search"}' instead. - For dedicated Qwen-MT text translation, use `text translate` instead of this chat entry. #### Examples ```bash bl text chat --message "What is Qwen?" ``` ```bash bl text chat --api responses --model qwen3.8-max --tool '{"type":"web_search"}' --message "Search for recent Alibaba Cloud news" ``` ```bash bl text chat --model qwen-max --system "You are a coding assistant." --message "Write fizzbuzz in Python" ``` ```bash bl text chat --message "Hello" --message "assistant:Hi!" --message "How are you?" ``` ```bash bl text chat --batch --model qwen-plus --message "Hello" --timeout 3600 ``` ```bash bl text chat --batch --model qwen-plus --messages-file messages.json --timeout 3600 ``` ```bash bl text chat --messages-file - --stream ``` ```bash bl text chat --message "Hello" --output json ``` ```bash bl text chat --model qwq-plus --message "Solve 1+1" --enable-thinking ``` ```bash bl text chat --model qwen-plus --message "Answer directly" --enable-thinking false ``` ```bash bl text chat --enable-search true --message "Latest news about Alibaba Cloud" ``` ```bash bl text chat --prime --workspace-id --model glm-5.3-prime --message "Explain this code" ``` ### `bl text translate` | Field | Value | | ------------------ | --------------------------------------------------------------------------------------------- | | **Name** | `text translate` | | **Description** | Translate text with Qwen-MT (Chat Completions translation_options) | | **Authentication** | API Key | | **Usage** | `bl text translate (--message \| --messages-file ) --target-lang [flags]` | #### Flags | Flag | Type | Required | Description | | ------------------------ | ------ | -------- | ------------------------------------------------------------------------------------------- | | `--model ` | string | no | Qwen-MT model ID (default: qwen-mt-flash; qwen-mt-plus\|flash\|lite, optional dated suffix) | | `--message ` | array | no | Text to translate (repeatable; literal text, not role: prefixes; or use --messages-file) | | `--messages-file ` | string | no | Messages array for one request (use - for stdin; user role only) | | `--source-lang ` | string | no | Translation source language (English name; default: auto) | | `--target-lang ` | string | yes | Translation target language (English name) | | `--term ` | array | no | Terminology pair source=target (repeatable) | | `--domain-hint ` | string | no | Translation domain hint in English (maps to domains) | | `--max-tokens ` | number | no | Maximum tokens to generate (default: 4096) | | `--temperature ` | number | no | Sampling temperature (0.0, 2.0] | | `--top-p ` | number | no | Nucleus sampling threshold | | `--stream` | switch | no | Stream response tokens (default: on in TTY) | | `--api-key ` | string | no | API key | | `--base-url ` | string | no | API base URL | #### Notes - Language names use English full names (Chinese/English), not zh/en codes. --message is literal text; role checks apply to --messages-file only. Does not support --api responses, --batch, --prime, --tool, --enable-search, or thinking flags. For general chat use `text chat`. #### Examples ```bash bl text translate --message "欢迎使用百炼。" --source-lang Chinese --target-lang English --term "百炼=Bailian" --dry-run --output json ``` ```bash bl text translate --model qwen-mt-plus --message "欢迎使用百炼。" --target-lang English --stream --output json ```