{"record":{"id":"6b1d88cc168f0344","repo":"BoundaryML/baml","slug":"usage-load-path-or-l-path","errorCode":null,"errorMessage":"Usage: :load <path> (or :l <path>)","messagePattern":"Usage: :load <path> \\(or :l <path>\\)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"engine/baml-runtime/src/cli/repl.rs","lineNumber":1645,"sourceCode":"        // 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)),\n                Err(e) => Err(e),\n            },\n            \"type\" | \"t\" => {\n                if parts.len() < 2 {\n                    return Err(anyhow!(\"Usage: :type <expression> (or :t <expression>)\"));\n                }","sourceCodeStart":1627,"sourceCodeEnd":1663,"githubUrl":"https://github.com/BoundaryML/baml/blob/bd85ce9dee1463ff04d27efd20531013a4ff46c1/engine/baml-runtime/src/cli/repl.rs#L1627-L1663","documentation":"REPL usage error: the `:load` (or `:l`) command was given an argument count other than exactly one. The command requires a single path argument to the baml sources directory; the arg-count check fires before any loading is attempted.","triggerScenarios":":load with zero arguments (:load) or more than one (:load ./a ./b) — parts.len() != 2 in handle_command.","commonSituations":"Forgetting the path argument, paths containing spaces that were not quoted so they split into multiple tokens, pasting a command with trailing junk.","solutions":["Provide exactly one path: :load <path-to-baml_src>","Quote paths containing spaces: :load \"/path/with spaces/baml_src\"","Run :help to confirm command syntax"],"exampleFix":"// before\n:load ./my project/src\n// after\n:load \"./my project/src\"","handlingStrategy":"validation","validationCode":"// Validate argument count before invoking\nlet args: Vec<&str> = input[1..].split_whitespace().skip(1).collect();\nlet ok = args.len() == 1;\n// Quote paths containing spaces: :load \"/path/with spaces\"","typeGuard":null,"tryCatchPattern":"match result { Err(e) if e.to_string().starts_with(\"Usage: :load\") => println!(\"{e}; example: :load ./baml_src\"), other => { let _ = other; } }","preventionTips":["Always pass exactly one quoted path argument","Quote paths with spaces","Check :help for exact syntax"],"tags":["repl","cli","usage"],"backgroundTag":"missing-cli-argument","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"}