MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / resolve_org

Function resolve_org

atomic-cli/src/commands/client.rs:353–371  ·  view source on GitHub ↗

Resolve the org slug for callers that don't already hold a server config. Loads global config, resolves the active server profile, and delegates to [`resolve_org_with_server`] so the identity-personal-org fallback applies consistently.

(org_override: Option<&str>)

Source from the content-addressed store, hash-verified

351/// [`resolve_org_with_server`] so the identity-personal-org fallback applies
352/// consistently.
353pub fn resolve_org(org_override: Option<&str>) -> CliResult<String> {
354 if let Some(s) = org_override {
355 if s.is_empty() {
356 return Err(CliError::InvalidArgument {
357 message: "Organization slug cannot be empty.".to_string(),
358 });
359 }
360 return Ok(s.to_string());
361 }
362
363 let config = GlobalConfig::load()
364 .map_err(|e| CliError::Internal(anyhow::anyhow!("Failed to load global config: {}", e)))?;
365
366 let (server, _name) = config
367 .resolve_server(None)
368 .map_err(|e| CliError::Internal(anyhow::anyhow!("{}", e)))?;
369
370 resolve_org_with_server(None, server)
371}
372
373/// Resolve the workspace slug for a command, with fallback to the
374/// org-scoped default workspace from a server config.

Calls 3

resolve_org_with_serverFunction · 0.85
resolve_serverMethod · 0.80
is_emptyMethod · 0.45