Skip to main content

Managed Agent

Bailian CLI command reference for managing Managed Agent lifecycle, projects, sessions, state, and all AgentStudio resources.

Manage the full Managed Agent lifecycle from the terminal: deploy Agents as infrastructure-as-code, initialize and build local projects, manage sessions and state, and directly operate Agents, Environments, Skills, Vaults, Deployments, Sessions, Files, Memory Stores, and Webhooks in AgentStudio. Query, create, and run resources by resource type. The create commands for Agent, Environment, Skill, Vault, Deployment, and Memory Store can generate resource declarations from parameters; add --yes to confirm, write them to the configuration, and create the resources.
Managed Agent capabilities are currently available only to China site (aliyun.com) accounts.
Append --help to any command for full parameter details, e.g. bl managed-agent apply --help. Command details on this page are verified against bl 2.5.1.
See the Managed Agent docs for feature-page usage.
bl managed-agent skill-list is equivalent to bl managed-agent skill list; bl managed-agent session events is equivalent to bl managed-agent session event list. The aliases exist for backward compatibility with older scripts.

Global flags

The following flags are available to all bl managed-agent subcommands and are not repeated in the command sections. Commands that require API Key authentication also support --api-key and --base-url.
ParameterTypeDescription
--output <format>stringOutput format: text, json
--timeout <seconds>numberRequest timeout (seconds)
--quietswitchSuppress non-essential output
--verboseswitchPrint HTTP request and response details
--dry-runswitchDry run mode
--config <name>stringUse a config profile for this command
--helpswitchShow help
--api-key <key>stringAPI Key; credentials resolve in the order --api-key > DASHSCOPE_API_KEY env var > bl auth login (active config profile)
--base-url <url>stringAPI Base URL

Lifecycle

bl managed-agent init

Create an agents.yaml template. No authentication required. Usage
bl managed-agent init [--agent-name <name>] [--file <path>] [--force]
ParameterTypeRequiredDescription
--agent-name <name>stringnoName of the first agent (default: assistant)
--file <path>stringnoOutput config path (default: agents.yaml)
--forceswitchnoOverwrite an existing config file
Example: Create agents.yaml template with agent name assistant
bl managed-agent init --agent-name assistant

bl managed-agent validate

Validate an agents.yaml configuration (offline). No authentication required. Usage
bl managed-agent validate [--file <path>]
ParameterTypeRequiredDescription
--file <path>stringnoConfig file path (default: agents.yaml)
Example: Validate agents.yaml configuration file
bl managed-agent validate --file agents.yaml

bl managed-agent plan

Show what changes would be applied to agent infrastructure. Requires API Key authentication. Usage
bl managed-agent plan [--file <path>] [--no-refresh] [--refresh-only]
ParameterTypeRequiredDescription
--file <path>stringnoConfig file path (default: agents.yaml)
--no-refreshswitchnoSkip refreshing state from remote before planning
--refresh-onlyswitchnoRefresh state and show drift without planning remote mutations
Example: Preview planned changes without refreshing state
bl managed-agent plan --no-refresh
  • --no-refresh and --dry-run plan offline from local config and state: no remote requests, no state writes, provider keys are not checked.

bl managed-agent apply

Apply planned changes to create/update/delete agent resources. Requires API Key authentication. Usage
bl managed-agent apply [--file <path>] [--concurrency <n>]
ParameterTypeRequiredDescription
--file <path>stringnoConfig file path (default: agents.yaml)
--no-refreshswitchnoSkip refreshing state from remote before planning
--concurrency <n>numbernoMax independent resources to apply in parallel (default 6, max 10)
--yesswitchnoConfirm this high-risk operation
This applies the current plan and may create, update, or delete remote managed Agent resources.
Example: Confirm and apply planned changes to agent infrastructure
bl managed-agent apply --yes

bl managed-agent destroy

Destroy all managed agent resources tracked in state. Requires API Key authentication. Usage
bl managed-agent destroy [--file <path>] [--cascade]
ParameterTypeRequiredDescription
--file <path>stringnoConfig file path (default: agents.yaml)
--cascadeswitchnoAuto-delete dependent resources (e.g. sessions referencing an environment)
--yesswitchnoConfirm this high-risk operation
This deletes every managed Agent resource tracked in state; --cascade may also delete dependent resources.
Example: Confirm and destroy all managed agent resources
bl managed-agent destroy --yes

Local resource state

bl managed-agent state list

List resources tracked in agents state. No authentication required. Usage
bl managed-agent state list [--file <path>]
ParameterTypeRequiredDescription
--file <path>stringnoConfig file path (default: agents.yaml)
Example: List state resources from agents.yaml file
bl managed-agent state list --file agents.yaml

bl managed-agent state show

Show details of a resource in agents state. No authentication required. Usage
bl managed-agent state show --address <provider.type.name> [--file <path>]
ParameterTypeRequiredDescription
--address <provider.type.name>stringyesResource state address
--file <path>stringnoConfig file path (default: agents.yaml)
Example: Show details of a specific resource in state
bl managed-agent state show --address bailian.agent.assistant

bl managed-agent state import

Import an existing remote resource into agents state. Requires API Key authentication. Usage
bl managed-agent state import --address <bailian.type.name> --remote-id <id> [--resource-version <n>] [--file <path>]
ParameterTypeRequiredDescription
--address <bailian.type.name>stringyesResource state address
--remote-id <id>stringyesExisting remote resource ID to import
--resource-version <n>numbernoResource version (for versioned resources like agents)
--file <path>stringnoConfig file path (default: agents.yaml)
Example: Import remote resource into state using address and ID
bl managed-agent state import --address bailian.agent.assistant --remote-id agent-abc123

bl managed-agent state rm

Remove a resource from state without destroying it remotely. No authentication required. Usage
bl managed-agent state rm --address <provider.type.name> [--file <path>]
ParameterTypeRequiredDescription
--address <provider.type.name>stringyesResource state address
--file <path>stringnoConfig file path (default: agents.yaml)
--yesswitchnoConfirm this high-risk operation
This removes the resource from local state without deleting it remotely, so this project will no longer track it.
Example: Remove resource from state with confirmation
bl managed-agent state rm --address bailian.agent.assistant --yes

Session preview

bl managed-agent playground

Launch a Session Preview for an agents.yaml Agent. Requires API Key authentication. Usage
bl managed-agent playground [--file <path>] [--agent <id>] [--port <n>] [--no-open]
ParameterTypeRequiredDescription
--file <path>stringnoConfig file path (default: agents.yaml)
--port <n>numbernoLocal port (default: 4848)
--no-openswitchnoDo not open a browser automatically
--agent <id>stringnoAgent to preview (required when the project declares multiple Agents)
Example: Launch session preview for agent assistant
bl managed-agent playground --agent assistant
  • Session Preview requires Node.js 22+ and keeps using an agents.yaml source. Directory Workbench is available under managed-agent project workbench.

Project init

bl managed-agent project init

Create a directory project or convert the local agents.yaml. No authentication required. Usage
bl managed-agent project init [--project <directory>]
ParameterTypeRequiredDescription
--project <directory>stringnoDirectory project root (default: ./managed-agent under the current directory)
Example: Initialize project directory at ./my-agent
bl managed-agent project init --project ./my-agent
  • Without --project, creates a managed-agent/ subdirectory. Enter it before running other project commands. Use --project . to initialize in place or convert the current agents.yaml; existing project files are not overwritten.
  • New projects include Skill, File, Vault, and Environment examples under each resource directory's _examples/. They are not referenced by agent.json and are excluded from Build/Publish. Copy an example outside _examples/ to enable it, then configure its Agent reference.

Project validation

bl managed-agent project validate

