MCPcopy
hub / github.com/danielmiessler/Fabric / handleSetupAndServerCommands

Function handleSetupAndServerCommands

internal/cli/setup_server.go:10–30  ·  view source on GitHub ↗

handleSetupAndServerCommands handles setup and server-related commands Returns (handled, error) where handled indicates if a command was processed and should exit

(currentFlags *Flags, registry *core.PluginRegistry, version string)

Source from the content-addressed store, hash-verified

8// handleSetupAndServerCommands handles setup and server-related commands
9// Returns (handled, error) where handled indicates if a command was processed and should exit
10func handleSetupAndServerCommands(currentFlags *Flags, registry *core.PluginRegistry, version string) (handled bool, err error) {
11 // if the setup flag is set, run the setup function
12 if currentFlags.Setup {
13 err = registry.Setup()
14 return true, err
15 }
16
17 if currentFlags.Serve {
18 registry.ConfigureVendors()
19 err = restapi.Serve(registry, currentFlags.ServeAddress, currentFlags.ServeAPIKey)
20 return true, err
21 }
22
23 if currentFlags.ServeOllama {
24 registry.ConfigureVendors()
25 err = restapi.ServeOllama(registry, currentFlags.ServeAddress, version)
26 return true, err
27 }
28
29 return false, nil
30}

Callers 1

CliFunction · 0.85

Calls 2

ConfigureVendorsMethod · 0.80
SetupMethod · 0.65

Tested by

no test coverage detected