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

Function apex_server_url

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

Resolve just the apex server URL for a server override. Unlike [`build_apex_client`], this performs **no** identity resolution and no** token minting — it is a pure local config read. Commands use it to namespace local state (e.g. the resolved-key cache) by server before any network I/O, so offline cache hits never touch the network.

(server_override: Option<&str>)

Source from the content-addressed store, hash-verified

133/// namespace local state (e.g. the resolved-key cache) by server before any
134/// network I/O, so offline cache hits never touch the network.
135pub fn apex_server_url(server_override: Option<&str>) -> CliResult<String> {
136 let config = GlobalConfig::load()
137 .map_err(|e| CliError::Internal(anyhow::anyhow!("Failed to load global config: {}", e)))?;
138
139 let server = config
140 .resolve_server(server_override)
141 .map_err(|e| CliError::Internal(anyhow::anyhow!("{}", e)))?
142 .0;
143
144 server
145 .url
146 .clone()
147 .ok_or_else(|| server_url_missing(server_override))
148}
149
150/// Error used when no server is configured — shared by the apex helpers.
151fn server_url_missing(server_override: Option<&str>) -> CliError {

Callers 4

build_apex_client_asFunction · 0.70
resolve_remoteMethod · 0.50
bound_serversMethod · 0.50
executeMethod · 0.50

Calls 3

server_url_missingFunction · 0.85
resolve_serverMethod · 0.80
cloneMethod · 0.45

Tested by

no test coverage detected