#!/usr/bin/env node
import {
  BaseCommand,
  EXIT_CODES
} from "../../chunk-SRFNNOLC.js";
import {
  loadProjectSourceConfig,
  resolveAgentsSource,
  resolveSource
} from "../../chunk-ZECXM7LP.js";
import "../../chunk-T4EXUIBY.js";
import "../../chunk-473YHDYQ.js";
import "../../chunk-FVN5PFFY.js";
import {
  init_esm_shims
} from "../../chunk-DHET7RCE.js";

// src/cli/commands/config/get.ts
init_esm_shims();
import { Args } from "@oclif/core";
var ConfigGet = class _ConfigGet extends BaseCommand {
  static summary = "Get a configuration value";
  static description = "Get the effective value of a configuration key (source, author, marketplace, agentsSource)";
  static args = {
    key: Args.string({
      description: "Configuration key (source, author, marketplace, agentsSource)",
      required: true
    })
  };
  static flags = {
    ...BaseCommand.baseFlags
  };
  async run() {
    const { args } = await this.parse(_ConfigGet);
    const projectDir = process.cwd();
    const { key } = args;
    if (key === "source") {
      const resolved = await resolveSource(void 0, projectDir);
      this.log(resolved.source);
    } else if (key === "author") {
      const projectConfig = await loadProjectSourceConfig(projectDir);
      this.log(projectConfig?.author || "");
    } else if (key === "marketplace") {
      const resolved = await resolveSource(void 0, projectDir);
      this.log(resolved.marketplace || "");
    } else if (key === "agentsSource") {
      const resolved = await resolveAgentsSource(void 0, projectDir);
      this.log(resolved.agentsSource || "");
    } else {
      this.error(
        `Unknown configuration key: ${key}
Valid keys: source, author, marketplace, agentsSource`,
        { exit: EXIT_CODES.INVALID_ARGS }
      );
    }
  }
};
export {
  ConfigGet as default
};
//# sourceMappingURL=get.js.map