# Function createCliDetectionCache

CLI Adapters exports - CLI integration with defensive parsing Split from index.ts for file size compliance (Issue #285)

- createCliDetectionCache(
  config?: Partial<CliDetectionCacheConfig>,
  ): ICliDetectionCache

  Creates a CLI detection cache instance.

  #### Parameters

  - `Optional` config: Partial<CliDetectionCacheConfig>

    Optional cache configuration

  #### Returns ICliDetectionCache

  CLI detection cache

  #### Example

      const cache = createCliDetectionCache({ ttlMs: 60_000 }); // 1 minute TTL
      const result = cache.get('claude');
      if (!result) {
        const health = await adapter.healthCheck();
        cache.set('claude', CliDetectionCache.fromHealthStatus(health));
      }

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