Validate a directory Agent project. No authentication required. Usage
bl managed-agent project validate [--project <directory>]
ParameterTypeRequiredDescription
--project <directory>stringnoDirectory project root (default: current directory)
Example: Validate a directory Agent project
bl managed-agent project validate --project ./my-agent

Project build

bl managed-agent project build

Organize directory source and generate the immutable Publish Build. No authentication required. Usage
bl managed-agent project build [--project <directory>]
ParameterTypeRequiredDescription
--project <directory>stringnoDirectory project root (default: current directory)
Example: Preview the build without executing
bl managed-agent project build --dry-run
  • Build writes local project files without confirmation, including inferred resource associations and migration of plaintext Vault secrets into .env. Use --dry-run to preview without writing. Publish still requires explicit confirmation before remote changes.

Project publish

bl managed-agent project publish

Publish the current directory-project Build and record a version. Requires API Key authentication. Usage
bl managed-agent project publish [--project <directory>] [--no-refresh] [--concurrency <n>]
ParameterTypeRequiredDescription
--project <directory>stringnoDirectory project root (default: current directory)
--no-refreshswitchnoSkip remote refresh before planning
--concurrency <n>numbernoMaximum parallel resource operations
--yesswitchnoConfirm this high-risk operation
This publishes the current directory-project Build and may create, update, or delete remote managed Agent resources.
Example: Confirm and publish the current directory-project Build
bl managed-agent project publish --yes

Project workbench

bl managed-agent project workbench

Launch the directory project Workbench. Requires API Key authentication. Usage
bl managed-agent project workbench [--project <directory>] [--port <n>] [--no-open]
ParameterTypeRequiredDescription
--project <directory>stringnoDirectory project root (default: current directory)
--port <n>numbernoLocal port (default: 4848)
--no-openswitchnoDo not open a browser
Example: Launch the directory project Workbench without opening a browser
bl managed-agent project workbench --project ./my-agent --no-open

Project versions

bl managed-agent project version list

List directory project versions. No authentication required. Usage
bl managed-agent project version list [--project <directory>] [--limit <n>] [--cursor <cursor>]
ParameterTypeRequiredDescription
--project <directory>stringnoDirectory project root (default: current directory)
--limit <n>numbernoMaximum versions to return
--cursor <cursor>stringnoPagination cursor
Example: List up to 20 versions with JSON output
bl managed-agent project version list --limit 20 --output json

bl managed-agent project version enable

Enable directory project versions. No authentication required. Usage
bl managed-agent project version enable [--project <directory>]
ParameterTypeRequiredDescription
--project <directory>stringnoDirectory project root (default: current directory)
Example: Enable directory project versions
bl managed-agent project version enable --project ./my-agent

bl managed-agent project version disable

Disable directory project versions. No authentication required. Usage
bl managed-agent project version disable [--project <directory>]
ParameterTypeRequiredDescription
--project <directory>stringnoDirectory project root (default: current directory)
Example: Disable directory project versions
bl managed-agent project version disable --project ./my-agent

bl managed-agent project version status

Show directory project version status. No authentication required. Usage
bl managed-agent project version status [--project <directory>]
ParameterTypeRequiredDescription
--project <directory>stringnoDirectory project root (default: current directory)
Example: Show version status with JSON output
bl managed-agent project version status --project ./my-agent --output json

bl managed-agent project version preview

Preview a directory project version. No authentication required. Usage
bl managed-agent project version preview --version-id <full-version> [--project <directory>]
ParameterTypeRequiredDescription
--project <directory>stringnoDirectory project root (default: current directory)
--version-id <full-version>stringyesFull project version ID
Example: Preview a directory project version
bl managed-agent project version preview --version-id <full-version>

bl managed-agent project version restore

Restore a version to the project working directory. No authentication required. Usage
bl managed-agent project version restore --version-id <full-version> [--project <directory>]
ParameterTypeRequiredDescription
--project <directory>stringnoDirectory project root (default: current directory)
--version-id <full-version>stringyesFull project version ID
--yesswitchnoConfirm this high-risk operation
This restores the full directory source to the working tree. Version history and remote State will not move.
Example: Restore a version to the project working directory
bl managed-agent project version restore --version-id <full-version>

Agent

bl managed-agent agent create

Declare and create one Managed Agent through an isolated YAML apply. Requires API Key authentication. Usage
bl managed-agent agent create --name <name> --model <model> --instructions <text|path> [--description <text>] [--skill <id>...] [--type custom|official] [--skill-dir <path>...] [--tool <name>...] [--environment <yaml-key>] [--vault <yaml-key>] [--mcp <server-code>...] [--file <path>] [--yes]
ParameterTypeRequiredDescription
--name <name>stringyesRemote Agent display name; the YAML key is generated automatically
--model <model>stringyesModel ID
--instructions <text|path>stringyesInline instructions or a ./, ../, or absolute file path
--description <text>stringnoAgent description
--skill <id>arraynoExisting remote Skill ID (repeatable)
--skill-dir <path>arraynoLocal Skill directory or ZIP to declare, upload, and attach through the same scoped create (repeatable)
--type <custom|official>stringnoType applied to every --skill value (default: custom)
--tool <name>arraynoBuiltin tool name (repeatable)
--environment <yaml-key>stringnoExisting Environment key from agents.yaml, used as the default environment for Sessions and Deployments
--vault <yaml-key>stringnoExisting Vault key from agents.yaml, used as the default vault for Sessions and Deployments
--mcp <server-code>arraynoMCP market server code; all of its tools are enabled (repeatable)
--file <path>stringnoConfig file path (default: agents.yaml)
--yesswitchnoWrite YAML and run the scoped remote create
Example: Create a Managed Agent with specified name, model, and instructions
bl managed-agent agent create --name assistant --model qwen3.8-max --instructions "You are helpful."
  • Without --yes, previews the generated YAML key and scoped plan. --dry-run stays offline. Unrelated resources are not refreshed or drift-checked.
  • --skill writes an external Skill reference directly into the Agent declaration. --type defaults to custom; use --type official for platform Skills. These Skills are not managed through the top-level skills map.
  • --skill-dir accepts a local Skill directory or ZIP, writes it as a top-level custom Skill declaration, and writes its generated YAML key into the Agent skills list. Skill and Agent are created together in dependency order. --type applies only to --skill IDs.
  • --environment and --vault write existing YAML keys into the Agent declaration as default runtime bindings for Sessions and Deployments; they are not sent to the Agent API. The referenced Environment and Vault must already be created.
  • --mcp accepts MCP market server codes (see bl mcp list) and enables all of their tools. To toggle individual tools, edit tools.mcp in YAML and run a full apply.

bl managed-agent agent list

List Managed Agents. Requires API Key authentication. Usage
bl managed-agent agent list [--limit <n>] [--page <cursor>] [--all] [--include-archived] [--file <path>]
ParameterTypeRequiredDescription
--file <path>stringnoConfig file path (default: agents.yaml)
--limit <n>numbernoPage size (1-100)
--page <cursor>stringnoOpaque page cursor returned by a previous request
--allswitchnoFetch all pages by following opaque cursors
--include-archivedswitchnoInclude archived resources
Example: List up to 50 Managed Agents
bl managed-agent agent list --limit 50

bl managed-agent agent get

