{"record":{"id":"3c92940e206126eb","repo":"jdx/mise","slug":"no-tool-specified-and-not-running-interactively","errorCode":null,"errorMessage":"No tool specified and not running interactively","messagePattern":"No tool specified and not running interactively","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/cli/use.rs","lineNumber":514,"sourceCode":"                    style(\"mise\").green(),\n                    style(&path).cyan().for_stderr(),\n                );\n            }\n            if !remove.is_empty() {\n                let tools_to_remove = remove.iter().map(|r| r.to_string()).join(\", \");\n                miseprintln!(\n                    \"{} {} removed: {tools_to_remove}\",\n                    style(\"mise\").green(),\n                    style(&path).cyan().for_stderr(),\n                );\n            }\n        }\n        Ok(())\n    }\n\n    async fn tool_selector(&self) -> Result<ToolArg> {\n        if !console::user_attended_stderr() {\n            bail!(\"No tool specified and not running interactively\");\n        }\n        let theme = crate::ui::theme::get_theme();\n        let mut s = demand::Select::new(\"Tools\")\n            .description(\"Select a tool to install\")\n            .filtering(true)\n            .filterable(true)\n            .theme(&theme);\n        for tool in crate::tool_catalog::search(\"\")\n            .await\n            .into_iter()\n            .filter(|tool| tool.selectable())\n            .unique_by(|tool| tool.canonical_id().to_string())\n        {\n            let id = tool.canonical_id().to_string();\n            let description = tool.selector_description().to_string();\n            s = s.option(demand::DemandOption::new(id).description(&description));\n        }\n        ctrlc::show_cursor_after_ctrl_c();","sourceCodeStart":496,"sourceCodeEnd":532,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/src/cli/use.rs#L496-L532","documentation":"`mise use` with no tool arguments launches an interactive selector (tool_selector) when it can prompt the user. If stderr is not attended (no TTY, e.g. CI, piped scripts), the selector cannot run, so mise bails asking the caller to name a tool.","triggerScenarios":"Running bare `mise use` (no tool args) in a non-interactive context: CI pipelines, `mise use < script`, piped stderr, docker build RUN steps, or output redirected away from a terminal.","commonSituations":"CI config mistakenly running plain `mise use`; scripts that expect `mise use` to be a no-op; copy-pasting interactive instructions into automation.","solutions":["Specify the tool explicitly: `mise use node@22` instead of bare `mise use`.","Ensure stderr is a TTY if interaction is intended (run it in a real terminal).","Use `mise ls` non-interactively to decide which tool to pin in a script, then pass it."],"exampleFix":"// before (CI script)\nmise use\n// after\nmise use node@22 terraform@1.9","handlingStrategy":"fallback","validationCode":"if [ -t 2 ]; then mise use; else mise use <tool>@<version>; fi","typeGuard":null,"tryCatchPattern":"if ! mise use 2>/dev/null; then\n  echo 'non-interactive: specify tools explicitly'\n  mise use node@22\nfi","preventionTips":["Never run bare `mise use` in CI or scripts; always pass tool@version","Detect TTY before invoking interactive commands","Use `mise ls` to script tool selection instead of the interactive picker"],"tags":["cli","interactive","tty"],"backgroundTag":"missing-required-argument","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"}