{"record":{"id":"9c9ec577732587ea","repo":"BoundaryML/baml","slug":"exiting","errorCode":null,"errorMessage":"Exiting.","messagePattern":"Exiting\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"info","filePath":"engine/cli/src/deploy.rs","lineNumber":284,"sourceCode":"            None => (\"generators.baml\".into(), String::new(), new_generator_block),\n        };\n\n        println!();\n        println!(\"Your project will be deployed with the following configuration:\");\n        print_diff(&prev_generators, &new_generators);\n        println!();\n\n        let should_append = Confirm::with_theme(&ColorfulTheme::default())\n            .with_prompt(format!(\n                \"Save configuration to {} and deploy your project?\",\n                path.display()\n            ))\n            .show_default(true)\n            .interact()\n            .context(\"Failed to wait for user interaction\")?;\n\n        if !should_append {\n            anyhow::bail!(\"Exiting.\");\n        }\n\n        let generator_abspath = std::path::Path::new(&self.from).join(&path);\n        log::debug!(\"Will write generators to {}\", generator_abspath.display());\n        let mut file = std::fs::OpenOptions::new()\n            .write(true)\n            .create(true)\n            .truncate(false) // This is the default. Linter complains if not added.\n            .open(&generator_abspath)\n            .context(format!(\"Failed to open {}\", generator_abspath.display()))?;\n        writeln!(file, \"{new_generators}\").context(format!(\n            \"Failed to write to {}\",\n            generator_abspath.display()\n        ))?;\n\n        let project_id = match get_or_create {\n            GetOrCreateProjectResult::Existing(project) => project.project_id,\n            GetOrCreateProjectResult::ToBeCreated(project_fqn) => {","sourceCodeStart":266,"sourceCodeEnd":302,"githubUrl":"https://github.com/BoundaryML/baml/blob/bd85ce9dee1463ff04d27efd20531013a4ff46c1/engine/cli/src/deploy.rs#L266-L302","documentation":"`baml deploy` may ask interactively whether to append generators to the user's config. If the user answers no, the CLI intentionally aborts with 'Exiting.' — this is a user-requested cancel, not a bug.","triggerScenarios":"Running deploy_new_project against a project whose generators are not yet in the config, and answering 'No' at the 'should append generators?' dialog prompt.","commonSituations":"First-time deploy of a project, scripted/CI environments where the interactive prompt gets a default-negative or EOF answer.","solutions":["Answer 'Yes' at the prompt to allow the CLI to append generators to your config","Manually add the generator blocks to your baml config before deploying","Run non-interactively only after the config already contains the generators"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// check generators exist in config before deploying\nconst cfg = JSON.parse(fs.readFileSync('baml_config.json'));\nif (!cfg.generators || cfg.generators.length === 0) addGeneratorsFirst();","typeGuard":null,"tryCatchPattern":"try {\n  await deploy();\n} catch (e) {\n  if (String(e).includes('Exiting.')) console.log('Deploy cancelled by user');\n}","preventionTips":["Add generator blocks to baml config before first deploy","Use CI_YES/non-interactive flags after config is complete","Never rely on the interactive prompt in automation"],"tags":["cli","deploy","user-cancel","interactive-prompt"],"backgroundTag":"invalid-state-transition","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"}