Get a Managed Agent. Requires API Key authentication. Usage
bl managed-agent agent get --agent-id <id> [--agent-version <n>] [--file <path>]
ParameterTypeRequiredDescription
--file <path>stringnoConfig file path (default: agents.yaml)
--agent-id <id>stringyesAgent ID
--agent-version <n>numbernoSpecific agent version
Example: Retrieve a Managed Agent using its ID
bl managed-agent agent get --agent-id agent_abc
Search Managed Agents. Requires API Key authentication. Usage
bl managed-agent agent search --query <text> [--limit <n>] [--page-limit <n>] [--include-archived]
ParameterTypeRequiredDescription
--file <path>stringnoConfig file path (default: agents.yaml)
--limit <n>numbernoPage size (1-100)
--query <text>stringyesCase-insensitive text to find in IDs, names, and descriptions
--page-limit <n>numbernoMaximum pages to scan for client-side search (default: 10)
--include-archivedswitchnoInclude archived resources
Example: Search for Managed Agents by query text
bl managed-agent agent search --query assistant

bl managed-agent agent versions

List Managed Agent versions. Requires API Key authentication. Usage
bl managed-agent agent versions --agent-id <id> [--limit <n>] [--page <cursor>] [--all]
ParameterTypeRequiredDescription
--file <path>stringnoConfig file path (default: agents.yaml)
--limit <n>numbernoPage size (1-100)
--page <cursor>stringnoOpaque page cursor returned by a previous request
--allswitchnoFetch all pages by following opaque cursors
--agent-id <id>stringyesAgent ID
Example: List versions of a Managed Agent by ID
bl managed-agent agent versions --agent-id agent_abc

Environment

bl managed-agent environment list

List Managed Agent environments. Requires API Key authentication. Usage
bl managed-agent environment list [--limit <n>] [--page <cursor>] [--all] [--include-archived]
ParameterTypeRequiredDescription
--file <path>stringnoConfig file path (default: agents.yaml)
--limit <n>numbernoPage size (1-100)
--page <cursor>stringnoOpaque page cursor returned by a previous request
--allswitchnoFetch all pages by following opaque cursors
--include-archivedswitchnoInclude archived resources
Example: Fetch all environments with JSON output
bl managed-agent environment list --all --output json

bl managed-agent environment get

Get a Managed Agent environment. Requires API Key authentication. Usage
bl managed-agent environment get --environment-id <id>
ParameterTypeRequiredDescription
--file <path>stringnoConfig file path (default: agents.yaml)
--environment-id <id>stringyesEnvironment ID
Example: Retrieve a Managed Agent environment by ID
bl managed-agent environment get --environment-id env_abc
Search Managed Agent environments. Requires API Key authentication. Usage
bl managed-agent environment search --query <text> [--limit <n>] [--page-limit <n>] [--include-archived]
ParameterTypeRequiredDescription
--file <path>stringnoConfig file path (default: agents.yaml)
--limit <n>numbernoPage size (1-100)
--query <text>stringyesCase-insensitive text to find in IDs, names, and descriptions
--page-limit <n>numbernoMaximum pages to scan for client-side search (default: 10)
--include-archivedswitchnoInclude archived resources
Example: Search for environments by query text
bl managed-agent environment search --query sandbox

bl managed-agent environment create

Declare and create one Managed Agent Environment through a scoped YAML apply. Requires API Key authentication. Usage
bl managed-agent environment create --name <name> [--description <text>] [--metadata <key=value>...] [--apt <package>...] [--pip <package>...] [--npm <package>...] [--cargo <package>...] [--gem <package>...] [--go <package>...] [--file <path>] [--yes]
ParameterTypeRequiredDescription
--name <name>stringyesRemote Environment display name; the YAML key is generated automatically
--description <text>stringnoEnvironment description
--metadata <key=value>arraynoMetadata entry (repeatable)
--apt <package>arraynoAPT package (repeatable)
--pip <package>arraynopip package (repeatable)
--npm <package>arraynonpm package (repeatable)
--cargo <package>arraynoCargo package (repeatable)
--gem <package>arraynoRuby gem package (repeatable)
--go <package>arraynoGo package (repeatable)
--file <path>stringnoConfig file path (default: agents.yaml)
--yesswitchnoWrite YAML and run the scoped remote create
Example: Create a new environment with a given name
bl managed-agent environment create --name Development
  • Creates a cloud Environment with unrestricted networking. Without --yes, only previews the generated YAML key and scoped plan.

Skill

bl managed-agent skill list

List Managed Agent skills. Requires API Key authentication. Usage
bl managed-agent skill list [--source custom|official|all] [--limit <n>] [--page <cursor>] [--all]
ParameterTypeRequiredDescription
--file <path>stringnoConfig file path (default: agents.yaml)
--limit <n>numbernoPage size (1-100)
--page <cursor>stringnoOpaque page cursor returned by a previous request
--allswitchnoFetch all pages by following opaque cursors
--source <source>stringnoSkill catalog: custom (default), official, or all
Example: List skills from a specified source
bl managed-agent skill list --source official
  • --source all combines one page from each catalog, or every page with --all; it does not accept --page.

bl managed-agent skill get

Get a Managed Agent skill. Requires API Key authentication. Usage
bl managed-agent skill get --skill-id <id>
ParameterTypeRequiredDescription
--file <path>stringnoConfig file path (default: agents.yaml)
--skill-id <id>stringyesSkill ID
Example: Retrieve a Managed Agent skill by ID
bl managed-agent skill get --skill-id skill_abc
Search Managed Agent skills. Requires API Key authentication. Usage
bl managed-agent skill search --query <text> [--source custom|official|all] [--limit <n>] [--page-limit <n>]
ParameterTypeRequiredDescription
--file <path>stringnoConfig file path (default: agents.yaml)
--limit <n>numbernoPage size (1-100)
--query <text>stringyesCase-insensitive text to find in IDs, names, and descriptions
--page-limit <n>numbernoMaximum pages to scan for client-side search (default: 10)
--source <source>stringnoSkill catalog: custom (default), official, or all
Example: Search skills by query and source
bl managed-agent skill search --query browser --source official

bl managed-agent skill create

Declare and create one custom Managed Agent Skill from a local source. Requires API Key authentication. Usage
bl managed-agent skill create --source <directory|zip|SKILL.md> [--file <path>] [--yes]
ParameterTypeRequiredDescription
--source <directory|zip|SKILL.md>stringyesLocal Skill directory, ZIP archive, or single SKILL.md
--file <path>stringnoConfig file path (default: agents.yaml)
--yesswitchnoWrite YAML and upload the Skill through the scoped create
Example: Create a custom skill from a local source
bl managed-agent skill create --source ./skills/code-review
  • The YAML key is derived from SKILL.md frontmatter name. Remote URLs remain available through handwritten YAML plus full apply.

bl managed-agent skill versions

List Managed Agent skill versions. Requires API Key authentication. Usage
bl managed-agent skill versions --skill-id <id> [--limit <n>] [--page <cursor>] [--all]
ParameterTypeRequiredDescription
--file <path>stringnoConfig file path (default: agents.yaml)
--skill-id <id>stringyesSkill ID
--limit <n>numbernoPage size (1-100)
--page <cursor>stringnoOpaque page cursor returned by a previous request
--allswitchnoFetch all pages by following opaque cursors
Example: List versions of a Managed Agent skill by ID
bl managed-agent skill versions --skill-id skill_abc

bl managed-agent skill download

Download a Managed Agent skill version. Requires API Key authentication. Usage
bl managed-agent skill download --skill-id <id> --skill-version <version> --output-file <path> [--force]
ParameterTypeRequiredDescription
--file <path>stringnoConfig file path (default: agents.yaml)
--skill-id <id>stringyesSkill ID
--skill-version <version>stringyesSkill version
--output-file <path>stringyesDestination ZIP path
--forceswitchnoOverwrite an existing output file
Example: Download skill version to specified file
bl managed-agent skill download --skill-id skill_abc --skill-version 3 --output-file ./skill.zip

Vault

bl managed-agent vault list

