{"record":{"id":"bff5c42eca4ef228","repo":"spacedriveapp/spacedrive","slug":"no-libraries-found-create-a-library-first-with","errorCode":null,"errorMessage":"No libraries found. Create a library first with:\n  sd library create <name>","messagePattern":"No libraries found\\. Create a library first with:\n  sd library create <name>","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"apps/cli/src/domains/library/mod.rs","lineNumber":280,"sourceCode":"\tif !config_path.exists() {\n\t\tanyhow::bail!(\n\t\t\t\"Device config not found. Please run the daemon first to initialize device config.\"\n\t\t);\n\t}\n\tlet config_data = std::fs::read_to_string(&config_path)?;\n\tlet device_config: sd_core::device::DeviceConfig = serde_json::from_str(&config_data)?;\n\tlet local_device_id = device_config.id;\n\n\t// Step 1: Select local library\n\tlet libraries: Vec<sd_core::ops::libraries::list::output::LibraryInfo> = execute_core_query!(\n\t\tctx,\n\t\tsd_core::ops::libraries::list::query::ListLibrariesInput {\n\t\t\tinclude_stats: false\n\t\t}\n\t);\n\n\tif libraries.is_empty() {\n\t\tanyhow::bail!(\n\t\t\t\"No libraries found. Create a library first with:\\n  sd library create <name>\"\n\t\t);\n\t}\n\n\tlet library_choices: Vec<String> = libraries\n\t\t.iter()\n\t\t.map(|lib| format!(\"{} ({})\", lib.name, lib.id))\n\t\t.collect();\n\n\tlet library_idx = select(\"Select local library to sync\", &library_choices)?;\n\tlet local_library_id = libraries[library_idx].id;\n\n\tprintln!(\n\t\t\"\\n✓ Selected local library: {}\\n\",\n\t\tlibraries[library_idx].name\n\t);\n\n\t// Step 2: Select remote device from paired devices","sourceCodeStart":262,"sourceCodeEnd":298,"githubUrl":"https://github.com/spacedriveapp/spacedrive/blob/6dfeccf2113039e35f2ce735f945e70dc3e4ea45/apps/cli/src/domains/library/mod.rs#L262-L298","documentation":"Error \"No libraries found. Create a library first with:\n  sd library create <name>\" thrown in spacedriveapp/spacedrive.","triggerScenarios":"Thrown at apps/cli/src/domains/library/mod.rs:280 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"6dfeccf2113039e35f2ce735f945e70dc3e4ea45","analyzedAt":"2026-08-16T11:26:17.074Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}