{"record":{"id":"48662249ccecb87d","repo":"jdx/mise","slug":"remote-mise-command-must-be-an-executable-name-or","errorCode":null,"errorMessage":"remote mise command must be an executable name or path: {command:?}","messagePattern":"remote mise command must be an executable name or path: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/system/remote.rs","lineNumber":2240,"sourceCode":"        bail!(\"install_mise must not contain '..': {path:?}\");\n    }\n    if matches!(\n        path.rsplit('/').next(),\n        None | Some(\"\") | Some(\".\") | Some(\"~\")\n    ) {\n        bail!(\"install_mise must name an executable file: {path:?}\");\n    }\n    Ok(())\n}\n\nfn validate_remote_executable(command: &str) -> Result<()> {\n    validate_value(\"mise command\", command)?;\n    let is_path = command.contains('/');\n    if command.starts_with('-')\n        || command.contains(['\\n', '\\r'])\n        || (!is_path && command.chars().any(char::is_whitespace))\n    {\n        bail!(\"remote mise command must be an executable name or path: {command:?}\");\n    }\n    Ok(())\n}\n\nfn shell_quote(value: &str) -> String {\n    shell_words::join([value])\n}\n\nfn normalize_os(value: &str) -> String {\n    match value.trim().to_ascii_lowercase().as_str() {\n        \"darwin\" | \"macos\" => \"macos\".to_string(),\n        \"linux\" => \"linux\".to_string(),\n        other => other.to_string(),\n    }\n}\n\nfn normalize_arch(value: &str) -> String {\n    match value.trim().to_ascii_lowercase().as_str() {","sourceCodeStart":2222,"sourceCodeEnd":2258,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/src/system/remote.rs#L2222-L2258","documentation":"The `mise` command used on the remote host is validated by `validate_remote_executable`: it must be either a bare executable name with no whitespace, or a path (containing '/'). Values starting with '-' (option injection), containing newlines, or being a multi-word string that is not a path are rejected because they would be unsafe or unquoteable when embedded into the remote shell command.","triggerScenarios":"Configuring the remote mise command as a full shell invocation like 'mise --dir /x exec' or '/opt/mise mise run', a value starting with '-', or a multi-line value.","commonSituations":"Users trying to smuggle extra flags into the remote command; whitespace in quoted install paths; copy-paste errors adding line breaks or leading dashes.","solutions":["Set the value to a single executable name (e.g. 'mise') or a single absolute path (e.g. '/opt/mise/bin/mise') with no arguments","Move any extra flags/arguments out of the mise-command config and into the command/args it runs","Remove leading dashes and embedded newlines from the value"],"exampleFix":"// before\nmise_command = \"mise --dir /proj exec --\"\n// after\nmise_command = '/opt/mise/bin/mise'","handlingStrategy":"validation","validationCode":"const isPath = cmd.includes('/');\nif (cmd.startsWith('-') || /[\\n\\r]/.test(cmd) || (!isPath && /\\s/.test(cmd)))\n  throw new Error('mise command must be a name or path, no args');","typeGuard":"const isExecutableSpec = (s: unknown): s is string => {\n  if (typeof s !== 'string') return false;\n  const isPath = s.includes('/');\n  return !s.startsWith('-') && !/[\\n\\r]/.test(s) && (isPath || !/\\s/.test(s));\n};","tryCatchPattern":"try { validate_remote_executable(cmd)?; } catch (e) {\n  // strip arguments from the configured command and retry\n}","preventionTips":["Keep the remote mise command a single token: name or absolute path","Pass flags/arguments via the command's own args, never the executable setting","Reject values starting with '-' in config validation","Add shellcheck-style linting for remote command settings"],"tags":["config","shell","validation"],"backgroundTag":"invalid-argument-format","analyzedSha":"533346cc374382b41ec5ff70536252b2e96e725c","analyzedAt":"2026-09-17T13:35:38.149Z","contentChangedAt":"2026-09-17T13:35:38.149Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}