#!/usr/bin/env node
import {
  BaseCommand
} from "./chunk-SRFNNOLC.js";
import {
  DEFAULT_SOURCE,
  SOURCE_ENV_VAR,
  formatOrigin,
  getProjectConfigPath,
  loadProjectSourceConfig,
  resolveAgentsSource,
  resolveSource
} from "./chunk-ZECXM7LP.js";
import {
  DEFAULT_BRANDING
} from "./chunk-FVN5PFFY.js";
import {
  init_esm_shims
} from "./chunk-DHET7RCE.js";

// src/cli/commands/config/show.ts
init_esm_shims();
var ConfigShow = class _ConfigShow extends BaseCommand {
  static summary = "Show current effective configuration";
  static description = "Display the current effective configuration with all layers (env, project, default)";
  static flags = {
    ...BaseCommand.baseFlags
  };
  async run() {
    await this.parse(_ConfigShow);
    const projectDir = process.cwd();
    this.log(`
${DEFAULT_BRANDING.NAME} Configuration
`);
    const resolved = await resolveSource(void 0, projectDir);
    this.log("Source:");
    this.log(`  ${resolved.source}`);
    this.log(`  (from ${formatOrigin("source", resolved.sourceOrigin)})`);
    this.log("");
    this.log("Marketplace:");
    if (resolved.marketplace) {
      this.log(`  ${resolved.marketplace}`);
    } else {
      this.log(`  (not configured)`);
    }
    this.log("");
    const agentsResolved = await resolveAgentsSource(void 0, projectDir);
    this.log("Agents Source:");
    if (agentsResolved.agentsSource) {
      this.log(`  ${agentsResolved.agentsSource}`);
      this.log(`  (from ${formatOrigin("agents", agentsResolved.agentsSourceOrigin)})`);
    } else {
      this.log(`  (not configured - using local CLI)`);
    }
    this.log("");
    this.log("Configuration Layers:");
    this.log("");
    const envValue = process.env[SOURCE_ENV_VAR];
    this.log(`  1. Environment (${SOURCE_ENV_VAR}):`);
    if (envValue) {
      this.log(`     ${envValue}`);
    } else {
      this.log(`     (not set)`);
    }
    const projectConfig = await loadProjectSourceConfig(projectDir);
    const projectConfigPath = getProjectConfigPath(projectDir);
    this.log(`  2. Project config:`);
    this.log(`     ${projectConfigPath}`);
    if (projectConfig?.source || projectConfig?.marketplace || projectConfig?.agentsSource) {
      if (projectConfig?.source) {
        this.log(`     source: ${projectConfig.source}`);
      }
      if (projectConfig?.marketplace) {
        this.log(`     marketplace: ${projectConfig.marketplace}`);
      }
      if (projectConfig?.agentsSource) {
        this.log(`     agentsSource: ${projectConfig.agentsSource}`);
      }
    } else {
      this.log(`     (not configured)`);
    }
    this.log(`  3. Default:`);
    this.log(`     ${DEFAULT_SOURCE}`);
    this.log("");
    this.log("Precedence: flag > env > project > default");
    this.log("");
  }
};

export {
  ConfigShow
};
//# sourceMappingURL=chunk-M2XPTQDT.js.map