List Managed Agent vaults. Requires API Key authentication. Usage
bl managed-agent vault list [--limit <n>] [--page <cursor>] [--all] [--include-archived]
ParameterTypeRequiredDescription
--file <path>stringnoConfig file path (default: agents.yaml)
--limit <n>numbernoPage size (1-100)
--page <cursor>stringnoOpaque page cursor returned by a previous request
--allswitchnoFetch all pages by following opaque cursors
--include-archivedswitchnoInclude archived resources
Example: List all vaults with JSON output
bl managed-agent vault list --all --output json

bl managed-agent vault get

Get a Managed Agent vault. Requires API Key authentication. Usage
bl managed-agent vault get --vault-id <id>
ParameterTypeRequiredDescription
--file <path>stringnoConfig file path (default: agents.yaml)
--vault-id <id>stringyesVault ID
Example: Retrieve vault by ID
bl managed-agent vault get --vault-id vault_abc
Search Managed Agent vaults. Requires API Key authentication. Usage
bl managed-agent vault search --query <text> [--limit <n>] [--page-limit <n>] [--include-archived]
ParameterTypeRequiredDescription
--file <path>stringnoConfig file path (default: agents.yaml)
--limit <n>numbernoPage size (1-100)
--query <text>stringyesCase-insensitive text to find in IDs, names, and descriptions
--page-limit <n>numbernoMaximum pages to scan for client-side search (default: 10)
--include-archivedswitchnoInclude archived resources
Example: Search vaults for query text
bl managed-agent vault search --query github

bl managed-agent vault create

Declare and create one empty Managed Agent Vault through a scoped YAML apply. Requires API Key authentication. Usage
bl managed-agent vault create --name <name> [--metadata <key=value>...] [--file <path>] [--yes]
ParameterTypeRequiredDescription
--name <name>stringyesRemote Vault display name; the YAML key is generated automatically
--metadata <key=value>arraynoMetadata entry (repeatable)
--file <path>stringnoConfig file path (default: agents.yaml)
--yesswitchnoWrite YAML and run the scoped remote create
Example: Create a new vault with given name
bl managed-agent vault create --name Production
  • Creates an empty Vault. Add secrets later with vault credential create.

bl managed-agent vault credential create

Append and create one environment-variable Credential in a tracked Vault. Requires API Key authentication. Usage
bl managed-agent vault credential create --vault <yaml-key> --name <name> --secret-name <name> --secret-env <env-name> [--metadata <key=value>...] [--file <path>] [--yes]
ParameterTypeRequiredDescription
--vault <yaml-key>stringyesExisting tracked Vault key from agents.yaml
--name <name>stringyesCredential display name
--secret-name <name>stringyesEnvironment variable name exposed to the Agent
--secret-env <env-name>stringyesLocal environment variable containing the secret value
--metadata <key=value>arraynoMetadata entry (repeatable)
--file <path>stringnoConfig file path (default: agents.yaml)
--yesswitchnoWrite YAML and create the remote Credential
Example: Create credential in specified vault
bl managed-agent vault credential create --vault production --name api-token --secret-name API_TOKEN --secret-env PROD_API_TOKEN
  • --secret-env is an environment variable name, not the secret itself. The CLI auto-loads the nearest .env from the current directory upward; shell exports and CI secret injection also work.
  • YAML stores only ${ENV_NAME}. Never commit .env; subsequent full apply runs must provide the same environment variable.

Memory Store

Memory Store lifecycle is managed by agents.yaml and State; memory contents are managed through API commands. Read and write commands use a workspace-specific endpoint; when no base URL is configured, they require --workspace-id, which can also come from BAILIAN_WORKSPACE_ID or the workspace_id config field.

bl managed-agent memory-store create

Declare and create a Memory Store through a scoped YAML apply. Requires API Key authentication. Usage
bl managed-agent memory-store create --name <name> [--description <text>] [--metadata <key=value>...] [--entry <json|@path>...] [--file <path>] [--yes]
ParameterTypeRequiredDescription
--name <name>stringyesMemory Store display name; generates a YAML key
--description <text>stringnoStore description (default: empty)
--metadata <key=value>arraynoMetadata entry (repeatable)
--entry <json|@path>arraynoInitial entry JSON with key and content (repeatable)
--file <path>stringnoConfig file path (default: agents.yaml)
--yesswitchnoWrite YAML and run the scoped remote create
Example: Create a Memory Store with an initial memory entry
bl managed-agent memory-store create --name Notes --entry '{"key":"notes.md","content":"Initial notes"}' --dry-run
  • Without --yes, this command only previews. --dry-run is fully offline.
  • Store lifecycle is managed by agents.yaml. --entry initializes new stores; existing content is preserved unless entries_mode: sync is explicitly configured.

bl managed-agent memory-store list

List Memory Stores. Requires API Key authentication. Usage
bl managed-agent memory-store list [--workspace-id <id>] [--limit <n>] [--page <cursor>] [--include-archived]
ParameterTypeRequiredDescription
--workspace-id <id>stringnoWorkspace ID; optional when a base URL is configured
--limit <n>numbernoPage size (1-100)
--page <cursor>stringnoOpaque next_page cursor from the previous response
--include-archivedswitchnoInclude archived stores
Example: List all Memory Stores in the workspace
bl managed-agent memory-store list --workspace-id ws-example --output json
  • Reading stores and their contents does not require agents.yaml or State.
  • Remote operations use --store-id; pass the response next_page back to --page unchanged.

bl managed-agent memory-store get

Get a Memory Store. Requires API Key authentication. Usage
bl managed-agent memory-store get --store-id <id> [--workspace-id <id>]
ParameterTypeRequiredDescription
--workspace-id <id>stringnoWorkspace ID; optional when a base URL is configured
--store-id <id>stringyesRemote Memory Store ID
Example: Get a specific Memory Store
bl managed-agent memory-store get --workspace-id ws-example --store-id memstore_example

bl managed-agent memory-store memories create

Create a memory file. Requires API Key authentication. Usage
bl managed-agent memory-store memories create --store-id <id> --path <path> (--content <text> | --content-file <path>)
ParameterTypeRequiredDescription
--workspace-id <id>stringnoWorkspace ID; optional when a base URL is configured
--store-id <id>stringyesRemote Memory Store ID
--path <path>stringyesMemory file path
--content <text>stringnoMemory content; an empty string is allowed
--content-file <path>stringnoRead UTF-8 content from a local file; exclusive with --content
--yesswitchnoConfirm this high-risk operation
This changes persistent memory content. Review the request with --dry-run before adding --yes.
Example: Create memory content from a local file
bl managed-agent memory-store memories create --store-id memstore_example --path notes.md --content-file ./notes.md --dry-run

bl managed-agent memory-store memories list

List memory files and prefixes. Requires API Key authentication. Usage
bl managed-agent memory-store memories list --store-id <id> [--page <cursor>] [--limit <n>] [--path-prefix <prefix>] [--depth <n>] [--view <basic|full>]
ParameterTypeRequiredDescription
--workspace-id <id>stringnoWorkspace ID; optional when a base URL is configured
--store-id <id>stringyesRemote Memory Store ID
--limit <n>numbernoPage size (1-20)
--page <cursor>stringnoOpaque next_page cursor from the previous response
--view <basic|full>stringnoResponse view: basic or full
--path-prefix <prefix>stringnoFilter by memory path prefix
--depth <n>numbernoDirectory listing depth
Example: List memories under a prefix with the full view
bl managed-agent memory-store memories list --store-id memstore_example --path-prefix /notes/ --view full

bl managed-agent memory-store memories get

