Skip to content

feature: add cloud live broadcast command - #662

Merged
jaredbroad merged 1 commit into
QuantConnect:masterfrom
AlexCatarino:feature-cloud-live-broadcast-command
Aug 12, 2026
Merged

feature: add cloud live broadcast command#662
jaredbroad merged 1 commit into
QuantConnect:masterfrom
AlexCatarino:feature-cloud-live-broadcast-command

Conversation

@AlexCatarino

Copy link
Copy Markdown
Member

Description

The API exposes live/commands/broadcast to send a command to every live algorithm in an organization, but the CLI could only target a single project, through live/commands/create (lean cloud live command).

This adds lean cloud live broadcast:

Usage: lean cloud live broadcast [OPTIONS]

  Broadcast a command to all running cloud live trading projects in an organization.

Options:
  --data TEXT             The command to send, 'str' representation of a 'dict' e.g. "{ \"target\": \"BTCUSD\",
                          \"$type\":\"MyCommand\" }"  [required]
  --organization TEXT     The name or id of the organization to broadcast the command to, defaults to the organization
                          of the current Lean CLI directory
  --exclude-project TEXT  The name or id of the project to exclude from the broadcast, by default all projects are
                          included
  • The organization defaults to the working organization of the current Lean CLI directory, and --organization accepts a name or an id, resolved the same way lean init does.
  • --exclude-project accepts a project name or id and is resolved to a project id, mapping to the endpoint's optional excludeProjectId; it is omitted from the payload when not given, so all projects are included.
  • --data is parsed like the existing lean cloud live command, and is required here.

LiveClient.broadcast_command was added alongside command_create to call the endpoint.

Related Issue

N/A

Motivation and Context

Brings the CLI to parity with the live/commands/broadcast endpoint, so a command can be sent to a whole organization's live deployments without scripting one lean cloud live command call per project.

Requires Documentation Change

Yes, lean cloud live broadcast should be added to the CLI command reference. The repository README was regenerated with python scripts/readme.py.

How Has This Been Tested?

  • Five new unit tests in tests/commands/cloud/live/test_cloud_live_commands.py covering the default organization, --exclude-project, --organization by name, and the unknown-organization failure, plus a first test for the existing lean cloud live command. tests/commands/cloud/live passes: 65 passed.
  • Verified against a local editable install that the command is registered under lean cloud live and that its help output renders as above.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

🤖 Generated with Claude Code

The API exposes live/commands/broadcast to send a command to every live
algorithm in an organization, but the CLI could only target a single
project through live/commands/create.

Add `lean cloud live broadcast`, which sends the command given by --data
to all live deployments of an organization. The organization defaults to
the one of the current Lean CLI directory and can be overridden with
--organization, and --exclude-project leaves a single project out of the
broadcast.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@jaredbroad
jaredbroad merged commit 5277bb6 into QuantConnect:master Aug 12, 2026
38 checks passed
@AlexCatarino
AlexCatarino deleted the feature-cloud-live-broadcast-command branch August 12, 2026 23:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants