Skip to main content

Module env_utils

Module env_utils 

Source
Expand description

Environment utilities

Functions§

get_aws_region
Get the AWS region with fallback to default Matches the AWS SDK’s region behavior
get_claude_config_home_dir
Get the Claude config home directory
get_default_vertex_region
Get the default Vertex AI region
get_platform
Get platform name
get_teams_dir
Get the teams directory
get_user_type
Get USER_TYPE environment variable
get_vertex_region_for_model
Get the Vertex AI region for a specific model. Different models may be available in different regions.
has_node_option
Check if NODE_OPTIONS contains a specific flag. Splits on whitespace and checks for exact match to avoid false positives.
is_ant_user
Check if running in ant-internal build
is_bare_mode
Check if bare mode is enabled (–bare / AI_CODE_SIMPLE) Skip hooks, LSP, plugin sync, skill dir-walk, attribution, background prefetches, and ALL keychain/credential reads. Auth is strictly ANTHROPIC_API_KEY env or apiKeyHelper from –settings. Explicit CLI flags (–plugin-dir, –add-dir, –mcp-config) still honored.
is_env_defined_falsy
Check if an environment variable is defined as falsy
is_env_truthy
Check if an environment variable value is truthy
is_in_protected_namespace
Conservative check for whether AI Code is running inside a protected (privileged or ASL3+) COO namespace or cluster. Conservative means: when signals are ambiguous, assume protected. Used for telemetry to measure auto-mode usage in sensitive environments. Note: This is a stub - the actual implementation would require platform-specific code
is_running_on_homespace
Check if running on Homespace (ant-internal cloud environment)
is_test_mode
Check if running in test mode
parse_env_vars
Parses an array of environment variable strings into a key-value object
should_maintain_project_working_dir
Check if bash commands should maintain project working directory (reset to original after each command)