Get a memory file. Requires API Key authentication. Usage
bl managed-agent memory-store memories get --store-id <id> --memory-id <id>
ParameterTypeRequiredDescription
--workspace-id <id>stringnoWorkspace ID; optional when a base URL is configured
--store-id <id>stringyesRemote Memory Store ID
--memory-id <id>stringyesRemote Memory ID
Example: Get a specific memory file
bl managed-agent memory-store memories get --store-id memstore_example --memory-id mem_example

bl managed-agent memory-store memories update

Update memory content with an optional SHA-256 precondition. Requires API Key authentication. Usage
bl managed-agent memory-store memories update --store-id <id> --memory-id <id> (--content <text> | --content-file <path>) [--expected-content-sha256 <sha256>]
ParameterTypeRequiredDescription
--workspace-id <id>stringnoWorkspace ID; optional when a base URL is configured
--store-id <id>stringyesRemote Memory Store ID
--memory-id <id>stringyesRemote Memory ID
--content <text>stringnoMemory content; an empty string is allowed
--content-file <path>stringnoRead UTF-8 content from a local file; exclusive with --content
--expected-content-sha256 <sha256>stringnoExpected current SHA-256; reject a concurrent content change
--yesswitchnoConfirm this high-risk operation
This changes persistent memory content. Review the request with --dry-run before adding --yes.
Example: Update memory content with a SHA-256 precondition
bl managed-agent memory-store memories update --store-id memstore_example --memory-id mem_example --content-file ./notes.md --expected-content-sha256 <sha256> --dry-run

bl managed-agent memory-store memories delete

Delete a memory file. Requires API Key authentication. Usage
bl managed-agent memory-store memories delete --store-id <id> --memory-id <id>
ParameterTypeRequiredDescription
--workspace-id <id>stringnoWorkspace ID; optional when a base URL is configured
--store-id <id>stringyesRemote Memory Store ID
--memory-id <id>stringyesRemote Memory ID
--yesswitchnoConfirm this high-risk operation
This changes persistent memory content. Review the request with --dry-run before adding --yes.
Example: Preview deleting a memory file
bl managed-agent memory-store memories delete --store-id memstore_example --memory-id mem_example --dry-run

bl managed-agent memory-store versions list

List Memory Store versions. Requires API Key authentication. Usage
bl managed-agent memory-store versions list --store-id <id> [--memory-id <id>] [--operation <created|modified|deleted>] [--created-at-gte <timestamp>] [--created-at-lte <timestamp>] [--page <cursor>] [--limit <n>] [--view <basic|full>]
ParameterTypeRequiredDescription
--workspace-id <id>stringnoWorkspace ID; optional when a base URL is configured
--store-id <id>stringyesRemote Memory Store ID
--memory-id <id>stringnoFilter by Memory ID
--operation <created|modified|deleted>stringnoFilter by version operation
--created-at-gte <timestamp>stringnoInclusive creation timestamp lower bound
--created-at-lte <timestamp>stringnoInclusive creation timestamp upper bound
--page <cursor>stringnoOpaque next_page cursor from the previous response
--limit <n>numbernoPage size (1-100)
--view <basic|full>stringnoResponse view: basic or full
Example: List recently modified versions
bl managed-agent memory-store versions list --store-id memstore_example --operation modified --view full

bl managed-agent memory-store versions get

Get a memory version. Requires API Key authentication. Usage
bl managed-agent memory-store versions get --store-id <id> --version-id <id>
ParameterTypeRequiredDescription
--workspace-id <id>stringnoWorkspace ID; optional when a base URL is configured
--store-id <id>stringyesRemote Memory Store ID
--version-id <id>stringyesRemote Memory Version ID
Example: Get a specific memory version
bl managed-agent memory-store versions get --store-id memstore_example --version-id memver_example

bl managed-agent memory-store versions redact

Permanently redact a memory version's content. Requires API Key authentication. Usage
bl managed-agent memory-store versions redact --store-id <id> --version-id <id>
ParameterTypeRequiredDescription
--workspace-id <id>stringnoWorkspace ID; optional when a base URL is configured
--store-id <id>stringyesRemote Memory Store ID
--version-id <id>stringyesRemote Memory Version ID
--yesswitchnoConfirm this high-risk operation
This permanently redacts the selected version's content and cannot be undone.
Example: Preview redacting a memory version
bl managed-agent memory-store versions redact --store-id memstore_example --version-id memver_example --dry-run

Deployment

bl managed-agent deployment list

List Managed Agent deployments. Requires API Key authentication. Usage
bl managed-agent deployment list [--agent-id <id>] [--status active|paused] [--limit <n>] [--page <cursor>] [--all]
ParameterTypeRequiredDescription
--file <path>stringnoConfig file path (default: agents.yaml)
--limit <n>numbernoPage size (1-100)
--page <cursor>stringnoOpaque page cursor returned by a previous request
--allswitchnoFetch all pages by following opaque cursors
--agent-id <id>stringnoFilter by agent ID
--status <status>stringnoFilter by deployment status
--include-archivedswitchnoInclude archived resources
--created-at-gte <timestamp>stringnoCreated at or after this timestamp
--created-at-lte <timestamp>stringnoCreated at or before this timestamp
Example: List active deployments with JSON output
bl managed-agent deployment list --status active --all --output json

bl managed-agent deployment get

Get a Managed Agent deployment. Requires API Key authentication. Usage
bl managed-agent deployment get --deployment-id <id>
ParameterTypeRequiredDescription
--file <path>stringnoConfig file path (default: agents.yaml)
--deployment-id <id>stringyesDeployment ID
Example: Get deployment by ID
bl managed-agent deployment get --deployment-id dep_abc
Search Managed Agent deployments. Requires API Key authentication. Usage
bl managed-agent deployment search --query <text> [--limit <n>] [--page <cursor>] [--all]
ParameterTypeRequiredDescription
--file <path>stringnoConfig file path (default: agents.yaml)
--limit <n>numbernoPage size (1-100)
--page <cursor>stringnoOpaque page cursor returned by a previous request
--allswitchnoFetch all pages by following opaque cursors
--query <text>stringyesCase-insensitive text to find in IDs, names, and descriptions
--agent-id <id>stringnoFilter by agent ID
--status <status>stringnoFilter by deployment status
--include-archivedswitchnoInclude archived resources
--created-at-gte <timestamp>stringnoCreated at or after this timestamp
--created-at-lte <timestamp>stringnoCreated at or before this timestamp
Example: Search deployments for query text
bl managed-agent deployment search --query report
  • Deployment search maps --query to the provider's server-side keyword parameter.

bl managed-agent deployment create

Declare and create one Managed Agent Deployment through a scoped YAML apply. Requires API Key authentication. Usage
bl managed-agent deployment create --name <name> --agent <yaml-key> (--message <text>... | --event <json|@path>...) [--agent-version <number>] [--environment <yaml-key>] [--environment_variables <KEY=VALUE>...] [--vault <yaml-key>...] [--resource <json|@path>...] [--schedule <cron> --timezone <timezone>] [--description <text>] [--metadata <key=value>...] [--file <path>] [--yes]
ParameterTypeRequiredDescription
--name <name>stringyesRemote Deployment display name; the YAML key is generated automatically
--agent <yaml-key>stringyesExisting Agent key from agents.yaml
--agent-version <number>numbernoAgent version
--environment <yaml-key>stringnoExisting Environment key from agents.yaml
--environment_variables <KEY=VALUE>arraynoRuntime environment variable; repeat for multiple values (last value wins)
--vault <yaml-key>arraynoExisting Vault key from agents.yaml (repeatable)
--message <text>arraynoInitial user message (repeatable)
--event <json|@path>arraynoInitial user.message or system.message JSON (repeatable)
--resource <json|@path>arraynoFile Resource JSON with source or file_id (repeatable)
--schedule <cron>stringnoFive-field cron expression
--timezone <timezone>stringnoIANA schedule timezone
--description <text>stringnoDeployment description
--metadata <key=value>arraynoMetadata entry (repeatable)
--file <path>stringnoConfig file path (default: agents.yaml)
--yesswitchnoWrite YAML and run the scoped remote create
Example: Create deployment with name, agent, and message
bl managed-agent deployment create --name Daily --agent assistant --message "Generate the report"
  • Initial Events must contain 1-50 user.message/system.message entries. --resource accepts only File Resources in this release.
  • Use either repeatable --message values or repeatable --event values; the two input forms cannot be mixed.
  • --environment_variables values are written to the Deployment YAML declaration and managed by later apply runs. Remove the field or pass {} to clear them. YAML stores these values; do not put real secrets in them.

