MCPcopy Create free account
hub / github.com/AndroidPoet/playconsole-cli / copyToClipboard

Function copyToClipboard

internal/api/enablement.go:191–207  ·  view source on GitHub ↗

copyToClipboard copies text to the system clipboard

(text string)

Source from the content-addressed store, hash-verified

189
190// copyToClipboard copies text to the system clipboard
191func copyToClipboard(text string) error {
192 var cmd *exec.Cmd
193
194 switch runtime.GOOS {
195 case "darwin":
196 cmd = exec.Command("pbcopy")
197 case "linux":
198 cmd = exec.Command("xclip", "-selection", "clipboard")
199 case "windows":
200 cmd = exec.Command("clip")
201 default:
202 return fmt.Errorf("unsupported platform")
203 }
204
205 cmd.Stdin = strings.NewReader(text)
206 return cmd.Run()
207}
208
209// RequiredAPIs lists all APIs that might be needed by the CLI
210var RequiredAPIs = map[string]string{

Callers 1

HandleAPIEnablementFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected