Download codex-rs/cli/src/debug_sandbox/cloud_config.rs from SaylorTwift/codex: direct link, hf CLI and curl.
- Browser
- Download file 1.74 kB
-
https://huggingface.co/SaylorTwift/codex/resolve/main/codex-rs/cli/src/debug_sandbox/cloud_config.rs
- Command line
-
hf download hf://SaylorTwift/codex/codex-rs/cli/src/debug_sandbox/cloud_config.rs
-
curl -L -o cloud_config.rs https://huggingface.co/SaylorTwift/codex/resolve/main/codex-rs/cli/src/debug_sandbox/cloud_config.rs
1.74 kB
| use codex_cloud_config::cloud_config_bundle_loader_for_storage; | |
| use codex_config::CloudConfigBundleLoader; | |
| use codex_config::ConfigLoadOptions; | |
| use codex_core::config::bootstrap_auth_config; | |
| use codex_core::config::load_config_toml_with_layer_stack; | |
| use codex_utils_absolute_path::AbsolutePathBuf; | |
| use toml::Value as TomlValue; | |
| use super::DebugSandboxConfigOptions; | |
| use super::ManagedRequirementsMode; | |
| pub(super) async fn bootstrap_cloud_config_bundle( | |
| cli_overrides: &[(String, TomlValue)], | |
| options: &DebugSandboxConfigOptions, | |
| resolve_codex_home: impl FnOnce() -> std::io::Result<AbsolutePathBuf>, | |
| strict_config: bool, | |
| ) -> anyhow::Result<CloudConfigBundleLoader> { | |
| if options.permissions_profile.is_none() | |
| || !matches!( | |
| options.managed_requirements_mode, | |
| ManagedRequirementsMode::Include | |
| ) | |
| { | |
| return Ok(CloudConfigBundleLoader::default()); | |
| } | |
| let codex_home = resolve_codex_home()?; | |
| let cwd = match options.cwd.as_deref() { | |
| Some(cwd) => AbsolutePathBuf::relative_to_current_dir(cwd)?, | |
| None => AbsolutePathBuf::current_dir()?, | |
| }; | |
| let bootstrap_config = load_config_toml_with_layer_stack( | |
| codex_home.as_path(), | |
| Some(&cwd), | |
| cli_overrides.to_vec(), | |
| ConfigLoadOptions { | |
| loader_overrides: options.loader_overrides.clone(), | |
| strict_config, | |
| cloud_config_bundle: CloudConfigBundleLoader::default(), | |
| }, | |
| ) | |
| .await?; | |
| Ok(cloud_config_bundle_loader_for_storage( | |
| bootstrap_auth_config(codex_home.as_path(), &bootstrap_config)?, | |
| /*enable_codex_api_key_env*/ false, | |
| ) | |
| .await?) | |
| } | |
| mod tests; | |