bl managed-agent deployment run

Run a Managed Agent deployment now. Requires API Key authentication. Usage
bl managed-agent deployment run (--deployment <name> | --deployment-id <id>)
ParameterTypeRequiredDescription
--file <path>stringnoConfig file path (default: agents.yaml)
--deployment <name>stringnoLogical deployment name in agents.yaml/state
--deployment-id <id>stringnoDirect deployment ID
--yesswitchnoConfirm this high-risk operation
This immediately starts a run for the specified Managed Agent deployment and may incur usage or trigger configured actions.
Example: Preview running deployment
bl managed-agent deployment run --deployment daily-report --dry-run

bl managed-agent deployment pause

Pause a Managed Agent deployment. Requires API Key authentication. Usage
bl managed-agent deployment pause (--deployment <name> | --deployment-id <id>)
ParameterTypeRequiredDescription
--file <path>stringnoConfig file path (default: agents.yaml)
--deployment <name>stringnoLogical deployment name in agents.yaml/state
--deployment-id <id>stringnoDirect deployment ID
--yesswitchnoConfirm this high-risk operation
Example: Preview pausing deployment
bl managed-agent deployment pause --deployment daily-report --dry-run

bl managed-agent deployment unpause

Unpause a Managed Agent deployment. Requires API Key authentication. Usage
bl managed-agent deployment unpause (--deployment <name> | --deployment-id <id>)
ParameterTypeRequiredDescription
--file <path>stringnoConfig file path (default: agents.yaml)
--deployment <name>stringnoLogical deployment name in agents.yaml/state
--deployment-id <id>stringnoDirect deployment ID
--yesswitchnoConfirm this high-risk operation
Example: Preview unpausing a Managed Agent deployment
bl managed-agent deployment unpause --deployment daily-report --dry-run

bl managed-agent deployment runs list

List runs for a Managed Agent deployment. Requires API Key authentication. Usage
bl managed-agent deployment runs list --deployment-id <id> [--limit <n>] [--page <cursor>] [--all]
ParameterTypeRequiredDescription
--file <path>stringnoConfig file path (default: agents.yaml)
--deployment-id <id>stringyesDeployment ID
--limit <n>numbernoPage size (1-100)
--page <cursor>stringnoOpaque page cursor returned by a previous request
--allswitchnoFetch all pages by following opaque cursors
Example: List runs for a specific deployment ID
bl managed-agent deployment runs list --deployment-id dep_abc

bl managed-agent deployment runs get

Get a Managed Agent deployment run. Requires API Key authentication. Usage
bl managed-agent deployment runs get --run-id <id>
ParameterTypeRequiredDescription
--file <path>stringnoConfig file path (default: agents.yaml)
--run-id <id>stringyesDeployment run ID
Example: Get details of a specific deployment run
bl managed-agent deployment runs get --run-id run_abc

Session

bl managed-agent session create

Create a new session for an agent. Requires API Key authentication. Usage
bl managed-agent session create [--agent <name>] [--environment <name>] [--title <title>] [--environment_variables <KEY=VALUE>...] [--memory-stores <names>] [--resource <json|@path>...] [--file <path>]
ParameterTypeRequiredDescription
--file <path>stringnoConfig file path (default: agents.yaml)
--agent <name>stringnoAgent name (auto-detected when only one agent is configured)
--environment <name>stringnoOverride agent's declared environment
--vault <name>stringnoOverride agent's declared vault
--memory-stores <names>stringnoOverride agent's memory stores (comma-separated)
--environment_variables <KEY=VALUE>arraynoRuntime environment variable; repeat for multiple values (last value wins)
--resource <json|@path>arraynoSession resource JSON (repeatable); memory_store uses a YAML key plus access and instructions
--title <title>stringnoSession title
Example: Create a new session for the assistant agent
bl managed-agent session create --agent assistant
  • --resource mounts a Memory Store into the Session. For example, --resource '{"type":"memory_store","memory_store":"notes","access":"read_only"}'.

bl managed-agent session run

Create a session, send a message, and stream the response. Requires API Key authentication. Usage
bl managed-agent session run --prompt <text> [--agent <name>] [--no-stream] [--environment_variables <KEY=VALUE>...] [--memory-stores <names>] [--resource <json|@path>...] [--file <path>]
ParameterTypeRequiredDescription
--prompt <text>stringyesPrompt to send
--file <path>stringnoConfig file path (default: agents.yaml)
--agent <name>stringnoAgent name (auto-detected when only one agent is configured)
--environment <name>stringnoOverride agent's declared environment
--vault <name>stringnoOverride agent's declared vault
--memory-stores <names>stringnoOverride agent's memory stores (comma-separated)
--environment_variables <KEY=VALUE>arraynoRuntime environment variable; repeat for multiple values (last value wins)
--resource <json|@path>arraynoSession resource JSON (repeatable); memory_store uses a YAML key plus access and instructions
--title <title>stringnoSession title
--no-streamswitchnoUse polling instead of SSE streaming
Example: Create session, send prompt, and stream response
bl managed-agent session run --prompt "hello"
  • --output json emits one envelope: { session_id, provider, agent, events } — read session_id to chain session send/get/events/delete.

bl managed-agent session send

Send a message to an existing session and stream the response. Requires API Key authentication. Usage
bl managed-agent session send --session-id <id> --message <text> [--no-stream] [--file <path>]
ParameterTypeRequiredDescription
--session-id <id>stringyesSession ID
--message <text>stringyesMessage to send
--file <path>stringnoConfig file path (default: agents.yaml)
--no-streamswitchnoUse polling instead of SSE streaming
Example: Send message to session and stream response
bl managed-agent session send --session-id sess_abc123 --message "continue"

bl managed-agent session list

List sessions from the provider. Requires API Key authentication. Usage
bl managed-agent session list [--agent <name>] [--statuses <statuses>] [--limit <n>] [--page <cursor>] [--all]
ParameterTypeRequiredDescription
--file <path>stringnoConfig file path (default: agents.yaml)
--agent <name>stringnoFilter by agent name
--allswitchnoFetch all pages by following the cursor
--limit <n>numbernoPage size (1-100)
--page <cursor>stringnoOpaque page cursor returned by a previous request
--statuses <statuses>stringnoComma-separated session statuses
--created-at-gte <timestamp>stringnoCreated at or after this RFC 3339 timestamp
--created-at-lte <timestamp>stringnoCreated at or before this RFC 3339 timestamp
Example: List sessions filtered by agent name
bl managed-agent session list --agent assistant

bl managed-agent session get

