Managed Agent

Updated at:

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, and Files in AgentStudio.

NoteManaged Agent capabilities are currently available only to China site (aliyun.com) accounts.

ImportantAppend --help to any command for full parameter details, e.g. bl managed-agent apply --help.

See the Managed Agent quick start for feature-page usage.

One-click Agent creation & deployment

Lifecycle

  • bl managed-agent init: Create a YAML configuration template with Agent and Environment resource examples by default; optionally include Skill, Vault (with Credential), File, and Deployment (scheduled task) resources
  • bl managed-agent validate: Validate the resource configuration
  • bl managed-agent plan: Preview resource changes
  • bl managed-agent apply: Read resource configuration from YAML; by default refresh the cloud state of managed resources first, then compute a change plan; create or update resources in dependency order, delete cloud resources that were removed from the configuration and are managed by the current project, and sync the local state records. Use --file to specify a configuration file; preview changes with plan first, then add --yes to apply after confirmation
  • bl managed-agent destroy: Destroy all cloud resources tracked in the local state

Local resource state

  • bl managed-agent state list: List local resource state records
  • bl managed-agent state show: Show the local state of a specific resource
  • bl managed-agent state import: Import an existing cloud resource into the local state
  • bl managed-agent state rm: Remove a local state record without deleting the cloud resource

Session preview

  • bl managed-agent playground: Launch an online session debug preview in the browser

Local project management

Project init

  • bl managed-agent project init: Create a directory-style project; use --project . to initialize in the current directory

Project validation

  • bl managed-agent project validate: Validate the project directory structure and resource configuration

Project build

  • bl managed-agent project build: Organize and write back local directory source files, and generate an immutable Publish Build; use --dry-run to preview

Project publish

  • bl managed-agent project publish: Publish the current Build and record a version; add --yes to confirm the publish

Project workbench

  • bl managed-agent project workbench: Launch the Config UI Workbench for a directory-style project to edit and debug visually

Project versions

  • bl managed-agent project version list: List local project snapshot versions
  • bl managed-agent project version enable: Enable local project version management
  • bl managed-agent project version disable: Disable local project version management
  • bl managed-agent project version status: Show local project version management status
  • bl managed-agent project version preview: Preview a historical project version
  • bl managed-agent project version restore: Restore a historical version to the project working directory

Resource operations

Query, create, and run resources by resource type. The create commands for Agent, Environment, Skill, Vault, and Deployment can generate resource declarations from parameters; add --yes to confirm, write them to the configuration, and create the resources.

Agent

  • bl managed-agent agent create: Create an Agent
  • bl managed-agent agent list: List remote Agents
  • bl managed-agent agent get: Get Agent details, optionally for a specific version
  • bl managed-agent agent search: Search Agents by ID, name, or description
  • bl managed-agent agent versions: List Agent versions

Environment

  • bl managed-agent environment list: List remote environments
  • bl managed-agent environment get: Get environment details
  • bl managed-agent environment search: Search environments by ID, name, or description
  • bl managed-agent environment create: Create a cloud environment

Skill

  • bl managed-agent skill list: List remote custom or official Skills
  • bl managed-agent skill get: Get Skill details
  • bl managed-agent skill search: Search Skills by ID, name, or description
  • bl managed-agent skill create: Create a custom Skill
  • bl managed-agent skill versions: List Skill versions
  • bl managed-agent skill download: Download a Skill locally, optionally a specific version

Vault

  • bl managed-agent vault list: List remote vaults
  • bl managed-agent vault get: Get vault details
  • bl managed-agent vault search: Search vaults by ID, name, or metadata
  • bl managed-agent vault create: Create an empty vault
  • bl managed-agent vault credential create: Create an environment-variable credential in a tracked Vault

Deployment

  • bl managed-agent deployment list: List remote deployments
  • bl managed-agent deployment get: Get deployment details
  • bl managed-agent deployment search: Search deployments by keyword
  • bl managed-agent deployment create: Create a deployment, optionally with a schedule
  • bl managed-agent deployment run: Trigger a deployment run immediately
  • bl managed-agent deployment pause: Pause a deployment and its schedule
  • bl managed-agent deployment unpause: Resume a deployment and its schedule
  • bl managed-agent deployment runs list: List runs for a deployment
  • bl managed-agent deployment runs get: Get details of a single deployment run

Session

  • bl managed-agent session create: Create a session
  • bl managed-agent session run: Create a session, send a prompt, and stream the response
  • bl managed-agent session send: Send a text message to an existing session and stream the response
  • bl managed-agent session list: List remote sessions
  • bl managed-agent session get: Get session details
  • bl managed-agent session search: Search sessions by ID, title, status, or Agent ID
  • bl managed-agent session update: Update a session title or metadata
  • bl managed-agent session archive: Archive a session
  • bl managed-agent session delete: Delete a session
  • bl managed-agent session event list: List historical session events
  • bl managed-agent session event send: Send a raw event object or an array of events to a session
  • bl managed-agent session event stream: Stream session events, optionally resuming after a specific event
  • bl managed-agent session debug: Aggregate session, event, and file metadata diagnostics
  • bl managed-agent session export: Export masked session diagnostics as a ZIP (without file contents)

File

  • bl managed-agent file list: List remote files
  • bl managed-agent file get: Get file metadata
  • bl managed-agent file search: Search files by ID, filename, or MIME type
  • bl managed-agent file upload: Upload a local file
  • bl managed-agent file download: Download remote file content locally
  • bl managed-agent file delete: Delete a remote file

Examples

bl managed-agent session run --prompt "Analyze the Q3 sales trend in sales.csv"
bl managed-agent project init
bl managed-agent project build
bl managed-agent project publish