MCPcopy Create free account
hub / github.com/cli/cli / FindByID

Function FindByID

internal/skills/registry/registry.go:350–357  ·  view source on GitHub ↗

FindByID returns the agent host with the given ID, or an error if not found.

(id string)

Source from the content-addressed store, hash-verified

348
349// FindByID returns the agent host with the given ID, or an error if not found.
350func FindByID(id string) (*AgentHost, error) {
351 for i := range Agents {
352 if Agents[i].ID == id {
353 return &Agents[i], nil
354 }
355 }
356 return nil, fmt.Errorf("unknown agent %q, valid agents: %s", id, ValidAgentIDs())
357}
358
359// ValidAgentIDs returns a comma-separated list of valid agent IDs.
360func ValidAgentIDs() string {

Callers 5

selectedAgentHostsFunction · 0.92
resolveHostsFunction · 0.92
TestInstallLocalFunction · 0.92
TestFindByIDFunction · 0.85
TestInstallDirFunction · 0.85

Calls 2

ValidAgentIDsFunction · 0.85
ErrorfMethod · 0.65

Tested by 3

TestInstallLocalFunction · 0.74
TestFindByIDFunction · 0.68
TestInstallDirFunction · 0.68