Get details of a session. Requires API Key authentication. Usage
bl managed-agent session get --session-id <id> [--file <path>]
ParameterTypeRequiredDescription
--session-id <id>stringyesSession ID
--file <path>stringnoConfig file path (default: agents.yaml)
Example: Get details of a specific session
bl managed-agent session get --session-id sess_abc123
Search Managed Agent sessions. Requires API Key authentication. Usage
bl managed-agent session search --query <text> [--agent <name>] [--statuses <statuses>] [--limit <n>] [--page-limit <n>]
ParameterTypeRequiredDescription
--file <path>stringnoConfig file path (default: agents.yaml)
--limit <n>numbernoPage size (1-100)
--query <text>stringyesCase-insensitive text to find in IDs, names, and descriptions
--page-limit <n>numbernoMaximum pages to scan for client-side search (default: 10)
--agent <name>stringnoFilter by configured agent name
--statuses <statuses>stringnoComma-separated session statuses
--created-at-gte <timestamp>stringnoCreated at or after this timestamp
--created-at-lte <timestamp>stringnoCreated at or before this timestamp
Example: Search sessions using a text query
bl managed-agent session search --query debug

bl managed-agent session update

Update a Managed Agent session. Requires API Key authentication. Usage
bl managed-agent session update --session-id <id> [--title <title>] [--metadata <json|@path>]
ParameterTypeRequiredDescription
--file <path>stringnoConfig file path (default: agents.yaml)
--session-id <id>stringyesSession ID
--title <title>stringnoNew session title
--metadata <json|@path>stringnoString-valued metadata JSON or @file
Example: Update session title with new value
bl managed-agent session update --session-id sess_abc --title 'investigation'

bl managed-agent session archive

Archive a Managed Agent session. Requires API Key authentication. Usage
bl managed-agent session archive --session-id <id>
ParameterTypeRequiredDescription
--file <path>stringnoConfig file path (default: agents.yaml)
--session-id <id>stringyesSession ID
--yesswitchnoConfirm this high-risk operation
This archives the specified remote Managed Agent Session.
Example: Preview archiving a session
bl managed-agent session archive --session-id sess_abc --dry-run

bl managed-agent session delete

Delete a session. Requires API Key authentication. Usage
bl managed-agent session delete --session-id <id> [--file <path>]
ParameterTypeRequiredDescription
--session-id <id>stringyesSession ID
--file <path>stringnoConfig file path (default: agents.yaml)
--yesswitchnoConfirm this high-risk operation
This deletes the specified remote managed Agent Session.
Example: Confirm and delete a session
bl managed-agent session delete --session-id sess_abc123 --yes

bl managed-agent session event list

List events for a Managed Agent session. Requires API Key authentication. Usage
bl managed-agent session event list --session-id <id> [--types <types>] [--order asc|desc] [--limit <n>] [--page <cursor>] [--all]
ParameterTypeRequiredDescription
--file <path>stringnoConfig file path (default: agents.yaml)
--session-id <id>stringyesSession ID
--limit <n>numbernoPage size (1-100)
--page <cursor>stringnoOpaque page cursor returned by a previous request
--allswitchnoFetch all pages by following opaque cursors
--order <order>stringnoEvent order: asc or desc
--types <types>stringnoComma-separated raw event types
--created-at-gte <timestamp>stringnoCreated at or after this timestamp
--created-at-lte <timestamp>stringnoCreated at or before this timestamp
Example: List events for a Managed Agent session
bl managed-agent session event list --session-id sess_abc
  • --types is applied client-side to each page returned by the provider.

bl managed-agent session event send

Send raw events to a Managed Agent session. Requires API Key authentication. Usage
bl managed-agent session event send --session-id <id> --event <json|@path>
ParameterTypeRequiredDescription
--file <path>stringnoConfig file path (default: agents.yaml)
--session-id <id>stringyesSession ID
--event <json|@path>stringyesRaw event object/array as JSON or @event.json
Example: Send raw event to a Managed Agent session
bl managed-agent session event send --session-id sess_abc --event '{"type":"message","role":"user","content":[{"type":"text","text":"hello"}]}'

bl managed-agent session event stream

Stream events from a Managed Agent session. Requires API Key authentication. Usage
bl managed-agent session event stream --session-id <id> [--after-id <event-id>]
ParameterTypeRequiredDescription
--file <path>stringnoConfig file path (default: agents.yaml)
--session-id <id>stringyesSession ID
--after-id <event-id>stringnoResume after this event ID
Example: Stream events from a Managed Agent session
bl managed-agent session event stream --session-id sess_abc
  • When the provider has no native event cursor, --after-id resumes through paginated history polling and event ID de-duplication.

bl managed-agent session debug

Aggregate session diagnostics. Requires API Key authentication. Usage
bl managed-agent session debug --session-id <id>
ParameterTypeRequiredDescription
--file <path>stringnoConfig file path (default: agents.yaml)
--session-id <id>stringyesSession ID
Example: Aggregate diagnostics for a Managed Agent session
bl managed-agent session debug --session-id sess_abc

bl managed-agent session export

Export session diagnostics as a ZIP. Requires API Key authentication. Usage
bl managed-agent session export --session-id <id> --output-file <path> [--force]
ParameterTypeRequiredDescription
--file <path>stringnoConfig file path (default: agents.yaml)
--session-id <id>stringyesSession ID
--output-file <path>stringyesDestination ZIP path
--forceswitchnoOverwrite an existing output file
Example: Export session diagnostics as ZIP file
bl managed-agent session export --session-id sess_abc --output-file ./session-debug.zip
  • The ZIP contains metadata only; file bodies and credential-like values are excluded/redacted.

File

bl managed-agent file list

List Managed Agent files. Requires API Key authentication. Usage
bl managed-agent file list [--scope-id <id>] [--limit <n>] [--page <cursor>] [--all]
ParameterTypeRequiredDescription
--file <path>stringnoConfig file path (default: agents.yaml)
--limit <n>numbernoPage size (1-100)
--page <cursor>stringnoOpaque page cursor returned by a previous request
--allswitchnoFetch all pages by following opaque cursors
--scope-id <id>stringnoFilter by scope ID
Example: List files with scope ID and JSON output
bl managed-agent file list --scope-id sess_abc --all --output json

bl managed-agent file get

Get Managed Agent file metadata. Requires API Key authentication. Usage
bl managed-agent file get --file-id <id>
ParameterTypeRequiredDescription
--file <path>stringnoConfig file path (default: agents.yaml)
--file-id <id>stringyesRemote file ID
Example: Retrieve metadata for a Managed Agent file
bl managed-agent file get --file-id file_abc
Search Managed Agent files. Requires API Key authentication. Usage
bl managed-agent file search --query <text> [--scope-id <id>] [--limit <n>] [--page-limit <n>]
ParameterTypeRequiredDescription
--file <path>stringnoConfig file path (default: agents.yaml)
--limit <n>numbernoPage size (1-100)
--query <text>stringyesCase-insensitive text to find in IDs, names, and descriptions
--page-limit <n>numbernoMaximum pages to scan for client-side search (default: 10)
--scope-id <id>stringnoFilter by scope ID
Example: Search files by query text
bl managed-agent file search --query report

bl managed-agent file upload

Upload a Managed Agent file. Requires API Key authentication. Usage
bl managed-agent file upload --path <path> [--filename <name>] [--mime-type <type>]
ParameterTypeRequiredDescription
--file <path>stringnoConfig file path (default: agents.yaml)
--path <path>stringyesLocal file path
--filename <name>stringnoRemote filename override
--mime-type <type>stringnoMIME type override
Example: Upload a file to Managed Agent
bl managed-agent file upload --path ./report.pdf

bl managed-agent file download

Download Managed Agent file content. Requires API Key authentication. Usage
bl managed-agent file download --file-id <id> --output-file <path> [--force]
ParameterTypeRequiredDescription
--file <path>stringnoConfig file path (default: agents.yaml)
--file-id <id>stringyesRemote file ID
--output-file <path>stringyesDestination path
--forceswitchnoOverwrite an existing output file
Example: Download file content to specified path
bl managed-agent file download --file-id file_abc --output-file ./artifact.pdf

