Skip to main content

Module cli_handlers

Module cli_handlers 

Source

Structs§

CliNotices 🔒
The CLI notices one ResolveCli call can put in its pane (backend::cli_notice, SPEC_LAUNCH_CONTEXT_WORKSPACE_RULE_AND_STARTUP_FILES_2026_09_30.md §6.3). A probe with no block_id (the picker, the Toolchain pane) puts nothing anywhere.
LocatedCli 🔒
A provider CLI that locate_provider_cli found.

Enums§

CliSource 🔒
Where a CLI found by locate_provider_cli came from.

Functions§

check_cli_auth 🔒
checkcliauth.
claude_credentials_gate 🔒
Phase 1 of the Claude auth check: Some(result) answers “signed out” without running the CLI; None means go on and ask the CLI.
claude_tokens_exist 🔒
Whether the Claude credentials file holds an access or a refresh token.
ensure_provider_auth_dir 🔒
get_cli_version 🔒
The version cli_path reports, asked of the CLI once per file (cli_version.rs): it runs on every agent open, and each probe is a node process.
install_via_npm 🔒
Install the provider’s pinned package with npm and report the result.
is_script_wrapper 🔒
Whether path is a Windows batch script (.cmd/.bat), which runs through cmd.exe and re-parses its arguments.
locate_for_ambient 🔒
locate_provider_cli’s path, for the ambient calls: registered once at startup (ambient::cli_locator).
locate_for_resolve 🔒
Steps 1 and 2 of resolvecli: already there? A provider in the registry goes through the one lookup (locate_provider_cli): AgentMux’s install, else the user’s own copy only when the registry says AgentMux doesn’t install it. A core tool (git, node, …) isn’t in the registry: its install dir, else PATH when the caller sent no package.
locate_provider_cli 🔒
The CLI a launch of provider_id would run, without installing anything: AgentMux’s own install, for every provider. The person’s own copy on PATH or in its installer’s folder only when they listed the provider in cli:usepath (“Use the CLI on my PATH”), and then it comes first. Never otherwise, so a copy on PATH can’t make a missing install read as “found”. The one lookup behind install.check, resolvecli, the launch (agent.open) and the ambient calls, so the agent picker and the Toolchain pane can’t disagree (SPEC_AGENT_PICKER_INLINE_CREATE_2026_10_18.md §1). None for an unknown provider.
locate_provider_cli_with 🔒
make_cli_cmd 🔒
Build a provider-CLI command with this instance’s identity already stripped.
not_installed_refusal 🔒
A CLI that was not found and that resolvecli must not install: AgentMux doesn’t install it (say how to), or the caller sent no package (a look, not an install request).
notice_block_id 🔒
The pane a resolve’s notices go to: the launch target when the caller names one (a quick fork resolves from its source pane), else block_id.
npm_is_available 🔒
Whether npm can be found: where on Windows, which elsewhere.
pi_lists_models 🔒
pi --list-models exits 0 either way; it is signed in when it lists models rather than “No models available”.
probe_cli_version 🔒
Run <cli> --version; None if it timed out or failed.
prune_result 🔒
The wire form of a prune crate::backend::cli_prune::Run.
register_cli_handlers
Register CLI-related RPC handlers (resolvecli, checkcliauth, runclilogin).
resolve_by_download 🔒
resolvecli for a provider that is a release download (Grok, Muse), not an npm package: the pinned file, its hash checked, unpacked under the install lock and marked complete (backend::cli_download).
resolve_cli 🔒
resolvecli: find the CLI, else say how to install it, else install it.
resolve_cli_candidates_on_path 🔒
Every spawnable match for cli_command on PATH that exists, in PATH order.
resolve_cli_on_path 🔒
Resolve a CLI command on the system PATH.
resolve_provider_cli_on_path 🔒
The person’s own copy of a CLI: on PATH, else in the folder its own installer uses (crate::backend::providers::known_install_paths), which may not be on this process’s PATH until AgentMux restarts.
run_auth_check 🔒
Run the provider auth-check CLI against auth_env and parse the verdict. Returns (authenticated, email, auth_method, raw_output). Extracted so the stale-credential self-heal can re-run the exact same check after refreshing.
run_cli_login 🔒
run_npm_install 🔒
One install routine for this and the startup warm-up (cli_install::install_pinned_cli): cross-instance lock held for npm’s whole lifetime — inside the blocking task, so a timed-out RPC can’t release it early — reuse of an install another instance finished while we waited, and the completion marker only after the shim is verified. The pane says it’s installing, then how it went: a pane restored at startup otherwise just starts slower.
spawnable_candidates 🔒
The lines of where/which output a spawn can use. On Windows that is the ones make_cli_cmd can run (.exe / .cmd / .bat), skipping e.g. the extensionless npm shell script; elsewhere which prints one path.
toolchain_env 🔒
toolchain_prune 🔒
toolchain_versions 🔒
widget_api 🔒
widget_api_rejection 🔒
widget_health 🔒