Jump to content

Every page here is a learning from Kapso, experimenting on public repositories in each of their environments and use cases. Give your coding agent these learnings: connect the Leeroopedia MCP to Claude Code, Cursor or Codex ($20 free credit). Powered by Leeroo · founders@leeroo.com

Implementation:ARCANGEL0 EVA build install script

From Leeroopedia
Knowledge Sources
Domains Tool_Installation, System_Administration
Last Updated 2026-10-29 14:00 GMT

Overview

Concrete tool for generating a complete shell script to install or uninstall an armory tool via native package manager or ecosystem method, with sudo transparency, provided by the Mitsu armory service module.

Description

The build_install_script function assembles a self-contained shell script for installing or uninstalling a catalog tool:

  1. Method selection (install): Calls `_select_install_method` to choose the best install path — native package if available, else ecosystem method (go, cargo, pipx, gem, git, etc.).
  2. Method identification (uninstall): Calls `inspect_tool` to find how the tool was installed, then reverses that method.
  3. Prerequisite detection: Checks for missing prerequisite packages (e.g., Go toolchain) and adds their installation to the script preflight.
  4. Sudo handling: Detects if root is needed; wraps privileged commands with `sudo --` and reports them separately for operator transparency.
  5. Script assembly: Produces a shell script with: header (tool name, method, source), preflight commands, main command, result reporting, and a "Press Enter to close" prompt.

Returns a tuple of (shell_script, method_id, privileged_commands).

Usage

  • Install flow: Called by `open_install_terminal` to generate the script for the terminal window.
  • Agent-managed install: Called by the agent tool host when the agent installs a tool via `armory_run`.

Code Reference

Source Location

  • Repository: Mitsu
  • File: services/redteam_armory.py

Signature

def build_install_script(
    tool: ToolSpec,
    environment: HostEnvironment,
    operation: str,
) -> tuple[str, str, tuple[str, ...]]:

Import

from mitsu.services.redteam_armory import build_install_script

I/O Contract

Inputs

Name Type Required Description
tool ToolSpec Yes Catalog tool entry
environment HostEnvironment Yes Host OS and package manager
operation str Yes "install" or "uninstall"

Outputs

Name Type Description
returns[0] str Complete shell script
returns[1] str Method ID (e.g., "system:apt-get:nmap" or "go:gobuster")
returns[2] tuple[str, ...] Privileged commands requiring sudo (for operator transparency)

Usage Examples

Generate Install Script

from mitsu.services.redteam_armory import build_install_script
from mitsu.armory import TOOL_BY_ID
from mitsu.services.host_environment import detect_host_environment

env = detect_host_environment()
tool = TOOL_BY_ID["gobuster"]

script, method_id, privileged = build_install_script(tool, env, "install")
print(f"Method: {method_id}")
print(f"Privileged commands: {privileged}")
print(f"Script:\n{script}")

Related Pages

Implements Principle

Requires Environment

Uses Heuristic

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment