# Interface ICliDetectionCache

Interface for CLI detection cache. Allows dependency injection for testing.

interface ICliDetectionCache {
get(
cli: "claude" | "gemini" | "codex" | "opencode",
): CliHealthResult | undefined;
set(
cli: "claude" | "gemini" | "codex" | "opencode",
result: CliHealthResult,
): void;
isStale(cli: "claude" | "gemini" | "codex" | "opencode"): boolean;
invalidate(cli?: "claude" | "gemini" | "codex" | "opencode"): void;
getAll(): ReadonlyMap<
"claude"
| "gemini"
| "codex"
| "opencode",
CliHealthResult,
>;
getStats(): CliCacheStats;
getEffectiveTtl(cli: "claude" | "gemini" | "codex" | "opencode"): number;
}

#### Implemented by

- CliDetectionCache

- Defined in packages/nexus-agents/src/cli-adapters/cli-detection-cache.ts:70

##### Index

### Methods

get
set
isStale
invalidate
getAll
getStats
getEffectiveTtl

## Methods

### get

- get(
  cli: "claude" | "gemini" | "codex" | "opencode",
  ): CliHealthResult | undefined

  Get cached health result for a CLI

  #### Parameters

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

  #### Returns CliHealthResult | undefined

  - Defined in packages/nexus-agents/src/cli-adapters/cli-detection-cache.ts:72

### set

- set(
  cli: "claude" | "gemini" | "codex" | "opencode",
  result: CliHealthResult,
  ): void

  Set health result for a CLI

  #### Parameters

  - cli: "claude" | "gemini" | "codex" | "opencode"
  - result: CliHealthResult

  #### Returns void

  - Defined in packages/nexus-agents/src/cli-adapters/cli-detection-cache.ts:75

### isStale

- isStale(cli: "claude" | "gemini" | "codex" | "opencode"): boolean

  Check if cache entry is stale

  #### Parameters

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

  #### Returns boolean

  - Defined in packages/nexus-agents/src/cli-adapters/cli-detection-cache.ts:78

### invalidate

- invalidate(cli?: "claude" | "gemini" | "codex" | "opencode"): void

  Invalidate cache for a specific CLI or all CLIs

  #### Parameters

  - `Optional` cli: "claude" | "gemini" | "codex" | "opencode"

  #### Returns void

  - Defined in packages/nexus-agents/src/cli-adapters/cli-detection-cache.ts:81

### getAll

- getAll(): ReadonlyMap<
  "claude"
  | "gemini"
  | "codex"
  | "opencode",
  CliHealthResult,
  >

  Get all cached results

  #### Returns ReadonlyMap<"claude" | "gemini" | "codex" | "opencode", CliHealthResult>

  - Defined in packages/nexus-agents/src/cli-adapters/cli-detection-cache.ts:84

### getStats

- getStats(): CliCacheStats

  Get cache statistics

  #### Returns CliCacheStats

  - Defined in packages/nexus-agents/src/cli-adapters/cli-detection-cache.ts:87

### getEffectiveTtl

- getEffectiveTtl(cli: "claude" | "gemini" | "codex" | "opencode"): number

  Get effective TTL for a CLI (accounts for adaptive adjustments)

  #### Parameters

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

  #### Returns number

  - Defined in packages/nexus-agents/src/cli-adapters/cli-detection-cache.ts:90