{"record":{"id":"1f0e76d2b039230c","repo":"BoundaryML/baml","slug":"empty-command","errorCode":null,"errorMessage":"Empty command","messagePattern":"Empty command","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"engine/baml-runtime/src/cli/repl.rs","lineNumber":1639,"sourceCode":"            }\n        }\n\n        // Cleanup terminal\n        disable_raw_mode()?;\n        execute!(std::io::stdout(), DisableMouseCapture, LeaveAlternateScreen)?;\n        // Ensure the progress bar is hidden on exit\n        if supports_progress && progress_active {\n            send_graphical_progress(0);\n        }\n        println!(\"Goodbye!\");\n        Ok(())\n    }\n\n    #[allow(clippy::print_stdout)]\n    fn handle_command(&self, state: &mut ReplState, input: &str) -> Result<Option<String>> {\n        let parts: Vec<&str> = input[1..].split_whitespace().collect();\n        if parts.is_empty() {\n            return Err(anyhow!(\"Empty command\"));\n        }\n\n        match parts[0] {\n            \"load\" | \"l\" => {\n                if parts.len() != 2 {\n                    return Err(anyhow!(\"Usage: :load <path> (or :l <path>)\"));\n                }\n                let path = PathBuf::from(parts[1]);\n                state.load_baml_sources(path)?;\n                Ok(Some(\"\".to_string())) // Success message already printed\n            }\n            \"reset\" | \"r\" => {\n                state.reset();\n                Ok(Some(\"\".to_string())) // Success message already printed\n            }\n            \"vars\" | \"v\" => Ok(Some(state.list_variables())),\n            \"thir\" => match state.dump_thir() {\n                Ok(output) => Ok(Some(output)),","sourceCodeStart":1621,"sourceCodeEnd":1657,"githubUrl":"https://github.com/BoundaryML/baml/blob/bd85ce9dee1463ff04d27efd20531013a4ff46c1/engine/baml-runtime/src/cli/repl.rs#L1621-L1657","documentation":"handle_command parses input starting with ':' by splitting the remainder on whitespace; if nothing follows the colon there is no command to dispatch, so it raises 'Empty command'. It is a guard against bare ':' inputs.","triggerScenarios":"Typing just ':' (or ':' followed only by whitespace) at the REPL prompt — parts[1..].split_whitespace() yields no tokens.","commonSituations":"Accidentally pressing Enter after ':', truncated paste of a command, confusion about command syntax.","solutions":["Type the command name after the colon, e.g. :help or :load","Run :help to see available commands","Remove stray whitespace-only input and re-enter the command"],"exampleFix":"// before\n:\n// after\n:help","handlingStrategy":"validation","validationCode":"// Caller-side check before dispatching a REPL command\nif input.trim() == \":\" { return Err(anyhow!(\"Provide a command after ':'\")); }","typeGuard":null,"tryCatchPattern":"match result { Err(e) if e.to_string() == \"Empty command\" => println!(\"Usage: :help\"), other => { let _ = other; } }","preventionTips":["Never send a bare ':' to the REPL command parser","Trim input and require a non-empty command token","Use :help to discover valid commands"],"tags":["repl","cli","empty-input"],"backgroundTag":"empty-required-field","analyzedSha":"bd85ce9dee1463ff04d27efd20531013a4ff46c1","analyzedAt":"2026-09-12T03:38:25.718Z","contentChangedAt":"2026-09-12T03:38:25.718Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}