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 inspect tool

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

Overview

Concrete tool for checking whether a catalog tool is installed on the host — via native package manager, ecosystem method, or executable presence — provided by the Mitsu armory service module.

Description

The inspect_tool function determines the installation status of a tool:

  1. Native package check: Queries the host's package manager (dpkg, pacman, rpm, apk) to see if the tool's native package is installed.
  2. Ecosystem method check: For each `InstallMethod` in the tool's `install_methods`, checks if the method's binary/package is installed (e.g., Go binary in GOBIN, Cargo install, pipx venv, git clone marker file).
  3. Executable presence: Falls back to checking if any of the tool's `executables` are on PATH.
  4. Managed status: Returns whether the installation is managed by Mitsu (via native package or ecosystem method) or found unmanaged (binary on PATH but not installed by Mitsu).

Returns a `ToolStatus(installed, managed, method_id)` dataclass.

Usage

  • Armory browsing: Called to display tool installation status in the TUI catalog.
  • Install verification: Called after `open_install_terminal` to confirm the install succeeded.
  • Uninstall validation: Called before generating an uninstall script to verify Mitsu can safely identify and remove the installation.

Code Reference

Source Location

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

Signature

def inspect_tool(tool: ToolSpec, environment: HostEnvironment) -> ToolStatus: ...

Import

from mitsu.services.redteam_armory import inspect_tool

I/O Contract

Inputs

Name Type Required Description
tool ToolSpec Yes Catalog tool entry
environment HostEnvironment Yes Host OS and package manager info

Outputs

Name Type Description
returns ToolStatus None)

Usage Examples

Check Tool Status

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

env = detect_host_environment()
nmap = TOOL_BY_ID["nmap"]
status = inspect_tool(nmap, env)

if status.installed:
    print(f"nmap is installed (method: {status.method_id})")
    print(f"Managed by Mitsu: {status.managed}")
else:
    print("nmap is not installed")

Related Pages

Implements Principle

Requires Environment

Uses Heuristic

Page Connections

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