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

Function apex_server_url

atomic-cli/src/commands/client.rs:136–149  ·  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

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