# Class CliCircuitBreakerIntegration

Integrates circuit breaker pattern with CLI adapters. Provides automatic fallback when a CLI's circuit opens.

#### Implements

- ICliCircuitBreakerIntegration

- Defined in packages/nexus-agents/src/cli-adapters/cli-circuit-breaker.ts:95

##### Index

### Constructors

constructor

### Methods

execute
getHealthStatus
getCircuitSnapshots
resetCircuit
resetAllCircuits
addStateChangeListener

## Constructors

### constructor

- new CliCircuitBreakerIntegration(
  adapters: readonly ICliAdapter[],
  config?: CliCircuitBreakerConfig,
  logger?: ILogger,
  ): CliCircuitBreakerIntegration

  #### Parameters

  - adapters: readonly ICliAdapter[]
  - `Optional` config: CliCircuitBreakerConfig
  - `Optional` logger: ILogger

  #### Returns CliCircuitBreakerIntegration

  - Defined in packages/nexus-agents/src/cli-adapters/cli-circuit-breaker.ts:101

## Methods

### execute

- execute(
  adapter: ICliAdapter,
  task: CliTask,
  taskCategory?:
  | "planning"
  | "code_generation"
  | "code_review"
  | "research"
  | "architecture"
  | "security_review"
  | "documentation"
  | "testing"
  | "devops"
  | "exploration",
  ): Promise<Result<CircuitProtectedResult, CliError | CircuitError>>

  #### Parameters

  - adapter: ICliAdapter
  - task: CliTask
  - `Optional` taskCategory:
    | "planning"
    | "code_generation"
    | "code_review"
    | "research"
    | "architecture"
    | "security_review"
    | "documentation"
    | "testing"
    | "devops"
    | "exploration"

  #### Returns Promise<Result<CircuitProtectedResult, CliError | CircuitError>>

  Implementation of ICliCircuitBreakerIntegration.execute

  - Defined in packages/nexus-agents/src/cli-adapters/cli-circuit-breaker.ts:115

### getHealthStatus

- getHealthStatus(): CliCircuitHealthStatus

  #### Returns CliCircuitHealthStatus

  Implementation of ICliCircuitBreakerIntegration.getHealthStatus

  - Defined in packages/nexus-agents/src/cli-adapters/cli-circuit-breaker.ts:158

### getCircuitSnapshots

- getCircuitSnapshots(): Map<
  "claude"
  | "gemini"
  | "codex"
  | "opencode",
  CircuitBreakerSnapshot,
  >

  #### Returns Map<"claude" | "gemini" | "codex" | "opencode", CircuitBreakerSnapshot>

  Implementation of ICliCircuitBreakerIntegration.getCircuitSnapshots

  - Defined in packages/nexus-agents/src/cli-adapters/cli-circuit-breaker.ts:183

### resetCircuit

- resetCircuit(cliName: "claude" | "gemini" | "codex" | "opencode"): void

  #### Parameters

  - cliName: "claude" | "gemini" | "codex" | "opencode"

  #### Returns void

  Implementation of ICliCircuitBreakerIntegration.resetCircuit

  - Defined in packages/nexus-agents/src/cli-adapters/cli-circuit-breaker.ts:187

### resetAllCircuits

- resetAllCircuits(): void

  #### Returns void

  Implementation of ICliCircuitBreakerIntegration.resetAllCircuits

  - Defined in packages/nexus-agents/src/cli-adapters/cli-circuit-breaker.ts:192

### addStateChangeListener

- addStateChangeListener(listener: CircuitStateChangeListener): void

  #### Parameters

  - listener: CircuitStateChangeListener

  #### Returns void

  Implementation of ICliCircuitBreakerIntegration.addStateChangeListener

  - Defined in packages/nexus-agents/src/cli-adapters/cli-circuit-breaker.ts:197