Manage Services#

List Services#

cb list
cb list --json

Discovered services are visible even when the broker is not running.

Enable or Disable Autostart#

cb enable package-cache
cb disable package-cache

enable and disable validate names against discovered services. If a provider package is removed later, its stale enabled entry is ignored during broker startup instead of preventing other services from starting.

Use --start or --stop to combine the state change with process action:

cb enable package-cache --start
cb disable package-cache --stop

Start and Stop#

cb start
cb start package-cache
cb stop package-cache
cb stop

cb start starts the broker and services enabled for broker startup. cb start SERVICE starts selected services explicitly. cb stop without names shuts the broker down. Stop commands are idempotent: stopping an already stopped broker reports running=false and succeeds.

For Python scripts that need temporary lifecycle ownership, use the Broker API context managers:

from conda_broker import Broker

with Broker.current().started() as broker:
    broker.service("package-cache").start()
from conda_broker import Broker

with Broker.current().service("package-cache").started(wait=True) as service:
    endpoint = service.endpoint(ready=True)

Context managers leave pre-existing brokers and services running. They stop only the broker or service they started on entry.

Wait for Readiness#

cb wait package-cache --timeout 15
cb wait package-cache --start --timeout 15

cb wait exits successfully only when the service reports ready=true. Use --start when startup itself should be part of the user-visible action.

Show Endpoints#

cb endpoint package-cache
cb endpoint package-cache default --json

Endpoint output shows the resolved URL for services that declare local TCP or HTTP endpoints.

Restart#

cb restart package-cache
cb restart

Restarting a named service keeps the broker running. Restarting without names stops and starts the broker process.