Module platform

Module platform 

Source

Enumsยง

CliLoginStdin
Stdin handle for an in-progress CLI login, regardless of whether it was spawned via plain pipes or via a PTY. set_provider_auth writes the OAuth code / pasted token here.

Constantsยง

SETTINGS_TEMPLATE ๐Ÿ”’

Functionsยง

cancel_cli_login
Kill the in-progress CLI login process. Covers both transports: the pipe path uses a oneshot to drop the Tokio Child (kill_on_drop terminates the subprocess); the PTY path uses platform-specific kill-by-PID because the portable_pty::Child lives inside a spawn_blocking task that doesnโ€™t react to outer-task abort.
ensure_auth_dir
Ensure a provider auth directory exists and return its absolute path. Auth dirs are version-isolated under the version-specific config dir.
ensure_settings_file
Ensure settings.json exists in the config directory with the latest template.
extract_commented_setting_key ๐Ÿ”’
extract_url ๐Ÿ”’
Extract an OAuth URL from a line of CLI output. Strips ANSI escape sequences and looks for https://... substrings.
get_about_modal_details
Get details for the About modal.
get_config_dir
Get the app config directory path (version-specific).
get_data_dir
Get the app data directory path (version-specific).
get_docsite_url
Get the documentation site URL.
get_env
Get an environment variable value.
get_host_info
Get comprehensive host info for the hostname popover.
get_host_name
Get the system hostname.
get_is_dev
Check if running in development mode โ€” resolved from the runtime RuntimeMode (launcher-injected env, or the host exe path).
get_platform
Get the current OS platform name.
get_user_home_dir
Get the user home directory used by the frontend for per-agent paths (working dir, GH_CONFIG_DIR, etc.).
get_user_name
Get the current userโ€™s username.
kill_pid ๐Ÿ”’
Platform-specific best-effort kill of a child process by PID.
local_ip_address ๐Ÿ”’
Get the primary non-loopback IPv4 address.
make_cli_cmd ๐Ÿ”’
merge_into_template ๐Ÿ”’
open_external
Open a URL in the systemโ€™s default browser.
open_in_editor
Open a file in the best available code editor.
read_settings_jsonc ๐Ÿ”’
run_cli_login
Spawn a CLI auth login flow.
run_cli_login_pty ๐Ÿ”’
PTY-backed variant of run_cli_login. Used for providers whose auth subcommand requires an interactive TTY (currently OpenClaw โ€” openclaw models auth login --provider <id> exits immediately with โ€œrequires an interactive TTYโ€ when stdin is a pipe).
strip_trailing_commas ๐Ÿ”’