{"id":"395e7a12266b2325","repo":"docker/cli","slug":"no-remote-command-specified","errorCode":null,"errorMessage":"no remote command specified","messagePattern":"no remote command specified","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/connhelper/ssh/ssh.go","lineNumber":148,"sourceCode":"\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"invalid host: %w\", err)\n\t}\n\n\treturn append(args, \"--\", host), nil\n}\n\n// Command returns the ssh flags and arguments to execute a command\n// (remoteCommandAndArgs) on the remote host. Where needed, it quotes\n// values passed in remoteCommandAndArgs to account for ssh executing\n// the remote command in a shell. It returns an error if no remote command\n// is passed, or when unable to quote the remote command.\n//\n// Important: to preserve backward-compatibility, Command does not currently\n// perform sanitization or quoting on the sshFlags and callers are expected\n// to sanitize this argument.\nfunc (sp *Spec) Command(sshFlags []string, remoteCommandAndArgs ...string) ([]string, error) {\n\tif len(remoteCommandAndArgs) == 0 {\n\t\treturn nil, errors.New(\"no remote command specified\")\n\t}\n\tsshArgs, err := sp.args(sshFlags...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tremoteCommand, err := quoteCommand(remoteCommandAndArgs...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif remoteCommand != \"\" {\n\t\tsshArgs = append(sshArgs, remoteCommand)\n\t}\n\treturn sshArgs, nil\n}\n\n// quoteCommand returns the remote command to run using the ssh connection\n// as a single string, quoting values where needed because ssh executes\n// these in a POSIX shell.","sourceCodeStart":130,"sourceCodeEnd":166,"githubUrl":"https://github.com/docker/cli/blob/e9452d6e785f6e365712b9d71bd7517591773c86/cli/connhelper/ssh/ssh.go#L130-L166","documentation":"Error \"no remote command specified\" thrown in docker/cli.","triggerScenarios":"Thrown at cli/connhelper/ssh/ssh.go:148 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"analyzedSha":"e9452d6e785f6e365712b9d71bd7517591773c86","analyzedAt":"2026-08-01T07:09:22.474Z","schemaVersion":2}