bl managed-agent file delete

Delete a Managed Agent file. Requires API Key authentication. Usage
bl managed-agent file delete --file-id <id>
ParameterTypeRequiredDescription
--file <path>stringnoConfig file path (default: agents.yaml)
--file-id <id>stringyesRemote file ID
--yesswitchnoConfirm this high-risk operation
This permanently deletes the specified remote Managed Agent file.
Example: Preview deletion of a Managed Agent file
bl managed-agent file delete --file-id file_abc --dry-run

Webhook

Webhooks are workspace-level resources and are not written to agents.yaml or State. Creating, updating, enabling or disabling, testing, and resetting a signing secret are high-risk operations: inspect the target and request with --dry-run, then add --yes after confirmation. The signing secret is returned only when a create or reset succeeds; save it immediately.

bl managed-agent webhook create

Create a Webhook endpoint. Requires API Key authentication. Usage
bl managed-agent webhook create --url <url> --event <type> [--event <type>] [--description <text>] [--workspace-id <id>]
ParameterTypeRequiredDescription
--workspace-id <id>stringnoWorkspace ID; optional when a base URL is configured
--url <url>stringyesPublic HTTP or HTTPS callback URL
--event <type>arrayyesNamed event subscription; repeat for multiple events, wildcards are unsupported
--description <text>stringnoDescription, up to 256 characters; an empty string clears it on update
--yesswitchnoConfirm this high-risk operation
This creates a Webhook and starts delivering subscribed events to its callback URL.
Example: Create a Webhook subscribed to a specific event
bl managed-agent webhook create --workspace-id ws-example --url https://example.com/webhooks --event session.updated --dry-run

bl managed-agent webhook list

List all Webhook endpoints. Requires API Key authentication. Usage
bl managed-agent webhook list [--workspace-id <id>]
ParameterTypeRequiredDescription
--workspace-id <id>stringnoWorkspace ID; optional when a base URL is configured
Example: List all Webhooks as JSON
bl managed-agent webhook list --workspace-id ws-example --output json
  • Returns every undeleted Webhook without pagination.

bl managed-agent webhook get

Get a Webhook endpoint. Requires API Key authentication. Usage
bl managed-agent webhook get --webhook-id <wep_id> [--workspace-id <id>]
ParameterTypeRequiredDescription
--workspace-id <id>stringnoWorkspace ID; optional when a base URL is configured
--webhook-id <wep_id>stringyesWebhook endpoint ID
Example: Get a specific Webhook
bl managed-agent webhook get --workspace-id ws-example --webhook-id wep_example

bl managed-agent webhook update

Update a Webhook endpoint. Requires API Key authentication. Usage
bl managed-agent webhook update --webhook-id <wep_id> [--url <url>] [--event <type>] [--description <text>] [--workspace-id <id>]
ParameterTypeRequiredDescription
--workspace-id <id>stringnoWorkspace ID; optional when a base URL is configured
--webhook-id <wep_id>stringyesWebhook endpoint ID
--url <url>stringnoPublic HTTP or HTTPS callback URL
--event <type>arraynoNamed event subscription; repeat for multiple events, wildcards are unsupported
--description <text>stringnoDescription, up to 256 characters; an empty string clears it
--yesswitchnoConfirm this high-risk operation
This updates the callback URL, description, or event subscriptions of the Webhook.
Example: Clear the Webhook description
bl managed-agent webhook update --workspace-id ws-example --webhook-id wep_example --description "" --dry-run
  • Omitted fields stay unchanged; passing --event replaces the complete subscription list.

bl managed-agent webhook delete

Delete a Webhook endpoint. Requires API Key authentication. Usage
bl managed-agent webhook delete --webhook-id <wep_id> [--workspace-id <id>]
ParameterTypeRequiredDescription
--workspace-id <id>stringnoWorkspace ID; optional when a base URL is configured
--webhook-id <wep_id>stringyesWebhook endpoint ID
--yesswitchnoConfirm this high-risk operation
This deletes the Webhook and cancels its pending deliveries.
Example: Preview deleting a Webhook
bl managed-agent webhook delete --workspace-id ws-example --webhook-id wep_example --dry-run

bl managed-agent webhook enable

Enable a Webhook endpoint. Requires API Key authentication. Usage
bl managed-agent webhook enable --webhook-id <wep_id> [--workspace-id <id>]
ParameterTypeRequiredDescription
--workspace-id <id>stringnoWorkspace ID; optional when a base URL is configured
--webhook-id <wep_id>stringyesWebhook endpoint ID
--yesswitchnoConfirm this high-risk operation
This resumes event deliveries; events from the disabled period are not replayed.
Example: Enable a Webhook
bl managed-agent webhook enable --workspace-id ws-example --webhook-id wep_example --dry-run

bl managed-agent webhook disable

Disable a Webhook endpoint. Requires API Key authentication. Usage
bl managed-agent webhook disable --webhook-id <wep_id> [--workspace-id <id>]
ParameterTypeRequiredDescription
--workspace-id <id>stringnoWorkspace ID; optional when a base URL is configured
--webhook-id <wep_id>stringyesWebhook endpoint ID
--yesswitchnoConfirm this high-risk operation
This stops new event deliveries and cancels pending deliveries.
Example: Disable a Webhook
bl managed-agent webhook disable --workspace-id ws-example --webhook-id wep_example --dry-run

bl managed-agent webhook test

Send a real Webhook test event. Requires API Key authentication. Usage
bl managed-agent webhook test --webhook-id <wep_id> [--workspace-id <id>]
ParameterTypeRequiredDescription
--workspace-id <id>stringnoWorkspace ID; optional when a base URL is configured
--webhook-id <wep_id>stringyesWebhook endpoint ID
--yesswitchnoConfirm this high-risk operation
This sends a real callback request; redirects or security validation failures may disable the Webhook.
Example: Send a test event to a Webhook
bl managed-agent webhook test --workspace-id ws-example --webhook-id wep_example --dry-run
  • Tests are synchronous, are not retried or recorded, and do not affect consecutive failure counts.

bl managed-agent webhook reset-secret

Reset a Webhook signing secret. Requires API Key authentication. Usage
bl managed-agent webhook reset-secret --webhook-id <wep_id> [--workspace-id <id>]
ParameterTypeRequiredDescription
--workspace-id <id>stringnoWorkspace ID; optional when a base URL is configured
--webhook-id <wep_id>stringyesWebhook endpoint ID
--yesswitchnoConfirm this high-risk operation
This immediately invalidates the previous signing secret. Save the new secret and update your receiver.
Example: Reset a Webhook signing secret
bl managed-agent webhook reset-secret --workspace-id ws-example --webhook-id wep_example --dry-run

bl managed-agent webhook events

List recent Webhook delivery events. Requires API Key authentication. Usage
bl managed-agent webhook events --webhook-id <wep_id> [--limit <count>] [--page <cursor>] [--workspace-id <id>]
ParameterTypeRequiredDescription
--workspace-id <id>stringnoWorkspace ID; optional when a base URL is configured
--webhook-id <wep_id>stringyesWebhook endpoint ID
--limit <count>numbernoPage size (1-100, default: 20)
--page <cursor>stringnoOpaque next_page cursor from the previous response
Example: List the 20 most recent delivery events as JSON
bl managed-agent webhook events --workspace-id ws-example --webhook-id wep_example --limit 20 --output json
  • Delivery events are retained for 7 days; pass the response next_page back to --page to continue.
  • Retained events for deleted Webhooks remain queryable.