Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/Java/Openclaw/Swabble/Sources/swabble/Commands/   (KI Agentensystem Version 22©)  Datei vom 26.3.2026 mit Größe 781 B image not shown  

Quelle  SetupCommand.swift   Sprache: unbekannt

 
Spracherkennung für: .swift vermutete Sprache: Unknown {[0] [0] [0]} [Methode: Schwerpunktbildung, einfache Gewichte, sechs Dimensionen]

import Commander
import Foundation
import Swabble

@MainActor
struct SetupCommand: ParsableCommand {
    static var commandDescription: CommandDescription {
        CommandDescription(commandName: "setup", abstract: "Write default config")
    }

    @Option(name: .long("config"), help: "Path to config JSON") var configPath: String?

    init() {}
    init(parsed: ParsedValues) {
        self.init()
        if let cfg = parsed.options["config"]?.last { configPath = cfg }
    }

    mutating func run() async throws {
        let cfg = SwabbleConfig()
        try ConfigLoader.save(cfg, at: configURL)
        print("wrote config to \(configURL?.path ?? SwabbleConfig.defaultPath.path)")
    }

    private var configURL: URL? { configPath.map { URL(fileURLWithPath: $0) } }
}

[Dauer der Verarbeitung: 0.18 Sekunden, vorverarbeitet 2026-04-27]