#!/usr/bin/env node
import {
  BaseCommand,
  EXIT_CODES
} from "../../chunk-SRFNNOLC.js";
import {
  loadProjectSourceConfig,
  saveProjectConfig
} 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/unset-project.ts
init_esm_shims();
import { Args } from "@oclif/core";
var ConfigUnsetProject = class _ConfigUnsetProject extends BaseCommand {
  static summary = "Remove a project-level configuration value";
  static description = "Remove a project-level configuration value";
  static args = {
    key: Args.string({
      description: "Configuration key to remove",
      required: true
    })
  };
  static flags = {
    ...BaseCommand.baseFlags
  };
  async run() {
    const { args } = await this.parse(_ConfigUnsetProject);
    const projectDir = process.cwd();
    const { key } = args;
    const validKeys = ["source", "marketplace", "agentsSource"];
    if (!validKeys.includes(key)) {
      this.error(`Unknown configuration key: ${key}
Valid keys: ${validKeys.join(", ")}`, {
        exit: EXIT_CODES.INVALID_ARGS
      });
    }
    const existingConfig = await loadProjectSourceConfig(projectDir);
    if (!existingConfig) {
      this.logInfo("No project configuration exists.");
      return;
    }
    const newConfig = { ...existingConfig };
    delete newConfig[key];
    await saveProjectConfig(projectDir, newConfig);
    this.logSuccess(`Removed ${key} from project configuration`);
  }
};
export {
  ConfigUnsetProject as default
};
//# sourceMappingURL=unset-project.js.map