Skip to main content

Module container_cli

Module container_cli 

Source
Expand description

Installing the provider CLI inside a container agent’s container.

The public base image carries no provider CLI, so the first start installs it from npm into a per-agent volume. This module is the pure part: what to install, the marker that says it is done, and the two sh scripts. The docker exec plumbing is in ContainerManager::provision_cli.

Spec: docs/specs/SPEC_CONTAINER_AGENTS_WORK_FOR_EVERYONE_2026_10_07.md section 3.2.

Structs§

CliInstall
What to install for one container agent.
InstallLimits
How long an install may run. The script limits npm itself (script), which kills the whole process group; the host side (run) is the backstop for a script that does not return, and is followed by reap_argv.

Constants§

CHECK_SCRIPT 🔒
$1 command, $2 install dir, $3 marker.
INSTALL_SCRIPT 🔒
$1 install dir, $2 marker, $3 command, $4 seconds npm may run, the rest name@version.
NPM_INSTALL_PATTERN 🔒
Regex (in pkill -f / pgrep -f form) matching the install’s npm. The bracket keeps the reap script’s own command line, which contains this text, from matching itself.
REAP_SCRIPT 🔒
$1 the process pattern.

Functions§

check_says_present
Whether the check script’s output means the CLI is already there.
cli_bin_dir
The directory the turn wrapper appends to PATH.
install_failure_detail
Why an install did not finish, in words for the pane.
output_tail
The last max characters of output, whole lines where possible, trimmed.
reap_argv
argv that kills any npm install into CONTAINER_CLI_DIR and waits for it to be gone. Prints gone and exits 0 only once none is left.
reap_says_gone
Whether the reap script’s output says nothing is left running.