{"record":{"id":"cbcdae822eb7b801","repo":"Hmbown/CodeWhale","slug":"config-export-requires-portable-plain-export-is-not-defined","errorCode":null,"errorMessage":"config export requires --portable; plain export is not defined yet","messagePattern":"config export requires --portable; plain export is not defined yet","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/cli/src/config_bundles.rs","lineNumber":1581,"sourceCode":"        println!(\"nothing to apply; config already matches the bundle (idempotent re-import)\");\n        return Ok(());\n    }\n    println!(\n        \"imported: {} added, {} changed into {}\",\n        receipt.plan.added.len(),\n        receipt.plan.changed.len(),\n        receipt.target.display()\n    );\n    if let Some(backup) = &receipt.backup_path {\n        println!(\"pre-import backup: {}\", backup.display());\n    }\n    Ok(())\n}\n\n/// Run `config export --portable`.\npub fn run_export(args: &ExportArgs, store: &codewhale_config::ConfigStore) -> Result<()> {\n    if !args.portable {\n        bail!(\"config export requires --portable; plain export is not defined yet\");\n    }\n    let scope = if args.project {\n        BundleScope::Project\n    } else {\n        BundleScope::Global\n    };\n    validate_scope_target(scope, store.path())?;\n    let metadata = BundleMetadata {\n        name: None,\n        created_at: Some(chrono::Utc::now().to_rfc3339_opts(chrono::SecondsFormat::Secs, true)),\n        generator: Some(format!(\"codewhale {}\", env!(\"CARGO_PKG_VERSION\"))),\n    };\n    let bundle = export_bundle(&store.config, scope, metadata)?;\n    let body = serialize_bundle(&bundle)?;\n    match &args.out {\n        Some(path) => {\n            codewhale_config::persistence::atomic_write(path, body.as_bytes())\n                .with_context(|| format!(\"writing bundle to {}\", path.display()))?;","sourceCodeStart":1563,"sourceCodeEnd":1599,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/73e0f67d83c59909b571efdfc88c4bc28c309cb1/crates/cli/src/config_bundles.rs#L1563-L1599","documentation":"run_export only implements the portable export mode; calling `config export` without --portable is rejected because plain (non-portable) export semantics are not defined — exporting machine-local config verbatim would produce a bundle that fails portable import elsewhere.","triggerScenarios":"Running `codewhale config export` (optionally with --project) while omitting the --portable flag; ExportArgs.portable is false.","commonSituations":"Following older docs or muscle memory from other tools where plain `export` works; scripting export without reading current CLI help after the flag became mandatory.","solutions":["Add `--portable` to the export command.","Add `--project` alongside --portable if a workspace-scoped bundle is wanted.","Check `codewhale config export --help` for the currently supported flags."],"exampleFix":"// before\ncodewhale config export > bundle.toml\n// after\ncodewhale config export --portable > bundle.toml","handlingStrategy":"validation","validationCode":"if !export_args.portable { eprintln!(\"config export requires --portable\"); std::process::exit(2); }\n","typeGuard":null,"tryCatchPattern":"match run_export(&args, &store) {\n    Err(e) if e.to_string().contains(\"requires --portable\") => {\n        eprintln!(\"re-run with: config export --portable\");\n    }\n    other => other?,\n}","preventionTips":["Always include --portable in scripts that export bundles.","Alias `config export` to include --portable in shell profiles.","Check `config export --help` after CLI upgrades for flag changes."],"tags":["cli","config","export","required-flag"],"backgroundTag":"missing-required-flag","analyzedSha":"73e0f67d83c59909b571efdfc88c4bc28c309cb1","analyzedAt":"2026-09-22T01:30:00.501Z","contentChangedAt":"2026-09-22T01:30:00.501Z","schemaVersion":2},"datasetVersion":"2026-09-22T06:17:15.046Z"}