spacedriveapp/spacedrive · error · anyhow::Error

--remote-device is required

Error message

--remote-device is required

What it means

Error "--remote-device is required" thrown in spacedriveapp/spacedrive.

Source

Thrown at apps/cli/src/domains/library/args.rs:141

	pub local_device: Option<Uuid>,

	/// Use interactive mode (default if no arguments provided)
	#[arg(short, long)]
	pub interactive: bool,
}

impl SetupArgs {
	pub fn is_interactive(&self) -> bool {
		self.interactive || (self.local_library.is_none() && self.remote_device.is_none())
	}

	pub fn to_input(&self, ctx: &crate::context::Context) -> anyhow::Result<LibrarySyncSetupInput> {
		let local_library = self
			.local_library
			.ok_or_else(|| anyhow::anyhow!("--local-library is required"))?;
		let remote_device = self
			.remote_device
			.ok_or_else(|| anyhow::anyhow!("--remote-device is required"))?;

		// Get local device ID from config or argument
		let local_device_id = if let Some(id) = self.local_device {
			id
		} else {
			// Read device config to get current device ID
			let config_path = ctx.data_dir.join("device.json");
			if !config_path.exists() {
				anyhow::bail!("Device config not found. Please specify --local-device");
			}
			let config_data = std::fs::read_to_string(&config_path)?;
			let device_config: sd_core::device::DeviceConfig = serde_json::from_str(&config_data)?;
			device_config.id
		};

		// Determine leader device ID
		let leader = self.leader.as_deref().unwrap_or("local");
		let leader_device_id = match leader {

View on GitHub (pinned to 6dfeccf211)

When it happens

Trigger: Thrown at apps/cli/src/domains/library/args.rs:141 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of spacedriveapp/spacedrive@6dfeccf211 (2026-08-16). Data as JSON: /api/errors/735bb6af0fb2bd38. Report an issue: GitHub.